/* ========================================
   CARMAN - Design Professionnel Light
   ======================================== */

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

/* Variables CSS - Thème Light Premium */
:root {
    --primary-color: #2f59d6;
    --primary-hover: #2448b2;
    --secondary-color: #6b7280;
    --accent-color: #4b74e6;
    
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-body: #f4f4f7;
    --bg-light: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    
    --text-color: #0f172a;
    --text-light: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    
    --hero-overlay-start: rgba(255, 255, 255, 0.75);
    --hero-overlay-end: rgba(248, 250, 252, 0.85);
    --hero-text-color: #0f172a;
    --hero-subtitle-color: #475569;
    
    --footer-bg: #1a1a1a;
    --footer-border: rgba(255, 255, 255, 0.1);
    --footer-title: #f1f5f9;
    --footer-text: rgba(255, 255, 255, 0.7);
    --footer-text-muted: rgba(255, 255, 255, 0.5);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 12px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Variables CSS - Thème Dark */
[data-theme="dark"] {
    --bg-body: #020617;
    --bg-light: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    
    --text-color: #f1f5f9;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #334155;
    
    --hero-overlay-start: rgba(15, 23, 42, 0.88);
    --hero-overlay-end: rgba(30, 41, 59, 0.85);
    --hero-text-color: #ffffff;
    --hero-subtitle-color: rgba(255, 255, 255, 0.85);
    
    --footer-bg: #0a0f1a;
    --footer-border: rgba(255, 255, 255, 0.05);
    --footer-title: #f1f5f9;
    --footer-text: rgba(255, 255, 255, 0.6);
    --footer-text-muted: rgba(255, 255, 255, 0.4);
    
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-body);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.6s ease, color 0.6s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

/* Logo images (light/dark variants) */
.logo a {
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 150px;
}

/* By default (light theme), show light logo and hide dark logo */
.logo-img.logo-img-light {
    display: block !important;
}

.logo-img.logo-img-dark {
    display: none !important;
}

/* In dark theme, swap logos */
[data-theme="dark"] .logo-img.logo-img-light {
    display: none !important;
}

[data-theme="dark"] .logo-img.logo-img-dark {
    display: block !important;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a:hover::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle-icon {
    font-size: 1.25rem;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(20deg);
}

.theme-toggle:active .theme-toggle-icon {
    transform: rotate(360deg) scale(0.9);
}

/* Bouton menu mobile (caché par défaut, visible en mobile) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    border-color: var(--primary-color);
}

.mobile-menu-icon {
    position: relative;
    width: 18px;
    height: 2px;
    background-color: var(--text-color);
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.25s ease, top 0.25s ease, opacity 0.2s ease;
}

.mobile-menu-icon::before {
    top: -6px;
}

.mobile-menu-icon::after {
    top: 6px;
}

/* État ouvert : burger -> croix */
.mobile-menu-toggle.is-open .mobile-menu-icon {
    background-color: transparent;
}

.mobile-menu-toggle.is-open .mobile-menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle.is-open .mobile-menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Overlay navigation mobile */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1500;
}

.mobile-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-panel {
    width: 80%;
    max-width: 320px;
    background: var(--bg-light);
    padding: 1.5rem 1.5rem 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.mobile-nav-overlay.is-open .mobile-nav-panel {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.mobile-nav-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color);
}

.mobile-nav-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.05rem;
}

.mobile-nav-links a:hover {
    color: var(--primary-color);
}

.mobile-theme-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.mobile-theme-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.mobile-theme-switch {
    position: relative;
    display: inline-flex;
    padding: 0.15rem;
    border-radius: 999px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    overflow: hidden;
    min-width: 150px;
}

.mobile-theme-switch .theme-option {
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 0.45rem 0;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
}

.mobile-theme-switch .theme-option.active {
    color: var(--text-color);
    font-weight: 600;
}

/* Pastille coulissante du switch mobile (style iOS) */
.mobile-theme-switch::before {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: calc(50% - 0.2rem);
    height: calc(100% - 0.3rem);
    border-radius: 999px;
    background: var(--primary-color);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 0.25s ease;
}

[data-theme="dark"] .mobile-theme-switch::before {
    transform: translateX(100%);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--hero-overlay-start) 0%, var(--hero-overlay-end) 100%),
                url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?w=1920') center/cover;
    border-radius: var(--border-radius);
    margin: 2rem 0 4rem;
    overflow: hidden;
    padding: 4rem 2rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
    transition: var(--transition);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    text-align: left;
}

.hero-section h1 {
    font-size: 3.75rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    line-height: 1.1;
    color: var(--hero-text-color);
    transition: color 0.3s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: var(--hero-subtitle-color);
    line-height: 1.5;
    transition: color 0.3s ease;
}

.hero-actions {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.btn-icon {
    margin-right: 0.5rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(47, 89, 214, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(47, 89, 214, 0.5);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

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

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   FEATURES SECTION
   ======================================== */
.features-section {
    margin: 5rem 0;
}

.features-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.feature-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* ========================================
   VEHICLES GRID
   ======================================== */
.page-header {
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
}

.vehicle-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.vehicle-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.vehicle-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.vehicle-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: var(--bg-dark);
    position: relative;
}

.vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-card) 100%);
    transition: var(--transition);
}

