:root {
    --primary: #cb292b;
    --dark: #1a1a1a;
    --light: #f4f4f4;
    --card-bg: #2a2a2a;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--dark);
    color: var(--light);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- BANNIÈRE GARAGE PARTAGÉ --- */
.shared-favorites-bar {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-bottom: 3px solid #0d6b2d;
    padding: 15px var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.shared-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

#sharedGarageLabel {
    font-size: 1.1em;
}

.shared-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.shared-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Bandeau pour le titre avec image de fond */
.header-banner {
    width: 100%;
    background: url('https://raceroom.yoc.ovh/background.jpg') no-repeat center center;
    background-size: cover;
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.header-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
    border-radius: var(--border-radius);
}

.header-banner header {
    position: relative;
    z-index: 2;
    text-align: center;
}

.header-banner h1 {
    margin: 0;
    color: rgb(163, 47, 47);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 3em;
    font-weight: 900;
    margin-bottom: 0.5em;
    background: rgb(163, 47, 47);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-banner .subtitle {
    color: #ddd;
    font-size: 1.3em;
    font-weight: 600;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
    margin-top: var(--spacing-sm);
}

.controls {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 50;
}

.flag-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2em;
    padding: 0;
    line-height: 1;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.flag-button.active,
.flag-button:hover {
    opacity: 1;
}

.view-buttons {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    position: relative;
    padding-right: 160px;
}

.view-buttons button {
    background: none;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: var(--transition);
}

.view-buttons button:hover,
.view-buttons button.active {
    background-color: var(--primary);
    color: white;
}

.share-favorites-btn {
    position: absolute;
    right: var(--spacing-lg);
    top: 50%;
    transform: translateY(-50%);
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    margin-left: 0 !important;
}

.share-favorites-btn:hover {
    background: #218838 !important;
    border-color: #218838 !important;
}

/* --- LAYOUT PRINCIPAL --- */
#mainContent {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    padding: 0 var(--spacing-lg);
}

/* Voiture du Jour */
#carOfTheDayContainer {
    max-width: 900px;
    margin: 0 auto var(--spacing-lg) auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    border: 1px solid #333;
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
}

/* --- FILTRES --- */
.filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    background: #222;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    flex-grow: 0;
    box-shadow: var(--box-shadow);
}

/* Inputs et Selects */
select,
input {
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    border: 1px solid #444;
    background: #333;
    color: white;
    font-size: 14px;
    min-width: 150px;
}

input::placeholder {
    color: #aaa;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- BOUTONS MODE D'AFFICHAGE --- */
.view-mode-group {
    display: flex;
    gap: var(--spacing-sm);
    border-left: 1px solid #444;
    padding-left: var(--spacing-md);
}

.view-mode-btn {
    background: #333;
    border: 1px solid #444;
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.2em;
    transition: var(--transition);
}

.view-mode-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.view-mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- VOITURE DU JOUR --- */
#carOfTheDayContainer h2 {
    color: #fff;
    margin-top: 0;
    border-bottom: 2px solid var(--primary);
    padding-bottom: var(--spacing-sm);
    width: 100%;
}

.cotd-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-sm);
}

.cotd-description {
    max-width: 80%;
    font-style: italic;
    color: #bbb;
    margin-bottom: var(--spacing-md);
    text-align: left;
}

.cotd-specs {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: left;
    flex-wrap: wrap;
}

.cotd-button {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1em;
    text-transform: uppercase;
    font-weight: bold;
    transition: background var(--transition);
}

.cotd-button:hover {
    background-color: #a01e20;
}

