:root {
    --couleur_ifrn: #1d527d;
    --couleur_cup: #128ac9;
    --couleur_access: #23aa31;
    --couleur_ignite: #f28d0b;
    --couleur_rookie: #d2241b;
    --couleur_cup_transparent: #1289c981;
    --couleur_access_transparent: #23aa3171;
    --couleur_ignite_transparent: #f28e0b7e;
    --couleur_rookie_transparent: #d2241b80;
    --hauteur_menu: 75px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Rajdhani', sans-serif;
    color: #ffffff;
    overflow-x: hidden; 
    overflow-y: auto;
    background-image: none !important;
    background-color: black;
}

header {
    /*border-bottom: var(--couleur_ifrn) 3px solid;*/
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0px;
    z-index: 1000;
    background: linear-gradient(0deg,rgba(0, 0, 0, 0) 0%, var(--couleur_ifrn) 90%);
}

.button-link {
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    align-items: center;
    background:yellow;
    box-shadow: 0px 0px 10px 0px gray;
}

.button-link:hover {
    box-shadow: 0px 0px 10px 0px yellow;
}

.button-link a {
    text-decoration: none;
    color:black;
    font-weight: 600;
}

.button-export {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    align-items: center;
    background:yellow;
}

.bouton1 {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--couleur_ifrn);
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.bouton1 a{
    text-decoration: none;
}


.bouton1.cup {
    background: var(--couleur_cup);
    border: 1px solid white; 
    text-decoration: none;
}

.bouton1.access {
    background: var(--couleur_access);
    border: 1px solid white; 
    text-decoration: none;
}

.bouton1.ignite {
    background: var(--couleur_ignite);
    border: 1px solid white; 
    text-decoration: none;
}

.bouton1.rookie {
    background: var(--couleur_rookie);
    border: 1px solid white; 
    text-decoration: none;
}

.bouton1.ifrn {
    background: var(--couleur_ifrn);
    border: 1px solid white; 
    text-decoration: none;
}

.bouton1.cup:hover {
    box-shadow: 0px 0px 20px 0px var(--couleur_cup);
    color: black;
}

.bouton1.access:hover {
    box-shadow: 0px 0px 20px 0px var(--couleur_access);
    color: black;
}

.bouton1.ignite:hover {
    box-shadow: 0px 0px 20px 0px var(--couleur_ignite);
    color: black;
}

.bouton1.rookie:hover {
    box-shadow: 0px 0px 20px 0px var(--couleur_rookie);
    color: black;
}

.bouton1.ifrn:hover {
    box-shadow: 0px 0px 20px 0px var(--couleur_ifrn);
    color: black;
}

.bouton1.cup a:hover {
    color: black;
}

.bouton1.access a:hover {
    color: black;
}

.bouton1.ignite a:hover {
    color: black;
}

.bouton1.rookie a:hover {
    color: black;
}

.bouton1.ifrn a:hover {
    color: black;
}

.button-export a {
    color:black;
    text-decoration: none;
}

.button-export:hover {
    box-shadow: 0px 0px 10px 0px yellow;
}

header h1 {
    font-size: 1.8em;
    margin: 0;
    text-shadow: none;
}

header nav ul {
    padding: 0;
    list-style: none;
    display: flex;
}

header nav li {
    padding: 0 15px;
}

header nav a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9em;
    padding: 5px 0;
    transition: color 0.3s;
}

header nav a:hover {
    color: #265dff;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Centre verticalement les blocs Gauche, Milieu et Droite */
}

.header-nav-left {
    display: flex;
    flex-direction: row; /* Force l'alignement en ligne et non en colonne */
    align-items: center; 
    justify-content: flex-start; /* Aligne les logos au début (gauche) */
    gap: 15px;
    flex: 1; /* Prend l'espace équivalent à droite pour bien centrer le logo milieu */
    padding: 10px;
}

.header-nav-right {
    display: flex;
    flex-direction: column; /* Garde la colonne pour empiler Menu + Bouton Vidéo */
    align-items: flex-end; 
    justify-content: center;
    gap: 10px;
    flex: 1; /* Prend l'espace équivalent à gauche */
}

