/* Path: /sites/F1_MLK/style.css */

/* ==========================================================================
   VARIABLES DE THÈMES (Clair & Sombre)
   ========================================================================== */
:root {
    --bg-primary: #f5f6fa;
    --bg-card: #ffffff;
    --bg-card-header: #ffffff;
    --bg-card-body: #2a2a2a;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #888888;
    --border-color: #e0e0e0;
    --table-border: #f0f0f0;
    --table-zebra: #f9f9f9;
    --table-hover: #f1f1f1;
    --sidebar-bg: #000000;
    --accent-red: #E10600;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --input-bg: #ffffff;
    --input-border: #cccccc;
    --input-text: #111111;
    --duel-bar-bg: #e0e0e0;
    --duel-card-bg: #fdfdfd;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-card: #1e1e1e;
    --bg-card-header: #1e1e1e;
    --bg-card-body: #181818;
    --text-primary: #f0f0f0;
    --text-secondary: #aaaaaa;
    --text-muted: #777777;
    --border-color: #333333;
    --table-border: #2a2a2a;
    --table-zebra: #242424;
    --table-hover: #2e2e2e;
    --sidebar-bg: #0a0a0a;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --input-bg: #2a2a2a;
    --input-border: #444444;
    --input-text: #ffffff;
    --duel-bar-bg: #333333;
    --duel-card-bg: #242424;
}

/* ==========================================================================
   RÉINITIALISATION & STYLES GLOBAUX
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   BARRE DE NAVIGATION LATÉRALE
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    padding: 30px 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.logo-container {
    margin-bottom: 40px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.red-accent {
    color: var(--accent-red);
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 15px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    display: block;
    padding: 12px 15px;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.nav-links a.active,
.nav-links a:hover {
    background-color: var(--accent-red);
    color: #ffffff;
}

/* Commutateur de Thème Sombre/Clair */
.theme-switch-container {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #333333;
}

.theme-toggle-btn {
    width: 100%;
    background-color: #1f1f1f;
    color: #ffffff;
    border: 1px solid #3d3d3d;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: #2c2c2c;
    border-color: #555555;
}

/* ==========================================================================
   ZONE DE CONTENU PRINCIPAL
   ========================================================================== */
.main-content {
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
}

/* ==========================================================================
   SÉLECTEUR DE GRAND PRIX (Page Résultats)
   ========================================================================== */
.race-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-card);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.race-selector-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.race-select {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--input-text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.race-select:focus {
    border-color: var(--accent-red);
}

/* ==========================================================================
   BARRE DE FILTRES DU CALENDRIER & SWITCH HORAIRE
   ========================================================================== */
.calendar-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.calendar-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.filter-btn.active {
    background-color: var(--accent-red);
    color: #ffffff;
    border-color: var(--accent-red);
}

.filter-count {
    font-size: 11px;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 2px 6px;
    border-radius: 10px;
}

.filter-btn.active .filter-count {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Commutateur de fuseau horaire (Pill switch) */
.timezone-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3d3d3d;
}

.timezone-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #aaaaaa;
}

.timezone-pills {
    display: inline-flex;
    background-color: #222222;
    border: 1px solid #444444;
    border-radius: 20px;
    padding: 2px;
}

.tz-btn {
    background: transparent;
    border: none;
    color: #aaaaaa;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tz-btn:hover {
    color: #ffffff;
}

.tz-btn.active {
    background-color: var(--accent-red);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(225, 6, 0, 0.4);
}

/* ==========================================================================
   BOUTONS PILULES STATISTIQUES (Pilotes vs Constructeurs)
   ========================================================================== */
.stats-toggle-wrapper {
    display: flex;
    align-items: center;
}

.stats-toggle-pills {
    display: inline-flex;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 3px;
    box-shadow: var(--card-shadow);
}

.stats-pill-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-pill-btn:hover {
    color: var(--accent-red);
}

.stats-pill-btn.active {
    background-color: var(--accent-red);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(225, 6, 0, 0.35);
}