.vehicle-card:hover .no-image {
    color: var(--primary-color);
}

.vehicle-info {
    padding: 1.75rem;
}

.vehicle-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.vehicle-version {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    transition: color 0.3s ease;
}

.vehicle-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--bg-hover);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.vehicle-price {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 800;
    margin: 1.5rem 0;
    transition: color 0.3s ease;
}

.vehicle-actions {
    margin-top: 1.5rem;
}

.btn-block {
    width: 100%;
    display: block;
    text-align: center;
}

/* ========================================
   VIEW TOGGLE (cartes/liste)
   ======================================== */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.view-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}

.view-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ========================================
   VEHICLES LIST VIEW
   ======================================== */
.vehicles-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.vehicle-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.vehicle-list-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

/* Thumbnail image en mode liste */
.vehicle-list-image {
    width: 80px;
    height: 55px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-hover);
}

.vehicle-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Infos véhicule en mode liste */
.vehicle-list-info {
    flex: 1;
    min-width: 0;
}

.vehicle-list-main {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.vehicle-list-marque {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
}

.vehicle-list-modele {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.vehicle-list-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Prix en mode liste */
.vehicle-list-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Responsive mode liste */
@media (max-width: 600px) {
    .vehicle-list-item {
        flex-wrap: wrap;
    }
    
    .vehicle-list-image {
        width: 60px;
        height: 45px;
    }
    
    .vehicle-list-price {
        width: 100%;
        text-align: right;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }
}

/* ========================================
   FILTERS
   ======================================== */
.filters-section {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    background-color: var(--bg-dark);
    color: var(--text-color);
    transition: var(--transition);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 89, 214, 0.15);
}

.filter-actions {
    display: flex;
    gap: 1rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-dark);
    color: var(--text-color);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 89, 214, 0.15);
}

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

.form-errors {
    margin-top: 0.5rem;
}

.error {
    color: var(--danger-color);
    font-size: 0.875rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check-input {
    width: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 3rem 0;
}

.auth-container {
    background: var(--bg-card);
    padding: 3.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    max-width: 520px;
    width: 100%;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
}

.auth-container > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2.5rem;
}

.auth-links {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    padding: 3rem 0 1.5rem;
    margin-top: 6rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--footer-title);
    text-transform: capitalize;
    transition: color 0.3s ease;
}