.header-nav-right nav li {
    padding: 0; 
}

.header-logo-main {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-nav-right ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap; /* Permet au menu de passer sur 2 lignes si trop large */
    justify-content: flex-end;
    gap: 12px;
}

.header-nav-right ul li a {
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    white-space: nowrap; /* Empêche un mot de se couper en deux */
}

.header-nav-right nav ul {
    display: grid;
    /* Crée 4 colonnes de largeur égale */
    grid-template-columns: repeat(4, 1fr); 
    /* Crée 2 lignes (les boutons s'y répartiront automatiquement) */
    grid-template-rows: repeat(2, auto);
    gap: 3px; /* Espace entre les boutons */
    list-style: none;
    padding: 3px;
    margin: 0;
}

.header-nav-right .button-export {
    width: 100%;
    display: block; /* Pour que le bouton remplisse la cellule */
    box-sizing: border-box;
    white-space: nowrap; /* Empêche le texte de passer à la ligne à l'intérieur du bouton */
    text-align: center;
}

.header-nav-right .bouton1 {
    width: 100%;
    display: block; /* Pour que le bouton remplisse la cellule */
    box-sizing: border-box;
    white-space: nowrap; /* Empêche le texte de passer à la ligne à l'intérieur du bouton */
    text-align: center;
}

.header-nav-right .button-export a {
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.header-logo-main img {
    height: 60px;
    width: auto;
}

.series-link:hover { transform: scale(1.1); filter: drop-shadow(0 0 8px var(--couleur_ifrn)); }

.series-logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 10px var(--couleur_ifrn));
}

.series-logo.cup {
    filter: drop-shadow(0 0 10px var(--couleur_cup));
}

.series-logo.access {
    filter: drop-shadow(0 0 10px var(--couleur_access));
}

.series-logo.ignite {
    filter: drop-shadow(0 0 10px var(--couleur_ignite));
}

.series-logo.rookie {
    filter: drop-shadow(0 0 10px var(--couleur_rookie));
}

.series-logo-100 {
    filter: drop-shadow(0 0 10px var(--couleur_ifrn));
}

.series-logo-100.cup {
    filter: drop-shadow(0 0 10px var(--couleur_cup));
}

.series-logo-100.access {
    filter: drop-shadow(0 0 10px var(--couleur_access));
}

.series-logo-100.ignite {
    filter: drop-shadow(0 0 10px var(--couleur_ignite));
}

.series-logo-100.rookie {
    filter: drop-shadow(0 0 10px var(--couleur_rookie));
}

.header-series-center { display: flex; justify-content: center; gap: 10px; align-items: center; }

nav { justify-self: end; }
nav ul { list-style: none; display: flex; gap: 15px; margin: 0; padding: 0; }
nav ul li a {
    color: #fff; text-decoration: none; font-weight: 600;
    text-transform: uppercase; font-size: 0.85rem; transition: color 0.3s;
}
nav ul li a:hover { color: #1e80c0; }

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



#video-bg-container {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2000;
    background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('../assets/img/daytona_large.png');
    background-size: cover;
    background-position: center;
}

#bg-video {
    position: absolute;
    width: 750px;
    height: 750px;
    object-fit: cover;
    opacity: 0;
    filter: brightness(0.8) contrast(1.2);
    transform: translate(-50%, -50%);
    -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 70%);
    mask-image: radial-gradient(circle, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 70%);
    transition: opacity 0.8s ease-in-out; 
}

.show-video { opacity: 0.5 !important; }

@media (max-width: 1100px) {
    .header-nav-right ul {
        gap: 10px;
        font-size: 0.9rem; /* On réduit un peu la taille pour éviter que ça touche le logo */
    }
}