/* ==========================================================================
   GRILLES DE MISE EN PAGE
   ========================================================================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    align-items: start;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1600px;
    margin: 15px auto 0;
    width: 100%;
    align-items: start;
}

.results-grid.has-sprint {
    grid-template-columns: repeat(3, 1fr);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    align-items: start;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1000px;
    margin: 30px auto 0;
    width: 100%;
    align-items: start;
}

/* ==========================================================================
   SECTION STATISTIQUES & GRAPHIQUE CHART.JS
   ========================================================================== */
.stats-section {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

.chart-card {
    padding: 25px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 440px;
    margin-top: 15px;
}

.chart-skeleton-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skeleton-chart {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.stats-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

/* ==========================================================================
   GRILLE ET CARTES DE DUELS DE COÉQUIPIERS (Head-to-Head)
   ========================================================================== */
.duels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    width: 100%;
}

.duel-card {
    background-color: var(--duel-card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.duel-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.duel-header {
    padding-left: 10px;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.duel-team-name {
    display: block;
}

.duel-drivers-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.duel-driver-col {
    display: flex;
    flex-direction: column;
    max-width: 42%;
}

.duel-driver-col.left-driver {
    align-items: flex-start;
    text-align: left;
}

.duel-driver-col.right-driver {
    align-items: flex-end;
    text-align: right;
}

.duel-driver-name {
    font-size: 14px;
    color: var(--text-primary);
}

.duel-driver-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.duel-vs-badge {
    font-size: 11px;
    font-weight: 900;
    background-color: var(--accent-red);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.duel-stats-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.duel-metric-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.duel-metric-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.duel-metric-score {
    font-weight: 800;
    font-size: 13px;
    color: var(--text-primary);
}

.duel-bar-wrapper {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background-color: var(--duel-bar-bg);
}

.duel-bar-segment {
    height: 100%;
    transition: width 0.4s ease;
}

.duel-bar-segment.left {
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.duel-bar-segment.right {
    background-color: #888888;
}

[data-theme="dark"] .duel-bar-segment.right {
    background-color: #555555;
}

/* Tableau récapitulatif duels */
.duel-summary-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.duel-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.duel-summary-title {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.duel-summary-val {
    font-weight: 700;
    color: var(--text-primary);
    width: 60px;
}

.duel-summary-val.left {
    text-align: left;
}

.duel-summary-val.right {
    text-align: right;
}

.skeleton-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================================================
   CARTES DE GRAND PRIX (Accueil & Calendrier)
   ========================================================================== */
.card-gp {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Filtrage déclaratif haute performance du calendrier via attribut de conteneur */
#calendar-container[data-filter="upcoming"] .card-gp:not([data-categories~="upcoming"]),
#calendar-container[data-filter="sprint"] .card-gp:not([data-categories~="sprint"]) {
    display: none;
}

.card-gp:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.next-gp-glow {
    border: 2px solid var(--accent-red) !important;
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 10px rgba(225, 6, 0, 0.25);
    }

    100% {
        box-shadow: 0 0 25px rgba(225, 6, 0, 0.7);
    }
}

.gp-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background-color: var(--bg-card-header);
    border-bottom: 1px solid var(--border-color);
}

.gp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flag-img {
    width: 36px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: block;
    object-fit: cover;
}

.gp-header h2 {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1.2;
}

.gp-body {
    background-color: var(--bg-card-body);
    color: #ffffff;
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gp-details {
    margin-bottom: 20px;
    color: #cccccc;
    font-size: 14px;
}

/* Compte à rebours */
.countdown-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.countdown-item {
    background-color: #3b3b3b;
    border-bottom: 3px solid var(--accent-red);
    padding: 10px 4px;
    border-radius: 4px;
}

.countdown-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}

.countdown-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #aaaaaa;
    margin-top: 4px;
    font-weight: 600;
}

/* Gamme de gommes Pirelli visuelle */
.tyre-range-container {
    margin-bottom: 15px;
    background-color: #333333;
    padding: 15px;
    border-left: 3px solid var(--accent-red);
    border-radius: 0 6px 6px 0;
}

.section-subtitle {
    font-size: 12px;
    text-transform: uppercase;
    color: #aaaaaa;
    margin-bottom: 8px;
    font-weight: 700;
}

.tyre-visual-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tyre-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    background-color: #222222;
}

.tyre-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.tyre-hard .tyre-dot {
    background-color: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.tyre-hard {
    color: #ffffff;
    border: 1px solid #666666;
}

.tyre-medium .tyre-dot {
    background-color: #ffd700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.8);
}

.tyre-medium {
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.tyre-soft .tyre-dot {
    background-color: #ff3b30;
    box-shadow: 0 0 6px rgba(255, 59, 48, 0.8);
}

.tyre-soft {
    color: #ff6b6b;
    border: 1px solid rgba(255, 59, 48, 0.4);
}

.tyre-status-text {
    font-size: 13px;
    color: #dddddd;
    font-weight: 600;
}

/* ==========================================================================
   WIDGET MÉTÉO CIRCUIT EN DIRECT
   ========================================================================== */
.weather-container {
    margin-bottom: 20px;
    background-color: #333333;
    padding: 15px;
    border-left: 3px solid #29b6f6;
    border-radius: 0 6px 6px 0;
}

.weather-widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #222222;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #3d3d3d;
}

.weather-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-icon {
    font-size: 20px;
    line-height: 1;
}

.weather-temp {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
}

.weather-desc {
    font-size: 12px;
    color: #cccccc;
    font-weight: 600;
}

.weather-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #aaaaaa;
    padding-top: 6px;
    border-top: 1px solid #333333;
}

.weather-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.weather-fallback {
    font-size: 12px;
    font-style: italic;
    color: #aaaaaa;
}

/* Organisation des séances */
.schedules-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: auto;
}

.session-box {
    background-color: #333333;
    border: 1px solid #444444;
    border-radius: 8px;
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.session-date {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid #444444;
}

.session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.session-title {
    font-weight: 600;
    color: #dddddd;
    display: inline-flex;
    align-items: center;
}

.session-time {
    font-weight: 700;
    color: #ffffff;
}

/* Séance En Direct (Live) */
.live-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: var(--accent-red);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 6px;
    animation: live-pulse 1.4s infinite alternate;
    text-transform: uppercase;
}

@keyframes live-pulse {
    0% {
        opacity: 0.75;
        transform: scale(0.96);
    }

    100% {
        opacity: 1;
        transform: scale(1.04);
        box-shadow: 0 0 8px rgba(225, 6, 0, 0.7);
    }
}

.session-row-live {
    background-color: rgba(225, 6, 0, 0.15);
    border-radius: 4px;
    padding: 4px 6px;
}

.session-box-live {
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.35);
}

/* ==========================================================================
   SECTION PODIUMS DÉPLIABLE (Calendrier)
   ========================================================================== */
.podium-toggle-btn {
    width: 100%;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #3b3b3b;
    color: #ffffff;
    border: 1px solid #555555;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.podium-toggle-btn:hover {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
}

.podium-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #444444;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.podium-container.hidden {
    display: none;
}