.footer-section p {
    color: var(--footer-text);
    margin-bottom: 0.5rem;
    line-height: 1.6;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-section:first-child p {
    color: var(--footer-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--footer-text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--footer-border);
    color: var(--footer-text-muted);
    font-size: 0.85rem;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* ========================================
   ALERTS
   ======================================== */
.flash-messages {
    padding: 1rem 0;
}

.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-color: var(--success-color);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
    border-color: var(--info-color);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.close-alert {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-alert:hover {
    opacity: 1;
}

/* ========================================
   ERROR PAGES
   ======================================== */
.error-page {
    text-align: center;
    padding: 6rem 2rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-content {
    max-width: 600px;
}

.error-code {
    font-size: 10rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1;
}

.error-content h2 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.error-content p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.error-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 4rem 0;
}

.pagination-info {
    color: var(--text-light);
    font-weight: 500;
}

/* ========================================
   NO RESULTS
   ======================================== */
.no-results {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.no-results p {
    font-size: 1.35rem;
    margin-bottom: 2.5rem;
    color: var(--text-light);
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta-section {
    text-align: center;
    padding: 5rem 3rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border-radius: var(--border-radius);
    margin: 5rem 0;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(47, 89, 214, 0.08) 0%, transparent 70%);
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.cta-section p {
    color: var(--text-light);
    font-size: 1.15rem;
    position: relative;
    z-index: 1;
}

.cta-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* ========================================
   CONTACT PAGE
   ======================================== */
.contact-page {
    padding: 2rem 0;
}

.contact-page h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-page > p {
    color: var(--text-light);
    font-size: 1.15rem;
    margin-bottom: 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.contact-info h2 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.contact-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.contact-details p,
.contact-details a {
    color: var(--text-light);
    text-decoration: none;
}

.contact-details a:hover {
    color: var(--primary-color);
}

.contact-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-map-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    min-height: 500px;
}

.contact-map-section iframe {
    display: block;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .header-content {
        gap: 1rem;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }
    
    .hero-section {
        min-height: 400px;
        margin: 1rem 0 3rem;
        padding: 3rem 1.5rem;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.05rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .vehicles-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-form {
        grid-template-columns: 1fr;
    }
    
    /* Debug: Boutons filtres en pleine largeur sur mobile */
    .filter-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-container {
        padding: 2.5rem 2rem;
    }
    
    .error-code {
        font-size: 6rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .lightbox {
        display: none !important;
    }

    .photo-zoom-hint {
        display: none;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.main-content {
    min-height: calc(100vh - 300px);
    padding: 2rem 0;
}

.back-link {
    margin-top: 3rem;
}

.breadcrumb {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* ========================================
   LEGAL PAGE
   ======================================== */
.legal-page {
    padding: 3rem 0;
}

.legal-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.legal-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.legal-update {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 3rem;
}

.legal-content {
    color: var(--text-light);
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.legal-section:first-child h2 {
    margin-top: 0;
}

.legal-section p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-section strong {
    color: var(--text-color);
}

.legal-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.legal-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   VEHICLE DETAIL PAGE
   ======================================== */
.vehicle-detail-page {
    padding: 2rem 0;
}

.back-button {
    margin-bottom: 2rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    font-weight: 500;
}

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

.detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    max-width: 100%;
    overflow: hidden;
}

/* Photo principale */
.detail-left {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-width: 100%;
    overflow: hidden;
}

.vehicle-photo-main {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    aspect-ratio: 1/1 !important; /* Photo principale carrée */
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    max-width: 100%;
    min-height: 400px; /* Hauteur minimale pour bien voir la photo */
}

.vehicle-photo-main:hover {
    border-color: var(--primary-color);
}

.vehicle-photo-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-zoom-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.vehicle-photo-main:hover .photo-zoom-hint {
    opacity: 1;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-card) 100%);
}

/* Galerie de photos */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.photo-gallery .vehicle-image {
    width: 100%;
    height: auto !important; /* Override le height: 240px */
    aspect-ratio: 1/1 !important; /* Miniatures carrées */
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.photo-gallery * {
    cursor: pointer !important;
}

/* Skeleton loading pour images */
.vehicle-image-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #2b3240 0%, #343c4d 50%, #2b3240 100%);
    background-size: 200% 100%;
    animation: vehicle-skeleton-shimmer 1.2s ease-in-out infinite;
}

.vehicle-image.vehicle-image-loaded .vehicle-image-skeleton {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-out;
}

@keyframes vehicle-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer !important;
    transition: var(--transition);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
}

.gallery-thumb:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    cursor: pointer !important;
}

.gallery-thumb:active {
    transform: scale(0.98);
    cursor: pointer !important;
}

/* Informations droite */
.detail-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 100%;
    overflow: hidden;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-title-section {
    max-width: 100%;
    overflow: hidden;
}

.detail-title-section h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    color: var(--text-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.detail-price-badge {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.75rem;
    border-radius: var(--border-radius);
    font-size: 1.75rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(47, 89, 214, 0.35);
}

/* Badges */
.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge {
    background: var(--bg-hover);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

/* Info boxes */
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-box {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.info-box:hover {
    border-color: var(--primary-color);
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Section contact */
.detail-contact-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.detail-contact-section h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.detail-contact-section p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.contact-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Sections pleine largeur */
.detail-section {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.detail-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.description-text {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.05rem;
    white-space: pre-line; /* Respecte les retours à la ligne de la BDD */
}

/* Options list */
.options-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border-radius: 8px;
    border: 1px solid transparent;
    color: var(--text-color);
    transition: var(--transition);
}

.option-item:hover {
    border-color: var(--primary-color);
}

.option-check {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Specs grid */
.specs-grid {
    display: grid;
    gap: 0.75rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-hover);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.spec-row:hover {
    border-color: var(--border-color);
}

.spec-label {
    color: var(--text-light);
    font-weight: 500;
}

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .detail-left {
        position: relative;
        top: 0;
    }

    .detail-right {
        width: 100%;
    }

    /* Sur mobile/tablette, on ne propose plus le zoom */
    .photo-zoom-hint {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Debug: Photo principale en mode contain sur mobile pour afficher l'image entière */
    .vehicle-photo-main {
        height: auto;
        min-height: unset;
        aspect-ratio: 4/3;
    }
    
    .vehicle-photo-main img {
        object-fit: contain;
        background: var(--bg-card);
    }
    
    .detail-header {
        flex-direction: column;
    }
    
    .detail-title-section h1 {
        font-size: 1.75rem;
    }
    
    .detail-price-badge {
        align-self: flex-start;
    }
    
    .detail-info-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-buttons {
        flex-direction: column;
    }
    
    .contact-buttons .btn {
        width: 100%;
    }
    
    .options-list {
        grid-template-columns: 1fr;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Badges : autoriser le wrap et éviter débordement */
    .detail-badges {
        overflow-x: hidden;
    }

    .badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    /* Section contact : texte complet */
    .detail-contact-section p {
        word-wrap: break-word;
    }
}

/* ========================================
   ABOUT PAGE
   ======================================== */
.about-page {
    padding: 3rem 0;
}

.about-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.about-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
}

.about-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.about-content strong {
    color: var(--text-color);
    font-weight: 600;
}
/* Highlight section */
.about-highlight {
    background: var(--bg-dark);
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin-top: 3rem;
}

.about-highlight p {
    margin-bottom: 1rem;
}

.about-highlight p:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .about-container {
        padding: 2rem 1.5rem;
    }
    
    .about-container h1 {
        font-size: 2rem;
    }
}
