/* Championnats */

/* Titre de championnat */
.championship-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: red;
}

/* Cartes résumé secondaires */
.summary-card h6 {
  color: #e10600;
  font-size: 1rem;
  margin-bottom: 5px;
}

/* Sections cliquables */
.clickable-championship {
  cursor: pointer;
  transition: transform 0.2s;
}
.clickable-championship:hover {
  transform: scale(1.03);
}

/* Scroll & responsive table */
.table-responsive {
  overflow-x: auto;
  position: relative;
}
.scroll-btns-container {
  margin-left: 10px;
}
.scroll-btns-container button {
  margin-left: 5px;
}

/* Table® avancé */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  border-radius: 8px;
}
th:not(.sticky-col),
td:not(.sticky-col) {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Colonnes collantes */
.sticky-col {
  position: sticky;
  background: #fff;
  z-index: 2;
}
thead .sticky-col {
  z-index: 3;
}
.first-col {
  left: 0;
  width: 60px; min-width: 60px; max-width: 60px;
  background-color: #fff;
  z-index: 1000;
}
.second-col {
  left: 60px;
  width: 180px; min-width: 180px; max-width: 180px;
  background-color: #fff;
  z-index: 1000;
}
.sticky-col.evolution-col {
  left: 240px;
  width: 60px; min-width: 60px; max-width: 60px;
  background-color: #fff;
  z-index: 1000;
}
.third-col {
  left: 300px;
  width: 120px; min-width: 120px; max-width: 120px;
  background-color: #fff;
  z-index: 1000;
}

/* Groupes fixes */
.fixed-group {
  border-right: none;
  border-left: none;
}
.first-fixed {
  border-left: 2px solid #333;
}
.last-fixed {
  border-right: 2px solid #333;
}

/* Badges & stats */
.position-badge {
  display: inline-block;
  width: 30px; height: 30px;
  line-height: 30px; border-radius: 50%;
  color: #fff;
  font-weight: bold;
}
.total-points { }
.breakdown {
  color: #666;
  font-size: 1em;
}

/* Légendes & recherche */
.search-legend-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.search-legend-container .form-control {
  max-width: 300px;
}
.legend {
  display: flex;
  align-items: center;
}
.legend span {
  margin-left: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: .8rem;
  color: #fff;
}

/* Résumé & stats globaux */
.summary-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.summary-left { flex: 0 1 auto; }
.summary-right {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
}

/* Bloc statistiques globales */
#global-stats-block {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: #333;
}
#global-stats-block .block-title {
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 15px;
  color: #e10600;
}
.stat-item { margin-bottom: 10px; }
.stat-title { font-weight: bold; font-size: 1rem; }
.stat-value { font-size: 1rem; }

/* Cartes performance */
.performance-card {
  flex: 1 1 auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 180px;
  width: 300px;
}
.performance-card:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}
.performance-card .card-title {
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 8px;
}

/* Couleurs des cartes perf */
#victories-card {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}
#poles-card {
  background: linear-gradient(135deg, #1E90FF, #00BFFF);
}
#abandons-card {
  background: linear-gradient(135deg, #FF6347, #FF4500);
}

/* Liste perf */
.performance-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
}
.performance-list li { margin: 4px 0; }

/* Adaptation mobile */
@media (max-width: 768px) {
  .summary-container { flex-direction: column; }
  .summary-right {
    flex-direction: row;
    justify-content: center;
  }
}
/* 1) Fond plus prononcé pour les terminés */
.summary-card--finished {
  background-color: #e9ecef;    /* un gris un peu plus foncé */
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05); /* légère ombre intérieure */
  position: relative;           /* garde le positionnement pour le ruban */
}

/* bandeau “FINISH” en haut à gauche */
.summary-card--finished .finish-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  background: #d9534f;     /* rouge “danger” */
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-bottom-right-radius: 0.25rem;
  text-transform: uppercase;
}
/* 1) Agrandir la valeur totale dans chaque cellule */
#champTabContent .table tbody td > div:first-child strong {
  font-size: 1.0rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.3rem; /* un petit écart sous le chiffre */
  color: #666;         /* par exemple rouge vif, adapte ton code hexa */
}

/* 2) Forcer les badges à rester sur la même ligne */
#champTabContent .table tbody td > div:nth-child(2) {
  white-space: nowrap;
}

/* Variante flex si tu préfères un espacement régulier entre badges */
#champTabContent .table tbody td > div:nth-child(2) {
  display: inline-flex;
  gap: 0.1rem;   /* espace entre chaque badge */
}


/* 2) Badges un peu plus transparents */
#champTabContent .table tbody td > div:nth-child(2) .badge {
  opacity: 0.6;           /* 0 = invisible, 1 = opaque */
}

/* Réduit la taille de tous les badges dans le tableau */
#champTabContent .table tbody td .badge {
  font-size: 0.6rem;       /* texte plus petit */
  padding: 0.15rem 0.25rem; /* moins d’espace autour */
  line-height: 1;           /* pour garder la hauteur ajustée */
  border-radius: 0.2rem;    /* coins un peu plus petits */
}

/* remonte en-tête de circuit */
table.table thead th {
  vertical-align: top !important;
  padding-top: 0.25rem !important;
  padding-bottom: 0.5rem;
}

/* supprime la marge interne de la date */
table.table thead th small {
  display: block;
  margin: 0;
  line-height: 1;
}
/* ==========================
   OVERRIDES “Meilleur des 100”
   ========================== */
#tablesContainer.best100-mode {
  position: relative; /* contexte pour nos z-index */
}

/* 1) On vire la colonne Evolution (s’il en reste) */
#tablesContainer.best100-mode .evolution-col {
  display: none !important;
}

/* 2) On recale les 3 sticky-cols (POS / Pilote / Total) */
#tablesContainer.best100-mode .first-col  { left:   0px !important; }
#tablesContainer.best100-mode .second-col { left:  60px !important; }
#tablesContainer.best100-mode .third-col  { left: 240px !important; }

/* 3) On supprime les bordures fixes autour des sticky-cols */
#tablesContainer.best100-mode th.fixed-group,
#tablesContainer.best100-mode td.fixed-group {
  border: none !important;
}

/* 4) Sticky-cols devant tout le reste */
#tablesContainer.best100-mode .sticky-col {
  background: #fff !important;
  z-index:    100 !important;
}

/* 5) Les autres cellules (circuits) restent derrière */
#tablesContainer.best100-mode 
  .table-responsive table th:not(.sticky-col),
#tablesContainer.best100-mode 
  .table-responsive table td:not(.sticky-col) {
  z-index: 1 !important;
}

/* 6) On cache le scroll-bar natif et on force le scroll par flèches */
#tablesContainer.best100-mode .table-responsive {
  overflow-x: hidden; /* scroll géré par JS */
}
#tablesContainer.best100-mode .table-responsive::-webkit-scrollbar {
  display: none;
}

/* 7) Cellule rose pâle pour les circuits non joués */
#tablesContainer.best100-mode td[style*="background-color:#ffeaea"] {
  min-height: 50px;
}
/* ─── Tiny date-badge in “Meilleur des 100” ─── */
#tablesContainer.best100-mode 
  td small.badge.bg-secondary {
  font-size: 0.6rem !important;
  padding:   0.1rem 0.2rem !important;
  line-height: 1 !important;
}


