:root {
    /* Brand Colors - STRICTLY FROM LOGO */
    /* Primary: Blue -> Purple Gradient */
    --primary-blue: #1c4ac6;
    --primary-color: #1c4ac6; /* Fix for undefined var */
    --primary-light: #2157d1;
    --primary-purple: #6c41a2;
    --primary-gradient: linear-gradient(135deg, #1c4ac6 0%, #3a33ae 50%, #6c41a2 100%);
    
    /* Secondary: Deep Purple (Accent) */
    --secondary-color: #581d8f;
    --secondary-gradient: linear-gradient(135deg, #6c41a2 0%, #581d8f 100%);
    
    /* Status Colors */
    --success-green: #1e7e34; /* Darkened for contrast */
    --danger-red: #dc3545;
    
    /* UI Colors */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #212529;
    --text-muted: #5a6268; /* Darkened for contrast */
    --border-color: #dee2e6;
    
    /* Layout */
    --header-height: 70px;
    --bottom-nav-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px)); /* Space for mobile nav including safe area */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul { list-style: none; }

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.main-content {
    min-height: 80vh;
    padding-top: 24px;
    padding-bottom: 40px;
}

/* CTA Sections Background */
.hero-section {
    background: var(--primary-gradient) !important;
}

/* Buttons Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 50px; /* Modern pill shape */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: 0.3px;
    text-decoration: none !important;
}

.btn:active {
    transform: scale(0.96);
}

/* Primary Buttons */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(28, 74, 198, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(28, 74, 198, 0.5);
    transform: translateY(-2px);
    color: white;
}

/* Premium Badges */
.ad-badge, .premium-badge {
    background: var(--secondary-gradient);
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Active Nav Items */
.nav-item.active {
    color: var(--primary-blue);
}
.nav-item.active i {
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Floating Sell Button */
.nav-item-post .icon-circle {
    background: var(--secondary-gradient);
    box-shadow: 0 4px 15px rgba(88, 29, 143, 0.4);
}

/* Price Highlights */
.ad-price {
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Header Buttons Modernization */
.nav-links .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px; /* Softer radius than pill */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: none; /* Cleaner look */
}

/* Register Button */
.nav-links .btn-primary {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.nav-links .btn-primary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 74, 198, 0.2);
}

/* Post Ad Button */
.nav-links .btn-warning {
    background: var(--secondary-gradient);
    color: white !important;
    border: none;
    padding-left: 24px;
    padding-right: 24px;
    box-shadow: 0 4px 12px rgba(88, 29, 143, 0.3);
}

.nav-links .btn-warning:hover {
    box-shadow: 0 6px 16px rgba(88, 29, 143, 0.5);
    transform: translateY(-2px);
}

.nav-links .btn-warning::before {
    content: '\f067'; /* FontAwesome Plus Icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 14px;
    margin-right: 8px;
}

@media (max-width: 1024px) {
    .nav-links .btn {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 7px;
    }
    .nav-links .btn-warning {
        padding-left: 16px;
        padding-right: 16px;
        box-shadow: 0 3px 10px rgba(88, 29, 143, 0.25);
    }
    .nav-links .btn-warning::before {
        font-size: 12px;
        margin-right: 6px;
    }
}

/* Reels Accents (Restored) */
.reel-actions .action-btn.active {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: var(--primary-blue);
}

.btn-block { width: 100%; }

.btn-sm { 
    padding: 8px 16px; 
    font-size: 13px; 
    border-radius: 30px;
}

.btn-outline {
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    background: transparent;
}

.btn-outline:hover {
    background: rgba(28, 74, 198, 0.05);
    transform: translateY(-2px);
}

/* Header */
header {
    background: var(--bg-card);
    height: var(--header-height);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%; /* Ensure full height */
}

.logo img {
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Desktop Search */
.desktop-search {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
    display: none; /* Hidden on mobile */
}

.desktop-search form {
    position: relative;
}

.desktop-search input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    font-size: 15px;
    transition: 0.2s;
}

.desktop-search input:focus {
    background: white;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(28, 74, 198, 0.1);
    outline: none;
}

.desktop-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-lang-switch {
    display: none;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    font-size: 15px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-blue);
}

/* Mobile Bottom Nav (Modern Floating) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 400px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    justify-content: space-evenly;
    align-items: center;
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.3);
}

@media (max-width: 800px) {
    .mobile-nav {
        display: flex;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569; /* Slate-600 for contrast */
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    width: auto;
    flex: 1;
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 16px;
    position: relative; /* For badge positioning */
    max-width: 60px; /* Prevent click targets from overlapping too much */
}

.nav-item i {
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 4px 10px;
    border-radius: 18px;
}

