/**
 * DrCheck Preowned - Main Stylesheet
 * Dark/Light theme with premium automotive aesthetic
 */

/* ============================================
   CSS Variables & Theme System
   ============================================ */
:root {
    /* Brand Colors */
    --brand-yellow: #F7E500;
    --brand-yellow-hover: #FFD700;
    --brand-red: #E63946;
    --brand-red-dark: #C1121F;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', var(--font-sans);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Borders */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Container */
    --container-max: 1400px;
    --header-height: 72px;
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --bg-primary: #0A0A0B;
    --bg-secondary: #111113;
    --bg-tertiary: #18181B;
    --bg-elevated: #1F1F23;
    --bg-hover: #27272A;
    
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-tertiary: #71717A;
    --text-muted: #52525B;
    
    --border-default: #27272A;
    --border-subtle: #1F1F23;
    --border-strong: #3F3F46;
    
    --accent: var(--brand-yellow);
    --accent-hover: var(--brand-yellow-hover);
    --accent-text: #0A0A0B;
    
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);
    
    --card-bg: linear-gradient(145deg, #111113 0%, #0A0A0B 100%);
    --glass-bg: rgba(17, 17, 19, 0.8);
    --overlay: rgba(0, 0, 0, 0.7);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --bg-elevated: #FFFFFF;
    --bg-hover: #E5E7EB;
    
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --text-muted: #9CA3AF;
    
    --border-default: #E5E7EB;
    --border-subtle: #F3F4F6;
    --border-strong: #D1D5DB;
    
    --accent: #1F1F23;
    --accent-hover: #0A0A0B;
    --accent-text: #FFFFFF;
    
    --success: #16A34A;
    --success-bg: rgba(22, 163, 74, 0.1);
    --warning: #D97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --error: #DC2626;
    --error-bg: rgba(220, 38, 38, 0.1);
    --info: #2563EB;
    --info-bg: rgba(37, 99, 235, 0.1);
    
    --card-bg: linear-gradient(145deg, #FFFFFF 0%, #F9FAFB 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --overlay: rgba(0, 0, 0, 0.5);
    
    --brand-yellow: #1F1F23;
    --brand-yellow-hover: #0A0A0B;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    color: var(--text-secondary);
}

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

/* ============================================
   Layout
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding-top: var(--header-height);
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    transition: all var(--transition-base);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--text-xl);
    color: var(--text-primary);
}

.logo-icon {
    height: 40px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text-dr {
    color: var(--brand-red);
    font-size: var(--text-sm);
    font-weight: 600;
}

.logo-text-check {
    font-size: var(--text-lg);
    letter-spacing: -0.02em;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: var(--text-sm);
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.card-body {
    padding: var(--space-lg);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.card-price {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.card-price-currency {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-tertiary);
}

/* ============================================
   Listing Card (Vehicle)
   ============================================ */
.listing-card {
    position: relative;
}

.listing-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.listing-badge.excellent {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.listing-badge.good {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.listing-badge.fair {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

.listing-badge.sold {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.listing-actions {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 10;
    display: flex;
    gap: var(--space-xs);
}

.listing-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.listing-action-btn:hover {
    background: var(--accent);
    color: var(--accent-text);
}

.listing-action-btn.active {
    background: var(--brand-red);
    color: white;
}

.listing-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-md);
}

.listing-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.listing-meta-item svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Rating Badge
   ============================================ */
.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
}

.rating-badge svg {
    width: 14px;
    height: 14px;
    color: var(--brand-yellow);
}

[data-theme="light"] .rating-badge svg {
    color: #F59E0B;
}

.rating-badge-score {
    color: var(--text-primary);
}

/* ============================================
   Grid Layouts
   ============================================ */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-xl);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    padding: var(--space-3xl) 0;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, var(--bg-tertiary) 0%, transparent 70%);
    z-index: -1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Search Bar
   ============================================ */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-sm);
    max-width: 700px;
    margin: 0 auto;
    transition: all var(--transition-fast);
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(247, 229, 0, 0.1);
}

