body {
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    color: #333;
    margin: 0;
    padding: 0;
  }

/* ———————————————————————————————————— 
     Variables (issues du thème “gameday”) 
  ———————————————————————————————————— */
  :root {
    --bg-header: #22303f;
    --bg-row:    #19212b;
    --bg-panel:  #1b2530;
    --bg-hover:  #263447;
    --border:    #2c3a4a;
    --accent:    #00d6b4;
    --text-main: #e0e0e0;
    --text-gray: #A0A0A0;
    --loss-red:  #ff5b5b;
  }

  /* ============================
     Boutons de filtres (favoris + calendrier + gomme)
     ============================ */
  .btn-favorites-filter,
  .btn-today-filter,
  .btn-delete-filter {
    background: transparent;
    border: none;               /* plus de contour */
    padding: 0.5rem;            /* un peu plus de padding pour plus d'espace cliquable */
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.6rem;        /* espacement entre les boutons */
  }

  .btn-favorites-filter:focus,
  .btn-today-filter:focus,
  .btn-delete-filter:focus {
    outline: none;              /* pas de contour au focus */
  }

  /* ============================
     Tooltips (comme dans playerstat)
     ============================ */
  [data-tooltip] {
    position: relative;
  }

  [data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #e0e0e0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
  }

  [data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    z-index: 1001;
  }

  /* Icône cœur */
  .btn-favorites-filter .heart-icon {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    background-color: var(--text-gray);
    -webkit-mask: url("/static/images/icones/star_empty.210a9a7179b2.svg") no-repeat center / contain;
            mask: url("/static/images/icones/star_empty.210a9a7179b2.svg") no-repeat center / contain;
    transition: background-color 0.2s;
  }

  .btn-favorites-filter:hover .heart-icon,
  .btn-favorites-filter.active .heart-icon {
    background-color: var(--accent);
  }

  .btn-favorites-filter.active {
    background-color: rgba(0, 214, 180, 0.1);
    border-radius: 4px;
  }

  /* Icône calendrier */
  .btn-today-filter .calendar-icon {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    background-color: var(--text-gray);
    -webkit-mask: url("/static/images/icones/calendar.b58c7b1ccd60.svg") no-repeat center / contain;
            mask: url("/static/images/icones/calendar.b58c7b1ccd60.svg") no-repeat center / contain;
    transition: background-color 0.2s;
  }

  .btn-today-filter:hover .calendar-icon,
  .btn-today-filter.active .calendar-icon {
    background-color: var(--accent);
  }

  .btn-today-filter.active {
    background-color: rgba(0, 214, 180, 0.1);
    border-radius: 4px;
  }

  /* Icône gomme */
  .btn-delete-filter .delete-icon {
    color: var(--accent);
    font-size: 1rem;            /* un peu plus petit */
    transition: color 0.2s;
  }
  .btn-delete-filter:hover .delete-icon {
    color: white;               /* l'icône devient blanche au survol */
  }

  /* ─────────────────────────────────────────── 
     Wrapper scrollable pour le tableau 
  ─────────────────────────────────────────── */
  .gameday-table-wrapper {
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border);
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overflow-x: auto;
    margin-top: 0.75rem;        /* Espacement avec les boutons du haut */
  }
  .gameday-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  .gameday-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
  .gameday-table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-panel);
  }

  /* ─────────────────────────────────────────── 
     Style général du tableau 
  ─────────────────────────────────────────── */
  .gameday-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    background: transparent;
    color: var(--text-gray);
    font-size: 0.9rem;
  }

  /* 1) PREMIÈRE LIGNE D’EN-TÊTE (sticky) */
  .gameday-table thead tr.header-row th {
    position: sticky;
    top: 0;
    z-index: 3; 
    background: var(--bg-header);
    color: var(--accent);
    font-weight: 400;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.9rem;
  }

  /* 2) DEUXIÈME LIGNE (Filtres), sticky sous la première */
  .gameday-table thead tr.filter-row th {
    position: sticky;
    top: 2.5rem; /* Hauteur approximative de la première ligne */
    z-index: 4;  
    background: var(--bg-header);
    padding: 0.25rem 0.5rem;
  }

  /* 3) Style des champs de filtre (select, input text, input number) */
  .filter-input {
    width: 100%;
    background-color: var(--bg-row);
    color: var(--text-main);
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    box-sizing: border-box;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
  }
  .filter-input::-webkit-outer-spin-button,
  .filter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .filter-input::placeholder {
    color: var(--text-gray);
    opacity: 1;
  }
  .filter-input:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 2px rgba(0, 214, 180, 0.3);
  }

  /* 4) Espacement vertical pour Min / Max (range-wrapper) */
  .range-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    justify-content: center;
  }
  .range-input {
    width: 100%;
  }

  /* 5) Zebra striping + Hover */
  .gameday-table tbody tr:nth-child(odd) {
    background: var(--bg-row);
  }
  .gameday-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
  }
  .gameday-table tbody tr:hover {
    background-color: var(--bg-hover);
    cursor: pointer;
  }
  .gameday-table th,
  .gameday-table td {
    padding: 0.4rem 0.5rem;  
    text-align: center;
    vertical-align: middle;
    color: var(--text-gray);
  }

  /* Align player names to the left */
  .gameday-table tbody td:nth-child(3) {
    text-align: left !important;
  }

  /* 6) Masquer toute colonne marquée “visibility:hidden” */
  .gameday-table thead th[style*="visibility: hidden"],
  .gameday-table td[style*="visibility: hidden"] {
    padding: 0;
    border: none;
    width: 0;
    overflow: hidden;
  }

  /* 7) Première colonne (photo) - Réduites pour compacité */
  .gameday-table tbody td:first-child {
    /* colonne POSTE désormais */
    width: 32px;  
    height: 32px;
    padding: 0.3rem;  
  }
  .gameday-table tbody td:nth-child(2) {
    /* colonne PHOTO */
    width: 50px;  
    height: 50px;
    padding: 0.3rem;  
  }
  .gameday-table tbody td:nth-child(2) .player-photo {
    width: 38px;  
    height: 38px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
  .player-photo {
    height: 100%;
    object-fit: contain;
    border-radius: 0 !important; /* Suppression de l'arrondi des photos */
  }
  .no-photo {
    display: inline-block;
    width: 100%;
    height: 100%;
    line-height: 60px;
    text-align: center;
    color: #777;
  }

  /* 8) Responsive (< 768px) – ajustements */
  @media screen and (max-width: 768px) {
    .gameday-table thead th,
    .gameday-table td {
      padding: 0.3rem 0.4rem;
      font-size: 0.7rem;
    }
    .gameday-table tbody td:first-child {
      width: 48px;
      height: 48px;
      padding: 0.3rem;
    }
   
    /* Rendre les filtres plus compacts */
    .filter-input {
      font-size: 0.7rem;
      padding: 1px 3px;
    }
    .range-input {
      width: 100%;
    }
  }

  /* 9) Grands écrans (> 1024px) : plus de scroll horizontal */
  @media screen and (min-width: 1024px) {
    .gameday-table-wrapper {
      overflow-x: visible !important;
    }
    .gameday-table {
      table-layout: auto;
    }
    .gameday-table td,
    .gameday-table th {
      white-space: normal;
    }
    .container,
    .content-wrapper {
      max-width: 100%;
      padding-left: 2rem;
      padding-right: 2rem;
    }
    #stats-table {
      width: 100%;
    }
  }

  /* 10) Dropdown “All teams” : texte aligné à gauche */
  .gameday-table thead tr.filter-row th select.filter-input {
    text-align: left;
    padding-left: 0.6rem;
    position: relative;
    z-index: 5; /* Au-dessus du <tbody> */
  }
  .gameday-table thead tr.filter-row th select.filter-input option {
    text-align: left;
  }
  .gameday-table thead tr.filter-row th select.filter-input::-webkit-scrollbar {
    width: 8px;
    background: transparent;
    height: 8px;
  }
  .gameday-table thead tr.filter-row th select.filter-input::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
  }
  .gameday-table thead tr.filter-row th select.filter-input::-webkit-scrollbar-track {
    background-color: var(--bg-panel);
  }
  @-moz-document url-prefix() {
    .gameday-table thead tr.filter-row th select.filter-input {
      scrollbar-width: thin;
      scrollbar-color: var(--border) var(--bg-panel);
    }
  }

