        @import "theme.css";

/* Ads Page Styles */
        :root {
            --primary: #2563eb;
            --primary-dark: #1e40af;
            --secondary: #64748b;
            --accent: #f59e0b;
            --success: #10b981;
            --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
            --navbar-height: 76px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            color: var(--text-primary);
            background: var(--bg-secondary);
            overflow-x: hidden;
            padding-top: var(--navbar-height);
        }

        /* Navbar */
        .navbar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            backdrop-filter: blur(10px);
            background: rgba(255,255,255,0.95) !important;
            border-bottom: 1px solid #e2e8f0;
            padding: 1rem 0;
            transition: all 0.3s ease;
            z-index: 1030;
        }

        .navbar-brand {
            font-weight: 700;
            font-size: 1.5rem;
            color: var(--primary) !important;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .navbar-brand img {
            transition: transform 0.3s ease;
        }

        .navbar-brand:hover img {
            transform: scale(1.1) rotate(5deg);
        }

        .nav-link {
            font-weight: 500;
            color: #64748b !important;
            padding: 0.5rem 1rem !important;
            transition: color 0.3s ease;
            position: relative;
        }

        .nav-link:hover {
            color: var(--primary) !important;
        }

        .nav-link::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 0;
            height: 2px;
            background: var(--primary);
            transition: all 0.3s ease;
            transform: translateX(-50%);
        }

        .nav-link:hover::after {
            width: 80%;
        }

        /* Page Container */
        .page-container {
            display: flex;
            min-height: calc(100vh - var(--navbar-height));
            max-width: 1800px;
            margin: 0 auto;
        }

        /* Sidebar */
        .sidebar {
            width: 280px;
            flex-shrink: 0;
            background: #fff;
            border-right: 1px solid #e2e8f0;
            position: sticky;
            top: var(--navbar-height);
            height: calc(100vh - var(--navbar-height));
            overflow-y: auto;
            padding: 1.5rem;
            transition: transform 0.3s ease;
        }

        .sidebar::-webkit-scrollbar {
            width: 6px;
        }

        .sidebar::-webkit-scrollbar-track {
            background: #f1f5f9;
        }

        .sidebar::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            padding: 2rem;
            min-width: 0;
        }

        /* Breadcrumb */
        .breadcrumb-container {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 12px;
            padding: 1rem 1.5rem;
            margin-bottom: 2rem;
            border: 1px solid #e2e8f0;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        }

        .breadcrumb {
            background: transparent;
            padding: 0;
            margin: 0;
            border-radius: 0;
        }

        .breadcrumb-item {
            display: flex;
            align-items: center;
        }

        .breadcrumb-item + .breadcrumb-item::before {
            content: "›";
            color: #94a3b8;
            font-weight: 600;
            font-size: 1.2rem;
            margin: 0 0.5rem;
        }

        .breadcrumb-item a {
            color: #64748b;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.2s ease;
            padding: 0.25rem 0.5rem;
            border-radius: 6px;
        }

        .breadcrumb-item a:hover {
            color: var(--primary);
            background: rgba(37, 99, 235, 0.1);
        }

        .breadcrumb-item.active {
            color: #1e293b;
            font-weight: 600;
        }

        /* Category Header */
        .category-header {
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            border-radius: 16px;
            padding: 2.5rem;
            margin-bottom: 2rem;
            border: 1px solid #e2e8f0;
            box-shadow: 0 8px 32px rgba(0,0,0,0.08);
            position: relative;
            overflow: hidden;
        }

        .category-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--gradient-1);
        }

        .category-icon-large {
            width: 80px;
            height: 80px;
            border-radius: 16px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
            position: relative;
            overflow: hidden;
        }

        .category-icon-large img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 16px;
        }

        .category-icon-large::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
            pointer-events: none;
        }

        .category-header h1 {
            font-size: 2.25rem;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 0.5rem;
            background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .category-header .text-muted {
            font-size: 1.1rem;
            color: #64748b;
            font-weight: 400;
            margin-bottom: 0;
        }

        .category-stats {
            display: flex;
            gap: 1.5rem;
            justify-content: flex-end;
        }

        .stat-item {
            text-align: center;
            padding: 1rem;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            min-width: 120px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        }

        .stat-number {
            display: block;
            font-size: 2rem;
            font-weight: 700;
            color: var(--primary);
            line-height: 1;
            margin-bottom: 0.25rem;
        }

        .stat-label {
            font-size: 0.875rem;
            color: #64748b;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Responsive adjustments for header */
        @media (max-width: 768px) {
            .category-header {
                padding: 2rem 1.5rem;
            }

            .category-header h1 {
                font-size: 1.75rem;
            }

            .category-icon-large {
                width: 60px;
                height: 60px;
            }

            .category-stats {
                justify-content: center;
                margin-top: 1.5rem;
            }

            .stat-item {
                min-width: 100px;
            }

            .breadcrumb-container {
                padding: 0.75rem 1rem;
                margin-bottom: 1.5rem;
            }
        }

        @media (max-width: 575px) {
            .category-header {
                padding: 1.5rem 1rem;
                text-align: center;
            }

            .category-header .row {
                text-align: center;
            }

            .category-header .d-flex {
                justify-content: center;
            }

            .category-stats {
                justify-content: center;
            }

            .stat-item {
                min-width: 80px;
            }
        }

        .filter-group {
            margin-bottom: 1.5rem;
        }

        .filter-group label {
            font-weight: 600;
            font-size: 0.875rem;
            color: #334155;
            margin-bottom: 0.5rem;
            display: block;
        }

        .filter-group .form-control,
        .filter-group .form-select {
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            padding: 0.625rem 0.875rem;
            font-size: 0.9rem;
            transition: all 0.2s ease;
        }

        .filter-group .form-control:focus,
        .filter-group .form-select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .price-range {
            display: flex;
            gap: 0.75rem;
            align-items: center;
        }

        .price-range input {
            flex: 1;
        }

        /* View Toggle */
        .view-toggle {
            display: flex;
            gap: 0.5rem;
            background: white;
            padding: 0.25rem;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
        }

        .view-toggle .btn {
            border: none;
            background: transparent;
            color: #64748b;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.875rem;
            transition: all 0.2s ease;
        }

        .view-toggle .btn:hover {
            background: #f8fafc;
            color: #334155;
        }

        .view-toggle .btn.active {
            background: var(--primary);
            color: white;
            box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
        }

        /* Ads Grid */
        .ads-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        /* Ads List */
        .listings-list {
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }

        .listing-list-item {
            display: flex;
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            transition: all 0.3s ease;
            border: 1px solid #f1f5f9;
        }

        .listing-list-item:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
            border-color: #e2e8f0;
        }

        .listing-list-image {
            width: 180px;
            height: 140px;
            flex-shrink: 0;
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .listing-list-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .listing-list-content {
            flex: 1;
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
        }

        .listing-list-header {
            margin-bottom: 0.5rem;
        }

        .listing-list-title {
            font-weight: 600;
            font-size: 1.125rem;
            margin-bottom: 0;
            color: #1e293b;
        }

        .listing-list-description {
            color: #64748b;
            font-size: 0.9rem;
            line-height: 1.5;
            margin-bottom: 0.75rem;
            display: -webkit-box;
            line-clamp: 2;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .listing-list-footer {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-top: auto;
        }

        .listing-list-price {
            background: var(--accent);
            color: white;
            padding: 0.3rem 0.5rem;
            border-radius: 10px;
            font-weight: 700;
            font-size: 0.75rem;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
            display: inline-block;
        }

        /* Ad Cards (Grid View) */
        .listing-card {
            border: none;
            border-radius: 16px;
            overflow: hidden;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
            background: white;
            border: 1px solid #f1f5f9;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .listing-card:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-lg);
            border-color: #e2e8f0;
        }

        .ad-image, .listing-list-image {
            height: 200px;
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ad-image img, .listing-list-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            padding: 0.2rem;
            display: block;
        }

        .ad-image .no-image-svg, .listing-list-image .no-image-svg {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg,#f1f5f9 0%, #e2e8f0 100%);
            color: #64748b;
        }

        .no-image-svg i {
            font-size: 2.25rem;
            color: #94a3b8;
        }

        .ad-image::before, .listing-list-image::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
            transition: all 0.3s ease;
        }

        .listing-card:hover .ad-image::before, .listing-card:hover .listing-list-image::before {
            background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.2) 100%);
        }

        .image-badge {
            position: absolute;
            top: 8px;
            left: 8px;
            width: 60px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            z-index: 1;
        }

        .image-badge i {
            font-size: 0.8rem;
        }

        .listing-card .card-body {
            padding: 1.25rem;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .listing-card .card-title {
            font-weight: 600;
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: #1e293b;
        }

        .listing-card .price {
            background: var(--accent);
            color: white;
            padding: 0.3rem 0.5rem;
            border-radius: 10px;
            font-weight: 700;
            font-size: 0.75rem;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
            display: inline-block;
        }

        .listing-card .btn-sm {
            padding: 0.5rem 1.5rem;
            border-radius: 50px;
            font-weight: 600;
        }

        /* Loading */
        .loading {
            text-align: center;
            padding: 40px;
        }

        .loading i {
            font-size: 2rem;
            color: var(--primary);
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* Footer */
        footer {
            background: #1e293b;
            color: white;
            padding: 2rem 0;
            margin-top: 5rem;
        }

        footer .text-muted {
            color: #94a3b8 !important;
        }

        /* Sidebar Overlay */
        .sidebar-overlay {
            display: none;
            position: fixed;
            top: auto;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1025;
            backdrop-filter: blur(2px);
        }

        .sidebar-overlay.show {
            display: block;
        }

        /* Mobile Filter Toggle */
        .mobile-filter-toggle {
            display: none;
        }

        /* Toggle Sidebar */
        .toggle-sidebar {
            display: none;
        }

        /* Responsive */
        @media (max-width: 991px) {
            .page-container {
                flex-direction: column;
            }

            .sidebar {
                position: fixed;
                top: var(--navbar-height);
                left: 0;
                width: 320px;
                height: calc(100vh - var(--navbar-height));
                z-index: 1030;
                transform: translateX(-100%);
                border-right: none;
                box-shadow: none;
                padding: 1.5rem;
            }

            .sidebar.show {
                transform: translateX(0);
                box-shadow: var(--shadow-lg);
            }

            .main-content {
                padding: 1.5rem 1rem;
            }

            .toggle-sidebar {
                display: block;
            }

            .mobile-filter-toggle {
                display: flex;
                align-items: center;
                justify-content: center;
                position: fixed;
                bottom: 1.5rem;
                right: 1.5rem;
                z-index: 1020;
                width: 56px;
                height: 56px;
                border-radius: 50%;
                background: var(--gradient-1);
                color: white;
                border: none;
                box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
                font-size: 1.25rem;
            }

            .mobile-filter-toggle:hover {
                transform: scale(1.05);
            }

            .ads-grid {
                grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
                gap: 1rem;
            }

            .listing-list-item {
                flex-direction: row;
            }

            .listing-list-image {
                width: 120px;
                height: 90px;
                flex-shrink: 0;
            }
            .view-toggle{
                display: none;
            }

            .listing-list-price, .featured-promotion .listing-list-price {
                position: absolute;
                bottom: 3px;
                left: 3px;
                background: rgba(245, 158, 11, 0.9);
                color: #212529;
                padding: 0.2rem 0.4rem;
                border-radius: 6px;
                font-weight: 700;
                font-size: 0.75rem;
                box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
                z-index: 2;
            }

            .listing-list-footer {
                display: none;
            }
        }

        @media (max-width: 575px) {
            .ads-grid {
                grid-template-columns: 1fr;
            }

            .main-content {
                padding: 1rem 0.75rem;
            }
        }

        /* ============================================
           DARK MODE STYLES FOR ADS
           ============================================ */

        html.dark-mode .sidebar {
            background: var(--input-bg);
            border-right-color: var(--border-color);
            color: var(--text-primary);
        }

        html.dark-mode .sidebar .form-label {
            color: var(--text-primary);
        }

        html.dark-mode .sidebar .form-control,
        html.dark-mode .sidebar .form-select {
            background: var(--input-bg);
            color: var(--text-primary);
            border-color: var(--border-color);
        }

        html.dark-mode .sidebar .form-control:focus,
        html.dark-mode .sidebar .form-select:focus {
            background: var(--input-bg);
            color: var(--text-primary);
            border-color: var(--primary);
        }

        html.dark-mode .sidebar .btn-link {
            color: var(--primary);
        }

        html.dark-mode .main-content {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        html.dark-mode .breadcrumb {
            background: transparent;
        }

        html.dark-mode .breadcrumb-item {
            color: var(--text-secondary);
        }

        html.dark-mode .breadcrumb-item.active {
            color: var(--text-primary);
        }

        html.dark-mode .breadcrumb-item a {
            color: var(--primary);
        }

        html.dark-mode .ads-grid,
        html.dark-mode .listings-list {
            color: var(--text-primary);
        }

        html.dark-mode .listing-card {
            background: var(--card-bg);
            border-color: var(--border-color);
            color: var(--text-primary);
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }

        html.dark-mode .listing-card:hover {
            box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
        }

        html.dark-mode .listing-card .card-body {
            background: var(--card-bg);
        }

        html.dark-mode .listing-card .card-title {
            color: var(--text-primary);
        }

        html.dark-mode .listing-card .text-muted {
            color: var(--text-secondary);
        }

        html.dark-mode .listing-list-item {
            background: var(--card-bg);
            border-color: var(--border-color);
            color: var(--text-primary);
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }

        html.dark-mode .listing-list-item:hover {
            box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
        }

        html.dark-mode .no-image-svg {
            background: var(--bg-tertiary);
            color: var(--text-muted);
        }

        html.dark-mode .image-badge {
            background: var(--primary-dark);
            color:white;
            border-color: var(--primary-dark);
        }

        html.dark-mode .sidebar-overlay {
            background: rgba(0,0,0,0.5);
        }

        html.dark-mode .results-badge {
            background: var(--primary);
            color: white;
        }

        html.dark-mode .btn-outline-secondary {
            color: var(--text-primary);
            border-color: var(--border-color);
        }

        html.dark-mode .btn-outline-secondary:hover {
            background: var(--bg-tertiary);
            border-color: var(--border-color);
            color: var(--text-primary);
        }