/* Import Google Fonts - Inter and Outfit */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary-green: #00b53f;
    --primary-green-hover: #009e37;
    --bg-gray: #ebf2ee;
    --bg-light: #f4f6f5;
    --accent-orange: #fea03c;
    --accent-orange-hover: #e58f2d;
    --text-dark: #1b2a32;
    --text-muted: #6c8ea0;
    --white: #ffffff;
    --border-color: #e5e9eb;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* Common Layout Components */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* Desktop Header */
header.main-header {
    background-color: var(--primary-green);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jiji-logo {
    height: 38px;
    fill: var(--white);
    display: flex;
    align-items: center;
}

.header-tagline {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 12px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    cursor: pointer;
}

.lang-selector:hover {
    opacity: 1;
}

.auth-link {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
}

.auth-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.sell-btn {
    background-color: var(--accent-orange);
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 36px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px rgba(254, 160, 60, 0.2);
    text-transform: uppercase;
    transition: var(--transition);
}

.sell-btn:hover {
    background-color: var(--accent-orange-hover);
    box-shadow: 0 6px 12px rgba(254, 160, 60, 0.35);
    transform: translateY(-2px);
}

/* Hero Section (Search Banner) */
.hero-section {
    background: linear-gradient(135deg, var(--primary-green) 0%, #00872f 100%);
    color: var(--white);
    padding: 48px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

.hero-title {
    font-size: 32px;
    margin-bottom: 24px;
    font-weight: 700;
}

.search-bar-wrapper {
    background-color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    max-width: 760px;
    margin: 0 auto;
    padding: 6px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.search-region {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    border-right: 1px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 140px;
}

.search-region svg {
    color: var(--text-muted);
}

.search-input-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.search-input-container input {
    width: 100%;
    border: none;
    outline: none;
    padding: 0 16px;
    font-size: 15px;
    color: var(--text-dark);
}

.search-input-container input::placeholder {
    color: var(--text-muted);
}

.search-submit-btn {
    background-color: var(--primary-green);
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-submit-btn:hover {
    background-color: var(--primary-green-hover);
    transform: scale(1.05);
}

/* Category Quick Suggestions below search */
.search-suggestions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: rgba(255,255,255,0.85);
}

.suggestion-pill {
    background-color: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-pill:hover {
    background-color: rgba(255,255,255,0.25);
    color: var(--white);
}

/* Homepage main content split layout */
.main-content {
    padding: 32px 0 64px 0;
}

.split-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

/* Left Sidebar Categories (Desktop) */
.sidebar-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    height: fit-content;
}

.sidebar-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    border-left: 3px solid transparent;
}

.sidebar-category-item:hover {
    background-color: var(--bg-light);
    color: var(--primary-green);
    border-left-color: var(--primary-green);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.category-arrow {
    color: var(--text-muted);
    font-size: 12px;
}

/* Banners list */
.banners-slider {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
    scrollbar-width: none; /* Hide scrollbar on Firefox */
}

.banners-slider::-webkit-scrollbar {
    display: none; /* Hide scrollbar on Chrome/Safari */
}

.banner-item {
    flex: 0 0 260px;
    height: 76px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
}

.banner-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.banner-item img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.banner-text-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.banner-text-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

/* Grid & Cards (Trending ads) */
.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.toggle-btn.active, .toggle-btn:hover {
    background-color: var(--primary-green);
    color: var(--white);
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Ad Card styles */
.ad-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 2px solid transparent;
}

.ad-card.promoted {
    border-color: var(--accent-orange);
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-img-wrapper {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background-color: var(--bg-light);
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ad-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    color: var(--text-muted);
    z-index: 10;
    transition: var(--transition);
}

.fav-btn:hover {
    transform: scale(1.1);
    color: #ff3b30;
}

.fav-btn.active {
    color: #ff3b30;
}

.card-badge-container {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5;
}

.card-badge {
    background-color: rgba(27, 42, 50, 0.75);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(2px);
    width: fit-content;
}

.card-badge.verified-badge {
    background-color: rgba(0, 86, 147, 0.85);
}

.card-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
    line-height: 1.4;
}

.card-description {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 32px;
    line-height: 1.4;
}

.card-attributes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: auto;
    padding-bottom: 8px;
}

.attr-pill {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.close-modal-btn {
    font-size: 20px;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
}

.location-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 8px;
    font-weight: 500;
}

.location-item:hover {
    background-color: var(--bg-light);
}

.location-item.selected {
    background-color: rgba(0, 181, 63, 0.1);
    color: var(--primary-green);
}

/* Auth Modal specifics */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 181, 63, 0.1);
}

.submit-btn {
    width: 100%;
    background-color: var(--primary-green);
    color: var(--white);
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    margin-top: 8px;
}

.submit-btn:hover {
    background-color: var(--primary-green-hover);
}

/* Bottom Navigation (Mobile Only) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    z-index: 100;
    height: 64px;
    border-top: 1px solid var(--border-color);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    flex: 1;
    height: 100%;
    position: relative;
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item.active {
    color: var(--primary-green);
}

.nav-item.sell-nav-item {
    top: -12px;
    height: 60px;
    flex-grow: 0;
    width: 60px;
    background-color: var(--accent-orange);
    border-radius: var(--radius-full);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(254, 160, 60, 0.4);
    transition: var(--transition);
}

.nav-item.sell-nav-item:hover {
    background-color: var(--accent-orange-hover);
    transform: translateY(-2px);
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 25%;
    background-color: #ff3b30;
    color: var(--white);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    border: 2px solid var(--white);
}

/* Mobile search UI elements (Hidden on Desktop) */
.mobile-search-header {
    display: none;
    background-color: var(--primary-green);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-search-bar {
    display: flex;
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.mobile-search-bar input {
    border: none;
    outline: none;
    font-size: 14px;
    width: 100%;
}

/* Category Grid (Mobile) */
.mobile-categories-section {
    display: none;
    background-color: var(--white);
    padding: 16px;
    margin-bottom: 12px;
}

.mobile-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.mobile-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    cursor: pointer;
}

.mobile-category-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-category-icon-wrapper img {
    width: 24px;
    height: 24px;
}

.mobile-category-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category Page (search.html) Styles */
.search-results-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 24px 0;
}

.filter-sidebar {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.filter-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.filter-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.price-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-inputs input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
}

/* Product Detail Page (product.html) Styles */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    padding: 24px 0;
}