@media screen and (max-width: 768px) {
  /* 1) Enlève le padding du wrapper global */
  .content-wrapper,
  .content-wrapper .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 2) Si tu utilises .container de Bootstrap, neutralise aussi ses paddings */
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  /* 3) Étends la zone scrollable du tableau sur toute la largeur */
  .gameday-table-wrapper {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0; /* si tu veux aussi écraser les coins arrondis */
  }
}

@media screen and (max-width: 767px) {
  /* 1) On enlève tout padding/gutter sur le container principal */
  .player-stats-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 2) On force le wrapper du tableau à prendre toute la largeur */
  .players-table-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0;   /* si tu veux aussi virer les coins arrondis */
  }

  /* 3) Si tu as un .content-wrapper ou .container global, idem */
  .content-wrapper,
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ————————————————————————————————————————————————————————————————————
   Sur mobile, on enlève tous les paddings/margins latéraux pour coller à 100% de la largeur
   ———————————————————————————————————————————————————————————————————— */
@media screen and (max-width: 767px) {
  /* 1) Le container global (row / container Bootstrap) */
  .row,
  .container,
  .col-12,
  .col-md-6.container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 2) La carte équipe */
  .team-card {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 3) Le graphique */
  #team-graph {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 4) Les tableaux Est / Ouest */
  .players-table-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important; /* optionnel : coins carrés */
  }
}
/* icône gomme via mask avec taille en rem */
.btn-delete-filter .delete-icon {
  display: inline-block;
  width: 1.2rem;              /* ~24px → 1.5rem */
  height: 1.2rem;             /* même hauteur */
  background-color: var(--text-gray);
  -webkit-mask: url("/static/images/icones/eraser.0c3bdea74383.svg") no-repeat center / contain;
          mask: url("/static/images/icones/eraser.0c3bdea74383.svg") no-repeat center / contain;
  transition: background-color 0.2s;
}