/* --- BADGES & SPECS --- */
.modal-badges,
.cotd-badges,
.badges {
    display: flex;
    gap: 10px;
    margin: 15px auto 25px auto;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
    padding: 0 10px;
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Couleurs pour les types de traction */
.RWD {
    background: #3f51b5;
    color: white;
}

.AWD {
    background: #6b2e83;
    color: white;
}

.FWD {
    background: #ff9800;
    color: black;
}

/* Couleurs pour TC et ABS */
.assistance-yes {
    background: #28a745;
    color: white;
}

.assistance-no {
    background: #6c757d;
    color: #f8f9fa;
}

/* Style pour la boîte en H */
.h-pattern-logo {
    font-size: 0.75em;
    font-weight: bold;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 20px;
    background: #28a745;
    color: white;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
}

.h-pattern-logo .h-pattern-text {
    font-weight: 900;
    display: inline-block;
    margin-left: 5px;
    padding: 0 2px;
    border: 1px solid white;
    border-radius: 3px;
}

/* --- GRILLE & CARTE --- */
.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-lg);
}

.car-grid.list-mode {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    gap: var(--spacing-sm);
}

.car-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    border-top: 5px solid var(--primary);
    display: flex;
    flex-direction: column;
    min-height: 420px;
    position: relative;
    cursor: pointer;
}

.car-grid.list-mode .car-card {
    flex-direction: row;
    min-height: auto;
    height: auto;
    border-left: 5px solid var(--primary);
    border-top: none;
    align-items: flex-start;
    padding: 0;
    gap: 0;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.car-grid.list-mode .car-card:hover {
    transform: translateX(5px);
}


.favorite-button {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    padding: 0;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
}

.favorite-button.is-not-favorite {
    color: #ccc;
}

.favorite-button.is-favorite {
    color: var(--primary);
}

.favorite-button:hover {
    color: white;
    background: rgba(0, 0, 0, 0.9);
}

.car-image-container {
    height: 180px;
    overflow: hidden;
    background: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    flex-direction: column;
}

/* Perf badge shown over car image in grid mode */
.perf-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

/* hide perf badge in list mode for clarity */
.car-grid.list-mode .perf-badge { display: none; }

.car-grid.list-mode .car-image-container {
    height: auto;
    width: 150px;
    min-width: 150px;
    max-height: 150px;
    overflow: visible;
    position: relative;
    gap: var(--spacing-sm);
    padding: 0;
}

.car-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.car-grid.list-mode .car-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.car-card:hover .car-image {
    transform: scale(1.05);
}

.car-info {
    padding: var(--spacing-sm);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.car-grid.list-mode .car-info {
    padding: var(--spacing-md);
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-md);
    flex-grow: 1;
}

.car-header {
    margin-bottom: var(--spacing-sm);
}

.car-grid.list-mode .car-header {
    margin-bottom: 0;
    flex-grow: 1;
}

.car-title {
    font-size: 1.1em;
    font-weight: bold;
    color: white;
}

.car-manufacturer {
    font-size: 0.9em;
    color: #aaa;
}

.car-class {
    font-size: 0.85em;
    color: #888;
    margin-top: 2px;
}

.badges {
    display: flex;
    gap: 10px;
    margin: 15px auto 25px auto;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
    padding: 0 10px;
}

.car-grid.list-mode .badges {
    margin: 0;
    justify-content: flex-start;
    padding: 0;
}

.specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.car-grid.list-mode .specs {
    display: none;
}

.specs-columns {
    display: none;
}

.car-grid.list-mode .specs-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: var(--spacing-md);
    margin: 0;
}

/* Table-like list view: each characteristic is a column */
.car-list-wrapper {
    overflow-x: auto;
}

.car-list-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #eee;
}

.car-list-table thead th {
    text-align: left;
    background: #2b2b2b;
    padding: 8px 10px;
    border-bottom: 2px solid #3a3a3a;
    white-space: nowrap;
    color: #ddd;
}

.car-list-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #333;
    vertical-align: middle;
    color: #ddd;
}