.product-main-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.product-gallery {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.main-image-view {
    height: 450px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-view img {
    max-height: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
}

.thumb-img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
}

.thumb-img.active {
    border-color: var(--primary-green);
    opacity: 1;
}

.product-info-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.product-info-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-green);
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.product-info-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.product-info-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.product-attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.product-attribute-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
}

.attr-name {
    color: var(--text-muted);
    font-weight: 500;
}

.attr-value {
    color: var(--text-dark);
    font-weight: 600;
}

.product-description-section {
    padding-top: 20px;
}

.product-description-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.product-description-text {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
    white-space: pre-line;
}

/* Sidebar Seller Card */
.sticky-seller-card {
    position: sticky;
    top: 96px;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.seller-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background-color: var(--primary-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.seller-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.seller-rating {
    display: flex;
    gap: 2px;
    color: #ffcc00;
    font-size: 12px;
}

.seller-meta-info {
    font-size: 12px;
    color: var(--text-muted);
}

.seller-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.seller-action-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-call {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-call:hover {
    background-color: var(--primary-green-hover);
}

.btn-chat {
    background-color: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-chat:hover {
    background-color: rgba(0, 181, 63, 0.05);
}

.safety-card {
    background-color: #fff9e6;
    border: 1px solid #ffe89e;
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 12px;
    color: #7a5f00;
}

.safety-title {
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.safety-list {
    list-style-type: disc;
    padding-left: 16px;
}

/* Post Ad Form Styles */
.post-ad-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    max-width: 800px;
    margin: 24px auto;
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.post-ad-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--primary-green);
}

.drag-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-light);
    transition: var(--transition);
}

.drag-drop-zone:hover {
    border-color: var(--primary-green);
    background-color: rgba(0, 181, 63, 0.02);
}

.upload-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.uploaded-previews {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.preview-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background-color: rgba(0,0,0,0.6);
    color: var(--white);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Page (chat.html) Styles */
.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 72px);
    background-color: var(--white);
}

