/* === Structure globale === */
body {
  margin: 0;
  font-family: "Roboto", "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f7f9fb;
  color: #222;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

/* === Bandeau supérieur === */
.topbar {
  background: #473aa5;
  color: #fff;
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Logo + titre sur la même ligne et centrés */
.header-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
}

.header-inline .logo {
  height: 60px;
  width: auto;
  margin: 0;
  vertical-align: middle;
}

.header-inline h1 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0;
  line-height: 1; /* évite l’effet ballon */
}


/* === Pied de page === */
.footer {
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  border-top: 1px solid #ccc;
  padding: 10px 0;
}

/* === Contenu principal === */
.main-container {
  padding: 15px 0;
}

/* === Titres === */
h1, h2, h3 {
  color: #473aa5;
  font-size: 1.5rem;
  font-family: "ABeeZee", "Roboto", sans-serif;
}

/* === Tableaux === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}

th {
  background: #eaf3f8;
  color: #003955;
  font-weight: 600;
}

tr:hover {
  background: #f4faff;
}

/* === Boutons === */
button, .btn {
  display: inline-block;
  background: #473aa5;
  color: white;
  border: none;
  border-radius: 15px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

button:hover, .btn:hover {
  background: #3a2f87;
  box-shadow: 0 4px 14px rgba(71, 58, 165, 0.45);
  transform: translateY(-2px);
}

/* === Liens === */
a {
  color: #ff9400;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === Messages === */
.success {
  background: #d1e7dd;
  color: #0f5132;
  padding: 8px 10px;
  border-radius: 4px;
  margin-top: 10px;
}

.error {
  background: #f8d7da;
  color: #842029;
  padding: 8px 10px;
  border-radius: 4px;
  margin-top: 10px;
}

/* === Page d'inscription === */
.container.narrow {
  max-width: 600px;
  margin: 20px auto;
  padding: 0 15px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 35px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card h1 {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
}

.intro-mois {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ff9400;
  margin: 0 0 6px 0;
  text-transform: capitalize;
}

.intro-creneaux {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 400;
  color: #777;
  margin-bottom: 30px;
  line-height: 1.5;
}

.form-inscription {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-inscription .row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.field label {
  font-weight: 600;
  color: #473aa5;
  margin-bottom: 6px;
}

.field input {
  padding: 10px 12px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fafafa;
  transition: all 0.2s;
}

.field input:focus {
  border-color: #ff9400;
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 114, 177, 0.3);
  outline: none;
}

.note {
  font-size: 0.95rem;
  color: #555;
  text-align: center;
  line-height: 1.5;
}

.actions {
  text-align: center;
  margin-top: 10px;
}

.actions .btn {
  background: #473aa5;
  color: #fff;
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: 15px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.actions .btn:hover {
  background: #3a2f87;
  box-shadow: 0 4px 14px rgba(71, 58, 165, 0.45);
  transform: translateY(-2px);
}

/* === Responsive === */
@media (max-width: 600px) {
  .header-inline h1 { font-size: 1.3rem; }
  th, td { font-size: 0.85rem; }
}

















/* === Ajustement intelligent des largeurs de colonnes === */
#liste table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* libère la largeur */
}

/* Colonnes équilibrées */
#liste th:nth-child(1), 
#liste td:nth-child(1) {
  width: 40px;          /* ID compact */
  text-align: center;
}

#liste th:nth-child(2), 
#liste td:nth-child(2),
#liste th:nth-child(3), 
#liste td:nth-child(3) {
  width: 20%;           /* Nom / Prénom modérés */
  white-space: nowrap;
}

#liste th:nth-child(4), 
#liste td:nth-child(4) {
  width: auto;          /* Email prend ce qui reste */
  word-break: break-word;
  white-space: normal;
}

#liste th:nth-child(5),
#liste td:nth-child(5) {
  width: 40px;          /* Actions compactes */
  text-align: center;
}

/* Petits écrans : resserre encore */
@media (max-width: 600px) {
  #liste th:nth-child(1), #liste td:nth-child(1) { width: 30px; }
  #liste th:nth-child(2), #liste td:nth-child(2),
  #liste th:nth-child(3), #liste td:nth-child(3) { width: 22%; }
  #liste th:nth-child(5), #liste td:nth-child(5) { width: 60px; }
}








/* === Version finale responsive admin === */
#liste {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#liste table {
  min-width: 550px; /* espace suffisant pour tout voir sans casser les mails */
  table-layout: auto;
}

#liste th, #liste td {
  white-space: nowrap;
  word-break: normal;
}

#liste td:nth-child(4) {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  #liste {
    margin-bottom: 1em;
  }

  #liste table {
    font-size: 0.85rem;
  }

  #liste td:nth-child(1) { width: 35px; text-align: center; }
  #liste td:nth-child(2),
  #liste td:nth-child(3) { width: 22%; }
  #liste td:nth-child(5) { width: 70px; text-align: center; }
}