.car-list-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.car-list-table .list-image-cell img {
    width: 80px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.car-list-table .list-image-cell img,
.car-image {
    cursor: pointer;
}

.car-list-table .list-image-cell {
    width: 90px;
    /* reserve column width matching image */
}

.car-list-table .list-image-cell {
    position: relative;
}

.car-list-table .list-image-cell .favorite-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 18px;
    color: var(--primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.select-compare-btn {
    font-size: 16px;
    /* make the icon more visible */
    line-height: 1;
    background: transparent;
    border: none;
    cursor: pointer;
}

.car-list-table .favorite-indicator {
    color: var(--primary);
    font-size: 18px;
}

.car-list-table .select-compare-btn {
    padding: 6px 8px;
    font-size: 13px;
}


.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.spec-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    padding: 8px 4px;
}

.spec-label {
    font-size: 0.7em;
    color: #aaa;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
}

.spec-value {
    font-size: 0.9em;
    color: #fff;
    font-weight: bold;
}

.car-grid.list-mode .spec-item {
    padding: 0 var(--spacing-md) 0 0;
    text-align: center;
}

.car-grid.list-mode .spec-item:last-child {
    padding-right: 0;
}

.favorite-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 2em;
    color: var(--primary);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
    z-index: 5;
}

.image-fallback {
    color: #999;
    font-size: 0.9em;
    text-align: center;
    padding: var(--spacing-sm);
}

.car-info {
    padding: var(--spacing-sm);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.car-header {
    margin-bottom: var(--spacing-sm);
}

.car-title {
    font-size: 1.25em;
    font-weight: bold;
    color: #fff;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

.car-manufacturer {
    color: #aaa;
    font-size: 0.9em;
    font-weight: 600;
}

.car-class {
    color: var(--primary);
    font-size: 0.9em;
    font-style: italic;
    margin-top: 2px;
}

.specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    margin-top: auto;
}

.spec-item span {
    display: block;
    font-size: 0.7em;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
}

.spec-item strong {
    font-size: 1em;
    color: #e0e0e0;
}

/* --- Styles des Boîtes de vitesses --- */
.gearbox-badge {
    font-size: 0.75em;
    font-weight: bold;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 20px;
    color: white;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
}

.gearbox-h {
    background: #a7a54d;
}

/* Vert */
.gearbox-seq {
    background: #17a2b8;
}

/* Bleu Cyan */
.gearbox-paddle {
    background: #c03563;
}

/* Gris */

.gearbox-text {
    font-weight: 900;
    display: inline-block;
    margin-left: 5px;
    padding: 0 2px;
    border: 1px solid white;
    border-radius: 3px;
}

/* --- MODALE --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: 5% auto;
    padding: var(--spacing-lg);
    background-color: var(--dark);
    border-radius: calc(var(--border-radius) * 1.5);
    max-width: 800px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
    animation: modalFadeIn 0.3s;
}

/* --- MODALE : BOUTON FAVORI LIVRÉE --- */
.modal-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #ccc;
    font-size: 2em;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    z-index: 20;
    padding-top: 5px;
    /* Ajustement visuel pour centrer le coeur */
}

.modal-fav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-fav-btn.is-active {
    color: var(--primary);
    /* Rouge quand actif */
    content: "♥";
    /* Coeur plein */
}

/* --- GRILLE : INDICATEUR FAVORI --- */
/* On modifie le style existant pour qu'il soit juste un indicateur visuel */
.favorite-indicator {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    color: var(--primary);
    font-size: 1.5em;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    /* Désactive le clic sur la grille */
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-class {
    color: var(--primary);
    font-size: 1.2em;
    margin-top: calc(-1 * var(--spacing-sm));
    margin-bottom: var(--spacing-md);
    text-align: center;
    font-style: italic;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    max-height: 450px;
    object-fit: cover;
    box-shadow: var(--box-shadow);
}

.modal-title {
    color: var(--primary);
    font-size: 2.2em;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.modal-description {
    color: #ddd;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    text-align: justify;
    padding: 0 var(--spacing-sm);
}

.close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    transition: color var(--transition);
}

.close:hover {
    color: white;
    cursor: pointer;
}

/* --- COMPARATEUR --- */
/* Bouton de sélection sur la carte */
.select-compare-btn {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #777;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.8em;
    z-index: 10;
    transition: var(--transition);
}

.car-grid.list-mode .select-compare-btn {
    position: static;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 100%;
    padding: 6px 8px;
    margin: 0;
}

.select-compare-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
}

.car-grid.list-mode .select-compare-btn.selected {
    background: var(--primary);
}