.chat-inbox-sidebar {
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.inbox-header {
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.inbox-list-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.inbox-list-item:hover, .inbox-list-item.active {
    background-color: var(--bg-light);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background-color: var(--primary-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chat-info {
    flex-grow: 1;
    overflow: hidden;
}

.chat-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-partner-name {
    font-weight: 600;
    font-size: 14px;
}

.chat-timestamp {
    font-size: 10px;
    color: var(--text-muted);
}

.chat-snippet-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.chat-snippet {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f0f2f5;
}

.chat-window-header {
    background-color: var(--white);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-window-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-bubble {
    max-width: 60%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.msg-bubble.sent {
    background-color: #e2f7cb;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.msg-bubble.received {
    background-color: var(--white);
    align-self: flex-start;
    border-top-left-radius: 0;
}

.msg-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}

.chat-window-footer {
    background-color: var(--white);
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-input-wrapper {
    flex-grow: 1;
    background-color: var(--bg-light);
    border-radius: var(--radius-full);
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 44px;
}

.chat-input-wrapper input {
    width: 100%;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
}

.chat-send-btn {
    background-color: var(--primary-green);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile Page (profile.html) Styles */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 24px 0;
}

.profile-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.profile-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background-color: var(--primary-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 16px auto;
}

.profile-card-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.profile-card-rating {
    display: flex;
    justify-content: center;
    gap: 2px;
    color: #ffcc00;
    margin-bottom: 12px;
}

.profile-menu {
    list-style-type: none;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    text-align: left;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.profile-menu-item:hover, .profile-menu-item.active {
    background-color: var(--bg-light);
    color: var(--primary-green);
}

.profile-details-content {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.profile-content-tab {
    display: none;
}

.profile-content-tab.active {
    display: block;
}

.profile-tab-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Responsive Styles - Mobile-First Overrides */
@media (max-width: 1024px) {
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Hide desktop elements */
    header.main-header,
    .split-layout > .sidebar-card,
    .search-results-layout > .filter-sidebar,
    .product-detail-layout > .sticky-seller-card,
    .profile-layout > .profile-card,
    .chat-layout > .chat-inbox-sidebar {
        display: none !important;
    }

    body {
        padding-bottom: 64px; /* Space for sticky bottom nav */
    }

    .container {
        padding: 0 12px;
    }

    /* Show mobile elements */
    .mobile-bottom-nav,
    .mobile-search-header,
    .mobile-categories-section {
        display: block;
    }

    /* Homepage full width */
    .split-layout, .search-results-layout, .product-detail-layout, .profile-layout {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    /* Mobile grids - 2 columns instead of 4 */
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-price {
        font-size: 14px;
    }

    .card-title {
        font-size: 12px;
        height: 34px;
    }

    .card-description {
        display: none; /* Hide snippet on mobile to keep clean */
    }

    .card-attributes {
        display: none;
    }

    .hero-section {
        padding: 24px 0;
    }

    .hero-title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .search-bar-wrapper {
        display: none; /* Desktop search banner not on mobile */
    }

    /* Detail page responsive */
    .main-image-view {
        height: 280px;
    }

    .product-info-title {
        font-size: 16px;
    }

    .product-info-price {
        font-size: 20px;
    }

    .product-attributes-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Mobile Detail Sticky Bottom Action Bar */
    .mobile-product-sticky-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
        padding: 10px 16px;
        display: flex;
        gap: 12px;
        z-index: 101;
    }

    .mobile-product-sticky-bottom .seller-action-btn {
        flex: 1;
        padding: 12px;
        font-size: 13px;
    }

    /* Chat layout responsive */
    .chat-layout {
        grid-template-columns: 1fr;
        height: calc(100vh - 120px);
    }

    .chat-window {
        display: flex;
    }

    .chat-window-messages {
        padding: 12px;
    }

    .msg-bubble {
        max-width: 80%;
    }

    .post-ad-card {
        padding: 16px;
        margin: 12px;
    }
}
