@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&family=Almarai:wght@300;400;700;800&family=Noto+Sans+Arabic:wght@300;400;600;700&display=swap');

/* =========================================
   1. Design System Variables
   ========================================= */
:root {
    /* Brand Colors */
    --primary-color: #1e40af;       /* Deep Royal Blue */
    --primary-dark: #1e3a8a;        /* Darker Blue */
    --primary-light: #3b82f6;       /* Lighter Blue */
    --primary-rgb: 30, 64, 175;
    
    --secondary-color: #f59e0b;     /* Amber/Gold */
    --secondary-dark: #d97706;
    --secondary-light: #fbbf24;
    
    --accent-color: #10b981;        /* Emerald Green */
    --danger-color: #ef4444;        /* Red */
    --warning-color: #f59e0b;       /* Orange */
    --info-color: #3b82f6;          /* Blue */

    /* Neutral Colors */
    --text-primary: #111827;        /* Almost Black */
    --text-secondary: #4b5563;      /* Dark Gray */
    --text-muted: #9ca3af;          /* Medium Gray */
    --text-light: #f3f4f6;          /* Light Gray */
    
    --bg-body: #f3f4f6;             /* Light Gray Background */
    --bg-surface: #ffffff;          /* White Surface */
    --bg-surface-alt: #f9fafb;      /* Off-white Surface */
    
    --border-color: #e5e7eb;
    --border-color-dark: #d1d5db;

    /* Typography */
    --font-main: 'Cairo', 'Almarai', 'Noto Sans Arabic', sans-serif;
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Almarai', sans-serif;

    /* Spacing & Layout */
    --container-width: 1280px;
    --header-height: 80px;
    --sidebar-width: 280px;
    --section-spacing: 5rem;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
}

/* =========================================
   2. Reset & Base Styles
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   3. Layout & Utilities
   ========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-spacing) 0;
    position: relative;
}

.section:nth-child(even) {
    background-color: var(--bg-surface-alt);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-4 { gap: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* =========================================
   4. Components
   ========================================= */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    border: 2px solid transparent;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1;
}

.btn-primary, .btn-save, .btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover, .btn-save:hover, .btn-submit:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-danger, .delete-btn {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.btn-danger:hover, .delete-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-outline, .btn-back, .btn-cancel {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover, .btn-back:hover, .btn-cancel:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: var(--bg-surface);
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-label, label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control, input[type="text"], input[type="password"], input[type="email"], textarea, select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-normal);
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

.form-control:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Messages */
.message-box {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.message-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

.message-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

/* =========================================
   Top Banner
   ========================================= */
.top-banner-wrapper {
    position: relative;
    background-color: #0f172a;
    color: white;
    overflow: hidden;
    min-height: 60px;
}

.top-banner-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 400px;
}

.top-banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.top-banner-content {
    width: 100%;
    max-width: var(--container-width);
    padding: 0 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.top-banner-text {
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    backdrop-filter: blur(4px);
    color: white;
    margin: 0;
}

/* =========================================
   5. Header & Navigation
   ========================================= */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
}

.logo img {
    height: 90px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

nav ul {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Mobile nav toggle (hamburger) */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-inline-start: 0.5rem;
}

.nav-toggle .hamburger {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    display: block;
    position: relative;
    transition: transform 0.25s ease;
}

.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle .hamburger::before { top: -7px; }
.nav-toggle .hamburger::after { top: 7px; }

/* Main nav adjustments for mobile */
.main-nav { display: block; }
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .main-nav { display: none; width: 100%; }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav ul li a { display: block; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border-color); }
}

nav a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    background: rgba(30, 64, 175, 0.08);
}