[data-theme="light"] .search-bar:focus-within {
    box-shadow: 0 0 0 3px rgba(31, 31, 35, 0.1);
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-base);
    color: var(--text-primary);
    outline: none;
}

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

.search-filters {
    display: flex;
    gap: var(--space-xs);
    padding-right: var(--space-sm);
    border-right: 1px solid var(--border-default);
    margin-right: var(--space-sm);
}

.search-filter-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: var(--text-2xl);
}

.section-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.section-link:hover {
    color: var(--accent);
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    width: fit-content;
}

.tab {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(247, 229, 0, 0.1);
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(31, 31, 35, 0.1);
}

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

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--error);
    margin-top: var(--space-xs);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-brand-desc {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-md);
}

.footer-title {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-xl);
    margin-top: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.footer-socials {
    display: flex;
    gap: var(--space-sm);
}

.footer-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer-social-link:hover {
    background: var(--accent);
    color: var(--accent-text);
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }
    
    .nav-main {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero {
        padding: var(--space-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .search-bar {
        flex-direction: column;
        padding: var(--space-md);
    }
    
    .search-filters {
        width: 100%;
        padding-right: 0;
        border-right: none;
        margin-right: 0;
        padding-bottom: var(--space-sm);
        border-bottom: 1px solid var(--border-default);
        margin-bottom: var(--space-sm);
    }
    
    .search-input {
        padding: var(--space-sm) 0;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-up {
    animation: slideUp var(--transition-slow) ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Stagger animations for grid items */
.listings-grid > * {
    animation: slideUp var(--transition-slow) ease-out backwards;
}

.listings-grid > *:nth-child(1) { animation-delay: 0ms; }
.listings-grid > *:nth-child(2) { animation-delay: 50ms; }
.listings-grid > *:nth-child(3) { animation-delay: 100ms; }
.listings-grid > *:nth-child(4) { animation-delay: 150ms; }
.listings-grid > *:nth-child(5) { animation-delay: 200ms; }
.listings-grid > *:nth-child(6) { animation-delay: 250ms; }
.listings-grid > *:nth-child(7) { animation-delay: 300ms; }
.listings-grid > *:nth-child(8) { animation-delay: 350ms; }
.listings-grid > *:nth-child(9) { animation-delay: 400ms; }

/* ============================================
   Lightbox Gallery
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
}

.lightbox-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    z-index: 10;
}

.lightbox-prev { left: var(--space-md); }
.lightbox-next { right: var(--space-md); }

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.lightbox-caption {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--text-sm);
    text-align: center;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-default);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 999;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    padding: var(--space-lg);
}

.mobile-nav-link {
    display: block;
    padding: var(--space-md) 0;
    font-size: var(--text-lg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 10000;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    width: 100%;
    max-width: 600px;
    padding: 0 var(--space-md);
}

.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-sm);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.flash-success { border-left: 4px solid var(--success); }
.flash-error { border-left: 4px solid var(--error); }
.flash-warning { border-left: 4px solid var(--warning); }
/**
 * Auth Pages Styles
 */

.auth-page {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo {
    display: inline-block;
    margin-bottom: var(--space-lg);
}

.auth-header h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-xs);
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    margin-top: 2px;
}

.checkbox-label a {
    color: var(--accent);
}

.forgot-link {
    font-size: var(--text-sm);
    color: var(--accent);
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-xs);
}

.password-toggle:hover {
    color: var(--text-secondary);
}

.phone-input-wrapper {
    position: relative;
}

.phone-prefix {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.phone-input {
    padding-left: 60px;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: var(--space-lg) 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-default);
}

.auth-divider span {
    position: relative;
    background: var(--bg-secondary);
    padding: 0 var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.social-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.auth-footer {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.auth-footer a {
    color: var(--accent);
    font-weight: 500;
}

@media (max-width: 480px) {
    .auth-card {
        padding: var(--space-lg);
    }
    
    .social-login {
        grid-template-columns: 1fr;
    }
    
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}