.nav-badge {
    position: absolute;
    top: 5px;
    left: 50%;
    margin-left: 4px;
    background: var(--danger-red);
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 10px;
    border: 2px solid white;
    min-width: 16px;
    text-align: center;
    font-weight: 700;
    line-height: 1;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.mobile-nav .nav-item:hover i,
.mobile-nav .nav-item:focus-visible i {
    color: var(--primary-blue);
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}
.nav-item.active i {
    background: transparent;
    color: var(--primary-blue);
    border: none;
    transform: none;
}
.mobile-nav .nav-item.active i {
    -webkit-text-fill-color: currentColor;
    -webkit-background-clip: initial;
    background-clip: initial;
    background: none;
    box-shadow: none;
}

.nav-item-post {
    position: relative;
    top: -18px;
    width: auto;
    flex: 0 0 auto;
    margin: 0 5px;
}

.nav-item-post .icon-circle {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 25px rgba(28, 74, 198, 0.5);
    font-size: 20px;
    transition: transform 0.2s;
}

.nav-item-post .icon-circle:active {
    transform: scale(0.95);
}

/* Card UI */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(0,0,0,0.02);
}

/* Categories Marquee */
.categories-marquee {
    overflow-x: auto;
    width: 100%;
    position: relative;
    margin-bottom: 40px;
    -webkit-overflow-scrolling: touch;
}

.categories-track {
    display: flex;
    gap: 20px;
    width: max-content;
    padding: 10px 0; /* Space for shadows */
}

.category-item {
    min-width: 120px; /* Fixed width */
    background: white;
    border-radius: 20px;
    padding: 20px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    text-decoration: none;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: rgba(28, 74, 198, 0.1);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: #f0f4ff;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient overlay on icon */
.category-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: 0.3s;
}

.category-item:hover .category-icon {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.1) rotate(-3deg);
    box-shadow: 0 8px 20px rgba(28, 74, 198, 0.3);
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.category-item:hover .category-name {
    color: var(--primary-blue);
}
@media (max-width: 600px) {
    .category-item { min-width: 96px; padding: 12px 8px; gap: 10px; border-radius: 16px; }
    .categories-track { gap: 14px; }
    .category-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
    .category-name { font-size: 12px; }
}

/* Ads Grid & Cards (Modernized) */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* Wider cards */
    gap: 20px;
}

.ad-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* Softer shadow */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.03);
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

/* Footer */
.site-footer {
    background: #0f172a; /* Dark Navy fallback */
    background: linear-gradient(135deg, #1c4ac6 0%, #3a33ae 50%, #6c41a2 100%); /* Match Header Gradient */
    color: #fff;
    padding: 60px 0 20px;
    position: relative;
    overflow: hidden;
}

.footer-bg {
    display: none; /* Hide old bg element since main footer has gradient */
}
.site-footer .footer-content {
    position: relative;
    padding: 40px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
    align-items: start;
}
.footer-col .footer-heading {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}
.footer-text {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.6;
}
.footer-links-list li {
    margin-bottom: 8px;
}
.footer-links-list a {
    color: #cbd5e1;
    font-size: 13px;
}
.footer-links-list a:hover {
    color: #ffffff;
}
.social-links {
    display: flex;
    gap: 10px;
    align-items: center;
}
.social-links .social-icon {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}
.social-links .social-icon:hover {
    background: rgba(255,255,255,0.18);
}
.footer-bottom-bar {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 12px;
    color: #cbd5e1;
}
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.store-buttons {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}
.store-btn.play {
    background: #1a73e8;
    color: #fff;
}
.store-btn.app {
    background: #000;
    color: #fff;
}
.store-btn i {
    font-size: 18px;
}
@media (max-width: 600px) {
    .store-buttons { justify-content: flex-start; }
    .store-btn { width: 100%; justify-content: center; }
}

.ad-slot {
    display: block;
    width: 100%;
    min-height: 180px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}
@media (max-width: 600px) {
    .ad-slot { min-height: 150px; border-radius: 10px; }
}

/* Global Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.5);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.modal .modal-content {
    background: #fff;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 520px;
    width: 100%;
    padding: 20px;
}
.modal .close-modal {
    float: right;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}
.share-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.share-options .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid #eee;
    color: #333;
}
.share-options .share-btn i { color: var(--primary-blue); }

.ad-image-container {
    position: relative;
    padding-top: 66.67%; /* Fallback */
    aspect-ratio: 3/2; /* Modern Aspect Ratio */
    background: #f0f2f5;
    overflow: hidden;
}
@media (max-width: 768px) {
    .ad-image-container { 
        padding-top: 100%; /* Fallback */
        aspect-ratio: 1/1; 
    }
}

.ad-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    background: #f0f2f5;
}

@media (max-width: 768px) {
    .ad-image {
        object-fit: contain; /* Keep full image visible on mobile */
    }
}

.ad-card:hover .ad-image {
    transform: scale(1.05); /* Zoom effect */
}

.ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-gradient);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
    letter-spacing: 0.5px;
}
@media (max-width: 768px) {
    .ad-badge { width: 18px !important; height: 18px !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; border-radius: 50% !important; }
    .ad-badge i { font-size: 11px !important; }
}

.ad-views {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(4px);
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
}

.ad-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ad-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 4px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ad-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    flex: 1; /* Pushes meta to bottom */
}

.ad-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 10px;
}

.ad-meta i {
    color: #777;
    margin-right: 4px;
}

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

/* Video Play Icon Overlay */
.play-icon-small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.video-thumb {
    cursor: pointer;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: 0.2s;
}
.form-control:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 74, 198, 0.1);
}

/* Chat UI (WhatsApp Style) */
.chat-container {
    background: #efe7dd url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png') repeat; /* WhatsApp generic pattern */
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

.message-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-size: 14px;
    line-height: 1.4;
}

.message-bubble.sent {
    background: #dcf8c6;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.message-bubble.received {
    background: white;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.message-time {
    font-size: 10px;
    color: rgba(0,0,0,0.45);
    text-align: right;
    margin-top: 4px;
}

/* Ad Detail Modern Layout */
.ad-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .ad-detail-layout {
        grid-template-columns: 2fr 1fr;
        gap: 40px;
        padding: 30px 20px;
    }
    .desktop-hidden {
        display: none !important;
    }
}

/* Gallery */
.gallery-container {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #000;
    margin-bottom: 20px;
    aspect-ratio: 4/3;
}

@media (min-width: 900px) {
    .gallery-container {
        border-radius: 20px;
        aspect-ratio: 16/9;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
}

.ad-video-container {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
}
@media (min-width: 900px) {
    .ad-video-container {
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
}
.ad-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.video-watermark {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    z-index: 2;
}
.video-watermark .watermark-name {
    font-weight: 700;
    font-size: 14px;
}
.video-watermark .watermark-sub {
    font-size: 12px;
    opacity: 0.9;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed to contain to show full image without cropping */
    background: #000; /* Black background for letterboxing */
    cursor: zoom-in; /* Indicate clickable */
    transition: opacity 0.3s;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    overflow-x: auto;
    background: white;
}

@media (min-width: 900px) {
    .gallery-thumbs { padding: 10px 0; }
}

.thumb-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
    border: 2px solid transparent;
}

.thumb-img:hover, .thumb-img.active {
    opacity: 1;
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

/* Sidebar & Sticky Action Bar */
.sticky-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 12px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: flex;
    gap: 15px;
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 900px) {
    .sticky-bottom-bar {
        position: static;
        box-shadow: none;
        padding: 0;
        display: block;
        background: transparent;
    }
}

/* Detail Components */
.price-tag {
    font-size: 28px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 5px;
}

.seller-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    margin-bottom: 25px;
}

.seller-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--primary-blue);
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 600px) {
    .spec-grid { grid-template-columns: repeat(4, 1fr); }
}

.spec-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    color: #555;
    border: 1px solid #eee;
}

.spec-item i {
    display: block;
    font-size: 18px;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

/* Typography */
.ad-title-lg {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    color: #1a1a1a;
}

@media (min-width: 900px) {
    .ad-title-lg { font-size: 28px; }
}

/* Floating Premium Badge */
.premium-float {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--secondary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 10;
    display: flex;
    align-items: center;
}

/* Video Preview Card - Enhanced Layout */
.video-preview-card .video-info {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #eee;
}

.video-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.file-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.file-name-wrapper .file-icon {
    color: var(--primary-blue);
    font-size: 16px;
}

.file-name-wrapper .file-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove-video {
    background: none;
    border: none;
    color: var(--danger-red);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-video:hover {
    background: rgba(220, 53, 69, 0.1);
}

.video-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 600;
}

.meta-value {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
}

.file-estimate {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--primary-purple);
    font-weight: 500;
}

.file-estimate:empty {
    display: none;
}

.file-estimate::before {
    content: '\f017'; /* fa-clock */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 14px;
}

/* Scrollbar Visibility for Desktop */
@media (min-width: 768px) {
    .reels-scroll-container,
    .categories-marquee {
        scrollbar-width: thin; /* Firefox */
        -ms-overflow-style: auto; /* IE 10+ */
        padding-bottom: 12px; /* Ensure space for scrollbar */
    }
    .reels-scroll-container::-webkit-scrollbar,
    .categories-marquee::-webkit-scrollbar {
        display: block;
        height: 8px;
    }
    .reels-scroll-container::-webkit-scrollbar-thumb,
    .categories-marquee::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.2);
        border-radius: 4px;
    }
    .reels-scroll-container::-webkit-scrollbar-track,
    .categories-marquee::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .reels-scroll-container:hover::-webkit-scrollbar-thumb,
    .categories-marquee:hover::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.3);
    }
}