.podium-block {
    background-color: #242424;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #383838;
}

.podium-title {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.podium-title-qualif {
    color: #64b5f6;
}

.podium-title-sprint {
    color: #ffb74d;
}

.podium-title-race {
    color: #81c784;
}

.podium-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.podium-table th,
.podium-table td {
    padding: 5px 8px;
    text-align: left;
    border-bottom: 1px solid #333333;
}

.podium-table th {
    color: #888888;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
}

.podium-table td {
    color: #e0e0e0;
}

.podium-pending-msg {
    text-align: center;
    font-size: 13px;
    font-style: italic;
    color: #aaaaaa;
    padding: 10px 0;
}

/* ==========================================================================
   CARTES STANDARDS (Classements & Résultats)
   ========================================================================== */
.card-standings {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.card-standings h2 {
    font-size: 18px;
    margin-bottom: 20px;
    text-transform: uppercase;
    border-left: 4px solid var(--accent-red);
    padding-left: 12px;
    color: var(--text-primary);
}

.table-responsive {
    overflow-x: auto;
}

/* Tableaux */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.standings-table th,
.standings-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--table-border);
}

.standings-table th {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
}

.center-align {
    text-align: center !important;
}

.fw-bold {
    font-weight: 700;
}

.standings-table tbody tr:nth-child(even) {
    background-color: var(--table-zebra);
}