/* Font Picker */
.font-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    background: white;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.font-picker select {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

@media (max-width: 992px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .logo img {
        height: 70px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    nav ul {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .font-picker {
        display: none; /* Hide font picker on mobile to save space if needed, or keep it */
    }
}

/* =========================================
   6. Hero Section
   ========================================= */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 8rem 0 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 10%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 10%);
    background-size: 100% 100%;
    opacity: 0.6;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.hero-buttons .btn-secondary {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
}

.hero-buttons .btn-secondary:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

/* =========================================
   7. Section Headers
   ========================================= */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    margin: 1rem auto 0;
    border-radius: var(--radius-full);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* =========================================
   8. Cars Grid & Cards
   ========================================= */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.car-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.car-image-container {
    height: 240px;
    overflow: hidden;
    position: relative;
}

.car-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.car-card:hover .car-image {
    transform: scale(1.08);
}

.car-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.car-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-card-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.car-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.car-model-badge {
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.car-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
}

.car-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================
   9. Gallery Grid
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* =========================================
   10. Statistics
   ========================================= */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-icon {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-name {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* =========================================
   11. Testimonials
   ========================================= */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    position: relative;
    border: 1px solid var(--border-color);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.testimonial-quote-icon {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.1;
    font-family: serif;
    line-height: 1;
}

.testimonial-rating {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.testimonial-text {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.testimonial-position {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   12. News & Blog
   ========================================= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.news-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.news-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.news-card-summary {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
}

.news-card-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   13. Partners
   ========================================= */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 2rem;
    align-items: center;
}

.partner-logo {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    border: 1px solid var(--border-color);
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition-normal);
}

.partner-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* =========================================
   14. Footer
   ========================================= */
footer {
    background: #111827;
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    border-top: 4px solid var(--secondary-color);
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

footer p {
    color: #9ca3af;
    text-align: center;
    font-size: 0.95rem;
}

/* =========================================
   15. Admin Dashboard
   ========================================= */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-body);
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.admin-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.5rem;
    background: rgba(255,255,255,0.5);
}

.admin-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.admin-nav a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    gap: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
}

.admin-nav a:hover, .admin-nav a.active {
    background: #eff6ff;
    color: var(--primary-color);
}

.admin-nav a.active {
    background: #eff6ff;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.admin-nav i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.admin-main {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 90;
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

/* Admin Tables */
.table-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.table-logo {
    width: 80px;
    height: 60px;
    object-fit: contain;
    background: #fff;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.grid-view {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.grid-view th {
    background: #f8fafc;
    padding: 1.25rem 1rem;
    text-align: right;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.grid-view td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.grid-view tr:last-child td {
    border-bottom: none;
}

.grid-view tr:hover {
    background-color: #f9fafb;
}

/* Admin Dashboard Widgets */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.welcome-banner h2 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 2.5rem;
    font-weight: 800;
}

.dashboard-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.menu-item {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.menu-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    background: #eff6ff;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.menu-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* =========================================
   16. Animations
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   17. Contact Page
   ========================================= */
.contact-form-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    background: var(--bg-surface);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.contact-info-map h3, .contact-form-fields h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--bg-surface-alt);
    padding-bottom: 0.5rem;
}

.contact-info-map p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-info-map strong {
    color: var(--text-primary);
    min-width: 80px;
}

.map-container {
    margin-top: 2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 300px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 768px) {
    .contact-form-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}

/* =========================================
   18. Login Page
   ========================================= */
.login-page {
    background: linear-gradient(135deg, var(--bg-surface-alt) 0%, #dbeafe 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: var(--bg-surface);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-container h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-weight: 800;
}

.login-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    font-size: 1.1rem;
}

/* =========================================
   19. Responsive Design
   ========================================= */
/* Small layout tweaks for medium screens */
@media (max-width: 1024px) {
    :root {
        --container-width: 95%;
        --sidebar-width: 240px;
    }

    .logo img { height: 80px; }
}

/* Mobile & tablet */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --section-spacing: 3rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }

    /* Navigation */
    header .container {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    header {
        height: auto;
        position: relative;
    }

    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Mobile nav behavior - smooth expand */
    .main-nav {
        display: block;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }
    .main-nav.open { max-height: 480px; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav ul li a { display: block; padding: 0.9rem 1rem; border-bottom: 1px solid var(--border-color); }

    /* Admin Sidebar */
    .admin-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 0 100vw rgba(0,0,0,0.5);
    }
    
    .admin-main {
        margin-right: 0;
    }
    
    .admin-header {
        padding: 0 1rem;
    }

    #sidebarToggle {
        display: block !important;
    }

    /* Grids */
    .cars-grid, .gallery-grid, .statistics-grid, .testimonials-grid, .news-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    /* Utility - tables and content scrolling */
    .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Prevent body scroll while overlays/menus are open */
    .no-scroll { overflow: hidden; }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }

    .logo img { height: 68px; }
    .top-banner-wrapper { min-height: 120px; }
}