.container {
    max-width: 1400px;
    /*background: rgba(60, 60, 60, 0.4);*/
    padding: 30px;
    margin: 30px auto;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgb(0 0 0);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

a {
    color: white;
}
/* --- Typographie et Titres --- */
h1 { 
    text-align: center; 
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.4);
    font-size: 2.5em;
    color: #fff;
}
.section-title { 
    font-size: 1.8em; 
    color: #ffffff; 
    margin: 30px 0 15px 0; 
    padding-bottom: 10px; 
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.4);
}
h2 { 
    font-size: 1.5em; 
    color: #ffffff; 
    margin: 10px 0 10px 0;
}

#race-picker{
    border-radius: 4px; 
    font-size: 1em; 
    cursor: pointer;
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
    gap: 15px; 
    margin: 20px 0; 
    max-width: 100%;
}

.stat-card { 
    background: linear-gradient(180deg, var(--couleur_ifrn) 0%, rgba(0, 0, 0, 0.2) 100%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    color: white; 
    padding: 10px 10px; 
    border-radius: 10px; 
    text-align: center; 
    border: 1px solid rgba(255, 255, 255, 1);
}

.stat-card.cup{
    background: linear-gradient(180deg, var(--couleur_cup) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.stat-card.access{
    background: linear-gradient(180deg, var(--couleur_access) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.stat-card.ignite{
    background: linear-gradient(180deg, var(--couleur_ignite) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.stat-card.rookie{
    background: linear-gradient(180deg, var(--couleur_rookie) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.stat-label { 
    font-size: 1em; 
    color: white; 
    text-transform: uppercase;
}

.stat-value { 
    font-size: 2em; 
    font-weight: bold; 
    color: #fff; 
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

/* --- Section Championnats en Cours --- */
.championship-list {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.championship-item {
    padding: 15px;
    margin-bottom: 10px;
    border-left: 5px solid #265dff;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.championship-item strong {
    font-size: 1.1em;
}

.championship-item a {
    color: #265dff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.championship-item a:hover {
    color: #5d8aff;
    text-decoration: underline;
}


/* --- Liens Utiles --- */
#links ul {
    list-style: none;
    padding: 0;
}

#links li a {
    color: #265dff;
    text-decoration: none;
    font-size: 1.1em;
    line-height: 2em;
    transition: color 0.3s;
}
#links li a:hover {
    color: #5d8aff;
}

/* --- Styles pour les autres pages (tables, etc.) réutilisés --- */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 10px 0; 
    /*background: rgb(0, 0, 0, 0.4);*/
    border-radius: 10px; 
    /*overflow: hidden; */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
    color: white;
    /*text-wrap-mode: nowrap;*/
}
thead {
    position: sticky; 
    top: var(--hauteur_menu); 
    z-index: 10; 
}

th { 
    position: sticky;
    color: rgb(255, 255, 255); 
    padding: 10px; 
    text-align: left; 
    font-weight: 600; 
    text-transform: uppercase;
}

thead.cup {
    background: var(--couleur_cup);
}

thead.access {
    background: var(--couleur_access);
}

thead.ignite {
    background: var(--couleur_ignite);
}

thead.rookie {
    background: var(--couleur_rookie);
}

td { 
    padding: 10px 10px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 15px;
}

tbody tr.licence {
    background: #ffd6007a !important;
    color:black !important;
    font-weight: 600 !important;
}

tbody tr:nth-child(even) {
    background: rgb(33 33 33 / 50%);
    color: white;
}

tbody tr:nth-child(odd) {
    background: rgb(80 80 80 / 50%);
    color: rgb(255, 255, 255);
}

tr.promotion {
    background: rgba(0, 150, 0, 0.5) !important;
    font-weight: 600 !important;
}

tr.promotion.chase {
    color: rgb(237 255 0) !important;
}

tr.relegation {
    background: rgba(200, 0, 0, 0.5) !important;
    font-weight: 600 !important;
}

tr.chase {
    background: rgba(0, 100, 200, 0.4); 
}

.row-odd {
    background-color: rgb(80 80 80 / 50%) !important;
}

.row-even {
    background-color: rgb(33 33 33 / 50%) !important;
}

.optionHistorique {
    display: none;
}

.optionParCourse {
    display: none;
}

.optionDetail {
    display: none;
}

.optionDetail.lienStat:hover {
    text-decoration: underline;
}


/* Sélecteur de course (style simple) */
.cumulative-selector {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
}
.cumulative-selector label {
    margin-right: 10px;
    font-weight: bold;
}
.cumulative-selector select {
    padding: 8px;
    border-radius: 5px;
    background: #333;
    color: white;
    border: 1px solid #666;
}

.saison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px;
}

.saison-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: white;
    padding: 15px;
    border-radius: 8px;
    /* Fond dégradé simple */
    background: linear-gradient(145deg, rgba(0, 137, 255, 0.4) 0%, rgba(0, 0, 0, 0.5) 100%);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
}

.saison-card.cup {
    background: linear-gradient(145deg, var(--couleur_cup) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.saison-card.access {
    background: linear-gradient(145deg, var(--couleur_access) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.saison-card.ignite {
    background: linear-gradient(145deg, var(--couleur_ignite) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.saison-card.rookie {
    background: linear-gradient(145deg, var(--couleur_rookie) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.saison-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 137, 255, 0.5);
    background: linear-gradient(145deg, rgba(0, 137, 255, 0.6) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.saison-card.cup:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--couleur_cup);
    background: linear-gradient(145deg, var(--couleur_cup) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.saison-card.access:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--couleur_access);
    background: linear-gradient(145deg, var(--couleur_access) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.saison-card.ignite:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--couleur_ignite);
    background: linear-gradient(145deg, var(--couleur_ignite) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.saison-card.rookie:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--couleur_rookie);
    background: linear-gradient(145deg, var(--couleur_rookie) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.saison-year {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffd700; /* Couleur or pour l'année */
    margin-bottom: 5px;
}

.saison-label {
    font-size: 0.9em;
    text-align: center;
    opacity: 0.8;
}

/* style.css */

/* --- Styles spécifiques aux Statistiques Pilotes/Circuits (Accordion) --- */

.pilot-stats-details {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.pilot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(90deg, rgba(0, 137, 255, 0.5) 0%, rgba(0, 0, 0, 0.5) 100%);
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
}

.pilot-header:hover {
    background: linear-gradient(90deg, rgba(0, 137, 255, 0.7) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.pilot-stats-details[open] .pilot-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.pilot-name-header {
    flex-grow: 1;
}

.pilot-team-header {
    font-size: 0.8em;
    font-weight: normal;
    opacity: 0.8;
    margin-right: 20px;
}

.circuit-stats-content {
    padding: 10px 15px 15px 15px;
    background: rgba(0, 0, 0, 0.5); /* Un fond légèrement plus sombre pour le contenu */
}

.no-data-small {
    padding: 10px 0;
    text-align: center;
    opacity: 0.7;
}

/* --- Styles de la section de Recherche (Autocomplétion) --- */

.search-section {
    margin: 30px auto;
    max-width: 800px;
    display: flex; /* Utiliser flex pour aligner Pilote et Circuit */
    justify-content: space-between;
    gap: 20px;
}

.search-box {
    position: relative; /* TRÈS IMPORTANT pour positionner la liste de résultats */
    flex-grow: 1;
    text-align: left;
}

.search-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.search-box input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #666;
    border-radius: 5px;
    background: #333;
    color: white;
    font-size: 1em;
}

.results-list { 
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    background: rgba(30, 30, 30, 0.95);
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.result-item {
    display: block; 
    padding: 8px 10px; 
    color: white; 
    text-decoration: none; 
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    margin: 0;
    line-height: 1.2;
}

/* 🛑 Effet de Survol */
.result-item:hover {
    background-color: #f0f0f0; /* Fond très clair au survol */
    color: #0056b3; /* Changement de couleur du texte au survol */
}
.results-list .no-result {
    padding: 10px;
    opacity: 0.7;
    text-align: center;
}

/* Style pour la ligne cliquable */
.season-data-row {
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Style de la ligne de détail (initialement masquée) */
.season-detail-row {
    display: none; /* Masque la ligne par défaut, slideToggle va la gérer */
    border-bottom: 3px solid #ccc;
}

.season-detail-row td {
    background-color: #2c2c2c !important;
    padding: 15px 10px;
    background-color: #fafafa;
}

/* Style de l'icône de déroulement (colonne action) */
.toggle-row {
    font-weight: bold;
    text-align: center;
}

/* Style pour mettre en évidence la ligne active */
.season-data-row.active-season {

    border-top: 1px solid #ccc;
    border-bottom: 1px solid #e6e6ff; /* Ligne pour séparer visuellement */
}

/* Style pour la ligne d'en-tête du tableau de résumé par saison */
.season-summary-table thead tr.season-header-row {
    color: #ffffff; /* Texte blanc pour le contraste */
    font-weight: bold;
    text-transform: uppercase;
}

/* Style des cellules d'en-tête */
.season-summary-table thead th {
    padding: 10px 5px;
    text-align: center;
    border: none;
}

/* Ajustement pour la colonne action déroulante */
.season-summary-table th.action-col {
    width: 60px; /* Pour éviter qu'elle ne prenne trop de place */
}

/* Rend les lignes de course cliquables et ajoute un effet visuel */
.race-row-link {
    cursor: pointer;
    transition: background-color 0.2s;
}

.race-row-link:hover td {
    /* Utilisez une couleur légèrement différente de votre fond sombre pour l'effet de survol */
    background-color: #404040 !important; 
}

.season-navigation {
    margin: 20px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    overflow-x: auto; /* Permet de défiler si trop de courses */
}

.race-menu {
    display: flex;
    gap: 10px;
    white-space: nowrap;
}

.race-item {
    display: flex;
    flex-direction: column;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    min-width: 100px;
    text-align: center;
    transition: all 0.2s;
}

.race-item:hover {
    background: #eee;
    border-color: #bbb;
}

.race-item.active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.week-num {
    font-weight: bold;
    font-size: 0.9em;
}

.track-name {
    font-size: 0.75em;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* --- Fin des classes spécifiques --- */

#export-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-family: sans-serif;
}

.loader-content {
    text-align: center;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header-ligne {
    display: flex;
    align-items: center;         /* Aligne verticalement au centre */
    justify-content: space-between; /* Pousse le titre à gauche et les options à droite */
}

.options {
    display: flex;
    gap: 25px; /* Espace entre les deux blocs de switch */
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 10px; /* Espace entre le texte "Option" et le bouton */
    font-size: 1em;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

/* Cache la checkbox par défaut */
.switch input { opacity: 0; width: 0; height: 0; }

/* Le fond du bouton */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

/* Le petit cercle blanc */
.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

/* Quand on coche : fond bleu et déplacement du cercle */
input:checked + .slider { background-color: var(--couleur_ifrn); }
input:checked + .slider:before { transform: translateX(26px); }

/* Conteneur de l'icône et du tooltip */
.pena-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

/* L'icône de pénalité */
.pena-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

/* L'infobulle (Tooltip) */
.pena-tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #222;
    color: #fff;
    text-align: left;
    border: 1px solid #ff4d4d;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 10;
    bottom: 125%; /* Position au dessus de l'icône */
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.4;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.8);
}

/* Flèche du tooltip */
.pena-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #ff4d4d transparent transparent transparent;
}

/* Affichage au survol */
.pena-container:hover .pena-tooltip {
    visibility: visible;
    opacity: 1;
}

.serie-header-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

    .serie-header-flex {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 20px;
        gap: 15px;
    }

    .p-num {
        display: inline-block;
        background: #333;
        color: #fff;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.75rem;
        margin-right: 5px;
        min-width: 25px;
        text-align: center;
    }


    .loners-flex {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .loner-tag {
        background: rgba(255, 255, 255, 0.1);
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 0.9rem;
    }

    .loner-tag small { color: var(--couleur_ifrn); font-weight: bold; }

    /* Style des onglets */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.tab-button {
    background: #1a1a1a;
    color: white;
    border: 1px solid #444;
    padding: 10px 25px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px 5px 0 0;
    transition: 0.3s;
}

.tab-button.active {
    background: #f0f0f0; /* Couleur claire pour l'actif */
    color: #000;
    border-color: #f0f0f0;
}

/* Gestion de l'affichage */
.tab-content {
    display: none; /* Masqué par défaut */
}

.tab-content.active {
    display: block; /* Affiché quand actif */
}

.presentation-ligue {
    line-height: 1.6;
    margin: 40px auto;
    max-width: 1000px;
    padding: 0 20px;
}

.intro p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.titre-progression {
    text-align: center;
    margin: 40px 0 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.progression-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.level-card {
    display: flex;
    flex-direction: column; /* Aligne les éléments verticalement */
    height: 100%;           /* S'assure que toutes les cartes ont la même hauteur */
    padding: 20px;
    border-radius: 8px;
    border: solid 1px;
}

.level-card .cta-text {
    margin-top: auto; /* Pousse tout le bloc en bas */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centre horizontalement le contenu */
    text-align: center;
    min-height: 160px; /* Force une hauteur identique pour tout le bloc diffuseur */
    justify-content: flex-end; /* Aligne le contenu du bloc vers le bas */
}

.level-card .cta-text a {
    display: flex;
    align-items: center; /* Centre le logo verticalement dans son espace dédié */
    justify-content: center;
    height: 80px; /* Hauteur fixe pour l'espace du logo */
    margin: 10px 0;
}

.level-card .cta-text img {
    width: 100px; /* Garde ta largeur */
    height: auto;
    max-height: 100%; /* S'assure qu'il ne dépasse pas les 80px de haut */
    object-fit: contain;
}

.level-card p {
    margin-bottom: 10px;
}

.level-card h3 {
    margin-top: 0;
    text-transform: uppercase;
}

/* Couleurs spécifiques à tes séries */
.level-card.rookie { border-color: var(--couleur_rookie); }
.level-card.ignite { border-color: var(--couleur_ignite); }
.level-card.access { border-color: var(--couleur_access); }
.level-card.cup { border-color: var(--couleur_cup); }

.cta-text {
    text-align: center;
    font-size: 1.2rem;
    margin-top: 30px;
    color: var(--accent-color); /* Utilise ta variable de couleur principale */
}

.partners-section {
    margin: 50px auto;
    max-width: 1100px;
    padding: 0 20px;
}

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px; /* Espace entre les logos */
}

.partner-link {
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(100%); /* Optionnel : logos en gris par défaut */
    opacity: 0.7;
}

.partner-link:hover {
    transform: scale(1.1); /* Zoom léger au survol */
    filter: grayscale(0%); /* Retour des couleurs */
    opacity: 1;
}

.partner-link img {
    max-width: 180px; /* Taille max des logos */
    max-height: 80px;  /* Hauteur max pour garder une harmonie */
    width: auto;
    height: auto;
    object-fit: contain;
}

.best_lap{
    color:rgb(156, 0, 247);
    font-weight: bold;
}

.numero{
    font-style: italic;
    font-weight: bold;
    font-size: 1.4em;
}

/* Container des cartes de séries */
.serie-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.serie-card {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-top: 5px solid #ccc;
}

.serie-card.cup { border-color: #e74c3c; } /* Rouge */
.serie-card.access { border-color: #f1c40f; } /* Jaune */
.serie-card.ignite { border-color: #3498db; } /* Bleu */
.serie-card.rookie { border-color: #2ecc71; } /* Vert */

.serie-header {
    background: #f8f9fa;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.serie-header h3 { margin: 0; font-size: 1.1em; text-transform: uppercase; }

.serie-body { padding: 15px; }
.s-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* Badges de série dans le tableau */
.serie-badge {
    padding: 3px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}
.serie-badge.cup { background: #e74c3c; }
.serie-badge.access { background: #f1c40f; color: #333; }
.serie-badge.ignite { background: #3498db; }
.serie-badge.rookie { background: #2ecc71; }

.serie-section {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.serie-title-banner {
    padding: 15px 20px;
    margin: 0;
    color: white;
    font-size: 1.4em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Couleurs des bannières */
.serie-title-banner.cup { background: #c0392b; }
.serie-title-banner.access { background: #f1c40f; color: #333; }
.serie-title-banner.ignite { background: #2980b9; }
.serie-title-banner.rookie { background: #27ae60; }

.serie-overall-summary {
    font-size: 0.6em;
    font-weight: normal;
    opacity: 0.9;
}

.serie-table {
    width: 100%;
    border-collapse: collapse;
}

.serie-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #eee;
}

.serie-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.btn-detail-small {
    background: #eee;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.serie-section {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.serie-title-banner {
    padding: 15px 20px;
    margin: 0;
    color: white;
    font-size: 1.4em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Couleurs des bannières */
.serie-title-banner.cup { background: #c0392b; }
.serie-title-banner.access { background: #f1c40f; color: #333; }
.serie-title-banner.ignite { background: #2980b9; }
.serie-title-banner.rookie { background: #27ae60; }

.serie-overall-summary {
    font-size: 0.6em;
    font-weight: normal;
    opacity: 0.9;
}

.serie-table {
    width: 100%;
    border-collapse: collapse;
}

.serie-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #eee;
}

.serie-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.btn-detail-small {
    background: #eee;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.clickable-row:hover {
    background-color: var(--couleur_ifrn);
}

.season-data-row:hover {
    background-color: var(--couleur_ifrn);
}

.lienStat:hover {
    text-decoration: underline;
}

#ligne_transparente{
    background-color: transparent;
}

/* 1. La cellule parente (le TD) */
.phase-vertical-cell {
    position: relative;
    vertical-align: middle;
    text-align: center;
    min-width: 45px;
    padding: 0 !important;
    color: white !important;
    background-color: var(--couleur_ifrn) !important; 
    opacity: 1 !important;
    z-index: 10;
    display: table-cell;
}

/* 2. Le conteneur de centrage */
.phase-vertical-cell .flex-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Important pour que le texte soit centré dans le rowspan */
    min-height: 40px; 
    height: 100%;
}

/* 3. Le texte (comportement par défaut : horizontal) */
.phase-vertical-cell .vertical-text {
    position: relative;
    display: inline-block;
    z-index: 11;
    transition: transform 0.2s;
}

/* 4. CAS 1 : Une seule ligne (pas de rotation) */
.phase-vertical-cell.no-rotate .vertical-text {
    transform: none;
    padding: 8px 5px; /* Un peu plus d'espace */
    font-size: 14px;  /* Taille normale identique au reste du tableau */
    font-weight: bold;
    text-transform: uppercase;
    white-space: normal; /* Permet le retour à la ligne si le nom est long */
    max-width: 100px;    /* On laisse plus de largeur */
    line-height: 1.2;
}
/* 5. CAS 2 : Plusieurs lignes (rotation) */
.phase-vertical-cell.is-rotated .vertical-text {
    transform: rotate(-90deg);
    white-space: nowrap;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

/* On cible les en-têtes de DataTables */
table.dataTable thead th {
    position: relative;
    padding-right: 20px !important; /* Espace pour l'icône */
    white-space: nowrap; /* Évite que le titre ne passe sur deux lignes */
}

/* On repositionne l'icône de tri juste après le texte */
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    position: relative !important;
    display: inline-block !important;
    right: auto !important;
    margin-left: 8px !important; /* Distance texte <-> icône */
    vertical-align: middle;
}

/* On cache les icônes de tri par défaut (before/after) pour éviter les doublons selon la version */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before {
    content: "" !important;
}

tr.numero-row:hover {
    background-color: rgba(29, 82, 125, 0.1) !important;
}

.pilote-detail-box {
    font-size: 1em;
    color: #ffffff;
}