.standings-table tbody tr:hover {
    background-color: var(--table-hover);
}

/* ==========================================================================
   INDICATEURS VISUELS D'ÉCURIE (Team Colors)
   ========================================================================== */
.team-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.team-color-indicator {
    display: inline-block;
    width: 4px;
    height: 15px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.25);
}

.team-name {
    white-space: nowrap;
}

/* Badges Évolutions Classement */
.evo-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 3px 7px;
    border-radius: 4px;
    text-align: center;
    min-width: 38px;
}

.evo-up {
    color: #1b5e20;
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
}

[data-theme="dark"] .evo-up {
    color: #81c784;
    background-color: rgba(46, 125, 50, 0.2);
    border-color: rgba(46, 125, 50, 0.4);
}

.evo-down {
    color: #b71c1c;
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
}

[data-theme="dark"] .evo-down {
    color: #ef9a9a;
    background-color: rgba(198, 40, 40, 0.2);
    border-color: rgba(198, 40, 40, 0.4);
}

.evo-equal {
    color: #616161;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
}

[data-theme="dark"] .evo-equal {
    color: #9e9e9e;
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.pts-we-gain {
    color: #2e7d32;
    font-weight: 700;
}

[data-theme="dark"] .pts-we-gain {
    color: #66bb6a;
}

.pts-we-zero {
    color: var(--text-muted);
}

/* ==========================================================================
   BADGES MEILLEUR TOUR & STATUTS DE COURSE (DNF / Retards)
   ========================================================================== */
.fastest-lap-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #7b1fa2;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    white-space: nowrap;
}