/* === Compteur d’inscrits sous le titre === */
h3 .compteur {
  color: #ff9400;
  font-weight: 600;
  font-size: 0.95em;
}








/* === Amélioration du survol sur les lignes cliquables === */
.stats tbody tr[data-creneau] {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.stats tbody tr[data-creneau]:hover {
  background: #eaf3f8;          /* léger bleu clair */
  transform: scale(1.01);       /* petit effet visuel discret */
  font-weight: 600;
}

.stats tbody tr[data-creneau]:active {
  transform: scale(0.99);       /* effet clic léger */
}












/* === Indication visuelle du champ date === */

.date-hint {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #0a7b20;
  background: #e9f7eb;
  padding: 6px 10px;
  border-radius: 5px;
  display: inline-block;
  border: 1px solid #bcdcbc;
}














/* === Calendrier compact et bien aligné === */
.field {
  text-align: left;
}

/* Champ date */
#date_seance {
  width: 215px;
  text-align: center;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}

/* Conteneur calendrier */
.calendar {
  display: inline-block;
  margin-top: 8px;
  background: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  vertical-align: middle;
  max-width: 220px;
}

/* En-tête (mois + flèches) */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: #473aa5;
}

.cal-header button {
  background: #473aa5;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 1px 5px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: background 0.2s;
}
.cal-header button:hover {
  background: #0070b6;
}

/* Grille des jours */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 26px);
  gap: 2px;
  text-align: center;
  font-size: 0.75rem;
}

.day-name {
  font-weight: 700;
  color: #473aa5;
  font-size: 0.7rem;
}

/* Jours valides */
.valid {
  background: #d4edda;
  color: #155724;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 0;
  transition: background 0.2s;
}
.valid:hover {
  background: #bde0c2;
}

/* Jours non valides / vides */
.invalid, .disabled, .empty {
  color: #ccc;
  padding: 2px 0;
}

/* Jour sélectionné */
.selected {
  background: #28a745;
  color: #fff;
  font-weight: 600;
}











/* === Statut visuel des séances === */
.stats tr.dispo {
  background: #eaf8ed !important; /* vert clair */
  color: #155724;
}

.stats tr.presque-complet {
  background: #fff6e5 !important; /* orange pâle */
  color: #8a5700;
}

.stats tr.complet {
  background: #fbeaea !important; /* rouge pâle */
  color: #a30000;
  font-weight: 700;
}









.liste-container {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  background: #fafafa;
}

#triZone {
  text-align: left;
}




/* === Patch total affichage boutons de tri/export sur mobile === */
@media (max-width: 700px) {
  #triZone {
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin: 10px 0 !important;
  }

  #triZone > * {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  #triZone button,
  #triZone a {
    font-size: 1rem !important;
    padding: 10px 0 !important;
    border-radius: 6px !important;
  }
}





.alert-erreur {
  background: #f8d7da;
  color: #842029;
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 1px solid #f5c2c7;
}


/* ============================================
   Bandeau : Inscriptions fermées (GymVolVel)
   ============================================ */

.gv-closed-banner {
  background: #fff3cd;
  border: 2px solid #ffb300;
  color: #664d03;
  padding: 15px;
  margin: 15px 0 20px 0;
  border-radius: 6px;
  font-size: 1.05em;
  font-weight: 600;
  text-align: center;
}

.gv-closed-banner strong {
  color: #b00020;
}

/* Bandeau d'avertissement affiché quand une date fictive est active */
/* N'apparaît jamais en production : condition verrouillée par ALLOW_TIME_OVERRIDE */
.gv-banniere-date-fictive {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #b00020;
  color: #ffffff;
  text-align: center;
  font-weight: 700;
  padding: 8px 10px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* Regroupement visuel par semaine dans le formulaire d'inscription
   mensuel (index.php) : chaque semaine forme un bloc distinct, pour
   rester lisible même quand plusieurs semaines s'affichent d'un coup. */
.semaine-bloc {
  background: #ffffff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 0 16px 8px 16px;
  margin-bottom: 14px;
  overflow: hidden;
}

.semaine-entete {
  margin: 0 -16px 10px -16px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #5a6472;
  background: #eef1f4;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e2e5ea;
}

.semaine-bloc .date-seance-titre {
  margin: 10px 0 4px 0;
  font-weight: 600;
  color: #333;
}

.semaine-bloc .date-seance-titre:first-of-type {
  margin-top: 0;
}

/* Les cases à cocher de séances n'ont pas besoin du style gras/bleu
   marine hérité de .field label (pensé pour "Nom"/"Prénom") : seul le
   statut coloré (places restantes / complet / fermé) doit ressortir. */
.semaine-bloc label {
  font-weight: 400;
  color: #333;
}

/* Liste de suggestions affichée pendant la frappe dans le champ de
   recherche de admin/fiche-participant.php (autocomplétion AJAX) */
.suggestions-liste {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: #ffffff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.suggestions-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.suggestions-item:last-child {
  border-bottom: none;
}

.suggestions-item:hover {
  background: #eaf3f8;
}