.btn-delete-filter:hover .delete-icon,
.btn-delete-filter:focus-within .delete-icon {
  background-color: #00d6b4;
}

/* Marges fines sur mobile (comme Betsmaker) */
@media (max-width: 480px) {
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Padding interne pour les filtres et résultats */
  .filter-container,
  .results-container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 12px !important;
  }
  
  .card {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 12px !important;
  }
}

/* ========================================================================
   SCROLL HORIZONTAL MOBILE POUR LA BARRE DE FILTRES
   ======================================================================== */

/* Barre de filtres avec z-index élevé */
.filters-bar {
  position: relative;
  z-index: 50;  /* Au-dessus du tableau */
}

@media (max-width: 768px) {
  /* Permettre au dropdown de sortir du container */
  .content-wrapper,
  .container {
    overflow: visible !important;
  }
  
  .filters-bar {
    overflow-x: auto !important;        /* Scroll horizontal */
    overflow-y: visible !important;     /* VISIBLE pour permettre au dropdown de sortir */
    -webkit-overflow-scrolling: touch;  /* Scroll fluide sur iOS */
    flex-wrap: nowrap !important;       /* Pas de retour à la ligne */
    padding-bottom: 8px;                /* Juste pour la scrollbar */
    gap: 0.8rem !important;
    z-index: 50;  /* Au-dessus du tableau */
  }
  
  /* Empêcher les éléments enfants de wrap */
  .filters-bar > div {
    flex-shrink: 0;  /* Ne pas rétrécir */
    flex-wrap: nowrap !important;
  }
  
  /* Masquer la scrollbar pour un rendu propre */
  .filters-bar::-webkit-scrollbar {
    height: 4px;
  }
  
  .filters-bar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
  
  .filters-bar::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* ========================================================================
   DROPDOWN PERSONNALISÉ POUR TEAM FILTER (style gameday)
   ======================================================================== */

/* Sur desktop : afficher le dropdown, cacher le select natif */
.team-filter-mobile {
  display: none !important;
}

.dropdown {
  position: relative;
  display: inline-block;
  z-index: 9999;  /* Z-index très élevé pour passer devant tout */
}

/* Sur mobile : cacher le dropdown, afficher le select natif */
@media (max-width: 768px) {
  .team-filter-mobile {
    display: inline-block !important;
  }
  
  .team-dropdown {
    display: none !important;
  }
}

.dropdown__toggle {
  background: var(--bg-row);
  color: var(--text-gray);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5em 1em;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  min-width: 140px;
  transition: all 0.2s;
}

.dropdown__toggle:hover,
.dropdown__toggle:focus {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  outline: none;
}

.dropdown__arrow {
  margin-left: 0.5em;
  transition: transform 0.2s;
}

.dropdown.open .dropdown__arrow {
  transform: rotate(180deg);
}

.dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 4px;
  list-style: none;
  padding: 4px 0;
  width: 100%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 99999;  /* Z-index maximal pour passer devant absolument tout */
  max-height: 300px;
  overflow-y: auto;
}

/* Backdrop pour mobile */
.dropdown-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

/* Sur mobile, utiliser position fixed pour sortir du contexte de stacking */
@media (max-width: 768px) {
  .dropdown__menu {
    position: fixed !important;
    /* Le positionnement sera calculé en JavaScript */
  }
}

.dropdown.open .dropdown__menu {
  display: block;
}

.dropdown__menu li {
  padding: 0.5em 1em;
  color: var(--text-gray);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.dropdown__menu li:hover,
.dropdown__menu li.selected {
  background: var(--accent);
  color: #fff;
}

/* ========================================================================
   STYLES POUR JOUEURS CLIQUABLES - Navigation vers PlayerStats
   ======================================================================== */

/* Effet hover pour les lignes de joueurs cliquables */
.clickable-player-row {
  transition: background-color 0.2s ease;
}

.clickable-player-row:hover {
  background-color: rgba(0, 214, 180, 0.15) !important;
  cursor: pointer;
}

.clickable-player-row * {
  cursor: pointer !important;
}