.status-dnf {
    display: inline-block;
    color: #d32f2f;
    font-weight: 700;
    font-size: 13px;
    background-color: rgba(211, 47, 47, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

[data-theme="dark"] .status-dnf {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.15);
}

.status-lapped {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

/* ==========================================================================
   SQUELETTES DE CHARGEMENT ANIMÉS (Skeleton Loaders)
   ========================================================================== */
.skeleton {
    display: inline-block;
    height: 14px;
    width: 80%;
    background: linear-gradient(90deg, var(--table-border) 25%, var(--table-zebra) 50%, var(--table-border) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
}

.skeleton-text {
    width: 70%;
    margin: 3px 0;
}

.skeleton-row td {
    padding: 12px 14px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   PIED DE PAGE
   ========================================================================== */
.site-footer {
    margin-top: auto;
    padding-top: 40px;
    padding-bottom: 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.site-footer .version-number {
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: 5px;
}

/* ==========================================================================
   INTERFACE RESPONSIVE
   ========================================================================== */
@media (max-width: 1400px) {

    .content-grid,
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-grid {
        grid-template-columns: 1fr !important;
    }

    .duels-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {

    .content-grid,
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        height: 360px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 20px;
    }

    .logo-container {
        margin-bottom: 15px;
        text-align: center;
    }

    .nav-links {
        display: flex;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .nav-links li {
        margin-bottom: 0;
    }

    .theme-switch-container {
        margin-top: 15px;
        padding-top: 15px;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-controls-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .race-selector-wrapper {
        width: 100%;
        justify-content: space-between;
    }

    .countdown-value {
        font-size: 20px;
    }

    .chart-wrapper {
        height: 300px;
    }

    .duels-grid {
        grid-template-columns: 1fr;
    }

    .circuit-modal-body {
        grid-template-columns: 1fr !important;
    }

    .drivers-controls-bar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .drivers-search-container {
        width: 100% !important;
    }
}

/* ==========================================================================
   ACTIONS CARTE GRAND PRIX (CALENDRIER - BOUTONS DUO)
   ========================================================================== */
.gp-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.gp-actions-row .podium-toggle-btn,
.gp-actions-row .circuit-modal-btn {
    flex: 1;
    margin-top: 0;
    padding: 10px 12px;
    background-color: #3b3b3b;
    color: #ffffff;
    border: 1px solid #555555;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.gp-actions-row .circuit-modal-btn:hover {
    background-color: #272727;
    border-color: #777777;
    transform: translateY(-1px);
}

.gp-actions-row .podium-toggle-btn:hover {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    transform: translateY(-1px);
}

/* ==========================================================================
   PAGE PILOTES & ÉCURIES (DRIVERS.HTML)
   ========================================================================== */
.header-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.drivers-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.drivers-filter-pills {
    display: flex;
    gap: 8px;
    background-color: var(--bg-card);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.drivers-search-container {
    width: 320px;
}

#drivers-search-input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--input-text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#drivers-search-input:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.15);
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title-wrap h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.section-badge {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.drivers-section {
    margin-bottom: 40px;
}

.drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Carte Pilote */
.driver-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--team-color, var(--accent-red));
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.driver-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .driver-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.driver-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.driver-rank-badge {
    background-color: var(--team-color, var(--accent-red));
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.driver-number-ghost {
    font-size: 3.5rem;
    font-weight: 900;
    font-style: italic;
    color: var(--text-primary);
    opacity: 0.07;
    line-height: 1;
    position: absolute;
    top: 10px;
    right: 15px;
    pointer-events: none;
}

.driver-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.driver-flag-img {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.driver-name {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 400;
    margin: 0;
}

.driver-code {
    font-size: 11px;
    font-weight: 700;
    background-color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

.driver-team-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
}

.team-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.driver-team-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.driver-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    gap: 4px;
}

.driver-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Grille Constructeurs */
.constructors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.constructor-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.constructor-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .constructor-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.constructor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.constructor-rank-badge {
    background-color: var(--team-color, var(--accent-red));
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
}

.constructor-points-badge {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.constructor-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.team-bar-indicator {
    width: 4px;
    height: 38px;
    border-radius: 2px;
    flex-shrink: 0;
}

.constructor-name-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.constructor-flag-img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.constructor-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.constructor-chassis {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.constructor-tech-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 10px;
    gap: 8px;
    margin-bottom: 16px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tech-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.tech-val {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.constructor-drivers-wrap {
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
}

.drivers-wrap-title {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.constructor-drivers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.constructor-driver-pill {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.constructor-driver-pill.empty {
    color: var(--text-muted);
    font-style: italic;
    font-weight: normal;
}

.no-results-msg {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 15px;
    margin: 20px 0;
}

/* ==========================================================================
   MODALE CIRCUIT VECTORIELLE (CALENDRIER)
   ========================================================================== */
.circuit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.circuit-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.circuit-modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 880px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.circuit-modal-overlay.active .circuit-modal-card {
    transform: scale(1) translateY(0);
}

.circuit-modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.circuit-modal-close-btn:hover {
    background-color: var(--accent-red);
    color: #ffffff;
    border-color: var(--accent-red);
    transform: rotate(90deg);
}

.circuit-modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
    padding-right: 40px;
}

.circuit-modal-flag {
    width: 42px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.circuit-modal-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.circuit-modal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

.circuit-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.circuit-track-column {
    display: flex;
    flex-direction: column;
}

.circuit-svg-wrapper {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
}

.circuit-svg-image {
    width: 100%;
    max-width: 380px;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.circuit-svg-image:hover {
    transform: scale(1.02);
}

[data-theme="dark"] .circuit-svg-image {
    filter: invert(1) hue-rotate(180deg) drop-shadow(0 4px 16px rgba(255, 255, 255, 0.15));
}

.circuit-track-legend {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

.circuit-specs-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.circuit-specs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.spec-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.spec-val {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.circuit-record-card {
    background-color: var(--bg-primary);
    border-left: 4px solid var(--accent-red);
    border-radius: 8px;
    padding: 12px 14px;
}

.record-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.record-badge-title {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.record-time {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-red);
    margin-right: 8px;
}

.record-holder {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.circuit-weather-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.weather-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.weather-temp-badge {
    background-color: var(--accent-red);
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.weather-metrics {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.weather-loading-text,
.weather-nodata {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}