/* Base Styles & Variables */
:root {
    --primary-color: rgba(1, 181, 144, 1);
    --primary-color-hover: rgba(1, 160, 128, 1);
    --secondary-color: rgba(47, 49, 125, 1);
    --secondary-color-hover: rgba(35, 37, 95, 1);
    --background-color: #f4f6f9;
    --text-dark: #333333;
    --text-light: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hide mobile elements on desktop */
.mobile-only {
    display: none !important;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Header & Navigation */
.main-header {
    background-color: var(--text-light);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    /* Increased padding to make navbar taller */
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-item {
    font-weight: 500;
    color: var(--text-dark);
}

.nav-item:hover {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 5px;
}

.mobile-nav-actions {
    display: none;
    align-items: center;
    gap: 10px;
}

.mobile-search-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 5px;
}

.mobile-search-bar {
    display: none;
    background: white;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.mobile-search-bar.active {
    display: block;
}

.mobile-search-bar form {
    display: flex;
    gap: 5px;
    background: #f0f2f5;
    padding: 5px 15px;
    border-radius: 50px;
}

.mobile-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    outline: none;
    font-size: 0.95rem;
}

.mobile-search-bar button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.1rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-color-hover);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: var(--secondary-color-hover);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 100px 0;
    text-align: center;
    color: var(--text-light);
    overflow: hidden;
    min-height: 450px;
    display: flex;
    align-items: center;
}

.hero-slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--desktop-bg);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-banner.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero .container {
    position: relative;
    z-index: 3;
}

.hero h1 {
    color: var(--text-light);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: var(--text-light);
    border-radius: var(--radius);
    padding: 5px;
    box-shadow: var(--shadow-lg);
}

/* Navbar Search Bar (Desktop Only) */
.nav-search-bar {
    display: none; /* Hidden by default (mobile) */
}

@media (min-width: 769px) {
    .nav-search-bar {
        display: flex;
        flex: 1;
        max-width: 450px;
        margin: 0 40px;
        background: #f0f2f5;
        border-radius: 50px; /* Fully curved sides */
        padding: 2px 2px 2px 15px;
        border: 1px solid var(--border-color);
        align-items: center;
        transition: var(--transition);
    }

    .nav-search-bar:focus-within {
        border-color: var(--primary-color);
        background: white;
        box-shadow: 0 0 0 3px rgba(1, 181, 144, 0.15);
    }

    .nav-search-input {

        flex: 1;
        border: none;
        background: transparent;
        padding: 8px 0;
        outline: none;
        font-size: 0.9rem;
        color: var(--text-dark);
    }

    .nav-search-btn {
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50px; /* Fully curved button */
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: var(--transition);
    }

    .nav-search-btn:hover {
        background: var(--primary-color-hover);
        transform: scale(1.05);
    }

    /* Hide hero search bar on desktop as it's now in the navbar */
    .hero .search-bar,
    .category-page-full .search-container {
        display: none;
    }
}


.search-input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    outline: none;
    font-size: 1rem;
    border-radius: var(--radius) 0 0 var(--radius);
}

.search-btn {
    border-radius: var(--radius);
    padding: 12px 30px;
}


/* Category Grid */
.categories-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--text-light);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.category-icon-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: var(--transition);
}