/* Barre flottante */
.compare-bar {
    position: fixed;
    bottom: -100px;
    /* Caché par défaut */
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    border-top: 2px solid var(--primary);
    padding: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 900;
    transition: bottom 0.3s ease-in-out;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.compare-bar.active {
    bottom: 0;
}

.compare-count {
    font-weight: bold;
    font-size: 1.1em;
}

.compare-btn-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
}

.compare-btn-clear {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 10px;
}

.compare-btn-share {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
    font-weight: 600;
    transition: background 0.3s;
}

.compare-btn-share:hover {
    background: #218838;
}

.compare-btn-share:active {
    transform: scale(0.98);
}

/* Tableau Comparatif */
.modal-large {
    max-width: 1100px;
}

.table-responsive {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    color: #ddd;
}

.compare-table th,
.compare-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #444;
}

.compare-table th {
    background: #222;
    text-align: left;
    width: 20%;
    font-weight: normal;
    color: #aaa;
}

.compare-table img {
    width: 100%;
    max-width: 200px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.compare-table .best-value {
    color: #28a745;
    /* Vert pour la meilleure stat */
    font-weight: bold;
}

.compare-header-cell {
    vertical-align: bottom;
}

.compare-remove {
    color: #d9534f;
    cursor: pointer;
    font-size: 0.9em;
    display: block;
    margin-top: 5px;
    text-decoration: underline;
}

/* --- LOAD MORE & SCROLL TOP --- */
.pagination-container {
    text-align: center;
    margin: var(--spacing-md) 0;
    width: 100%;
}

.load-more-btn {
    background-color: transparent;
    border: 2px solid #555;
    color: #ddd;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1em;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

#scrollTopBtn {
    display: none;
    position: fixed;
    width: 40px;
    height: 40px;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 99;
    font-size: 24px;
    border: none;
    outline: none;
    background-color: var(--primary);
    color: white;
    cursor: pointer;
    padding: 1px;
    border-radius: 50%;
    box-shadow: var(--box-shadow);
    transition: transform var(--transition);
}

#scrollTopBtn:hover {
    transform: translateY(-3px);
    background-color: #a01e20;
}

/* --- SLIDER LIVRÉES --- */
.livery-container {
    position: relative;
    width: 100%;
    max-height: 450px;
    margin-bottom: var(--spacing-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    /* Fond noir pour éviter les sauts visuels */
    border-radius: var(--border-radius);
    overflow: hidden;
}

.livery-container .modal-image {
    margin-bottom: 0;
    /* Override de la marge précédente */
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Assure que l'image entière est visible */
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 10;
    user-select: none;
}

.nav-btn:hover {
    background-color: var(--primary);
}

.nav-btn.prev {
    left: 10px;
}

.nav-btn.next {
    right: 10px;
}

.livery-name {
    text-align: center;
    color: #ccc;
    font-style: italic;
    margin-top: -5px;
    margin-bottom: var(--spacing-md);
    font-size: 0.9em;
    min-height: 1.2em;
    /* Évite le saut si vide */
}

.livery-count {
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    pointer-events: none;
}

/* --- LOADER --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #333;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- MODALE DE PARTAGE --- */
.share-link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-link-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #555;
    border-radius: 6px;
    background: #3a3a3a;
    color: #fff;
    font-size: 0.95em;
    font-family: monospace;
    word-break: break-all;
}

.share-link-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(203, 41, 43, 0.3);
}

.share-copy-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    transition: background 0.3s;
}

.share-copy-btn:hover {
    background: #a92327;
}

.share-copy-btn:active {
    transform: scale(0.98);
}

/* FOOTER */
footer {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid #333;
    text-align: center;
    font-size: 0.85em;
    color: #666;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .car-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: center;
    }
}

.youtube-content {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 15px;
}

.youtube-thumbnail {
    width: 200px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.youtube-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.youtube-thumbnail img {
    width: 100%;
    height: 112px;
    object-fit: cover;
    display: block;
}

.youtube-thumbnail p {
    margin: 8px 0 0 0;
    font-size: 14px;
    text-align: center;
    color: #e4e4e4;
    padding: 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
}