.category-card:hover .category-icon {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.category-card:hover .category-icon-img {
    transform: scale(1.1);
}

.category-name {
    font-weight: 600;
    color: var(--text-dark);
}

/* Ad Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.product-card {
    background: var(--text-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #eee;
}

.product-content {
    padding: 12px;
}

.product-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.product-meta {
    font-size: 0.75rem;
    color: #777;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Forms */
.form-container {
    background: var(--text-light);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
    max-width: 500px;
    margin: 40px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(1, 181, 144, 0.2);
}

/* Footer */
.main-footer {
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3 {
    color: var(--text-light);
    margin-bottom: 20px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Dashboard specific */
.dashboard-layout {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}

.dashboard-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.dashboard-nav {
    background: var(--text-light);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dashboard-nav a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 500;
}

.dashboard-nav a:last-child {
    border-bottom: none;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    background-color: rgba(1, 181, 144, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.dashboard-content {
    flex: 1;
    background: var(--text-light);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .mobile-nav-actions {
        display: flex;
    }

    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        background: var(--text-light);
        padding: 20px;
        border-radius: var(--radius);
        box-shadow: var(--shadow-md);
        gap: 15px;
        border: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links .btn {
        width: 100%;
        margin-top: 10px;
    }

    .hero h1 {
        display: none;
    }

    .hero-subtitle {
        display: none;
    }

    .hero p:not(.hero-subtitle) {
        display: none;
    }

    .hero .container p {
        display: none;
    }

    .search-bar {
        flex-direction: row;
        background: var(--text-light);
        box-shadow: var(--shadow-md);
        padding: 4px;
        gap: 0;
        max-width: 100%;
        border-radius: var(--radius);
    }

    .search-input {
        width: 100%;
        flex: 1;
        border-radius: var(--radius) 0 0 var(--radius) !important;
        padding: 12px 15px;
        box-shadow: none;
        font-size: 0.9rem;
    }

    .search-btn {
        width: auto;
        border-radius: 0 var(--radius) var(--radius) 0;
        padding: 12px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* Hide hero search bar on home page mobile */
    .hero .search-bar {
        display: none;
    }

    .hero {
        padding: 15px 0;
        min-height: auto;
        background: var(--background-color);
    }

    .hero-slider-container {
        display: none !important;
    }

    .hero-overlay {
        display: none !important;
    }

    .hero-banner {
        background-image: var(--mobile-bg, var(--desktop-bg));
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only.hero {
        display: flex !important;
    }

    .mobile-only:not(.hero):not(.hero-slider-container) {
        display: block !important;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .category-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .category-card {
        padding: 12px 8px;
        gap: 6px;
    }

    .category-card .category-icon {
        font-size: 1.5rem;
    }

    .category-card .category-icon-img {
        width: 36px;
        height: 36px;
    }

    .category-card .category-name {
        font-size: 0.7rem;
    }

    .categories-section {
        padding: 30px 0;
    }

    .categories-section .section-title {
        margin-bottom: 20px;
        font-size: 1.3rem;
    }

    .dashboard-sidebar {
        width: 100%;
    }

    /* Mobile Ad Grid - 2 columns */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card {
        border-radius: 6px;
    }

    .product-card .product-image {
        aspect-ratio: 1 / 1;
    }

    .product-card .product-content {
        padding: 8px 10px 10px;
    }

    .product-card .product-title {
        font-size: 0.78rem;
        margin-bottom: 4px;
        -webkit-line-clamp: 2;
    }

    .product-card .product-price {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    .product-card .product-meta {
        margin-top: 6px;
        padding-top: 6px;
        font-size: 0.65rem;
        gap: 4px;
    }

    .product-card .product-meta span:first-child {
        max-width: none;
    }
}

/* Category Page Full Width */
.category-page-full {
    width: 100%;
    padding: 0 40px;
}

.category-page-full .dashboard-layout {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}

.category-page-full .dashboard-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.category-page-full .dashboard-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .category-page-full {
        padding: 0 15px;
    }
    
    .category-page-full .dashboard-sidebar {
        width: 100%;
    }
}

/* About Page Specifics */
.about-section {
    padding: 20px 0;
}

.about-card {
    transition: var(--transition);
}

.about-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-md) !important;
}

@media (max-width: 768px) {
    .about-section h2 {
        font-size: 1.8rem !important;
    }

    .about-section {
        padding: 40px 20px !important;
    }
}

/* Star Rating System */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffc107;
}

/* Static Display Stars */
.display-stars {
    color: #ddd;
    font-size: 0.9rem;
    display: inline-flex;
    gap: 2px;
}

.display-stars .fas.fa-star {
    color: #ffc107;
}

/* Review List Styles */
.review-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reviewer-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--secondary-color);
}

.review-date {
    font-size: 0.8rem;
    color: #999;
}

.review-comment {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.empty-reviews {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    background: #f9f9f9;
    border-radius: var(--radius);
}