/* ============================================================
   VolleyTeam — Theme "Terrain de nuit"
   Bleu marine profond + accents orange/jaune, police Poppins.
   ============================================================ */
:root {
  /* Couleurs */
  --bg:        #0f2136;   /* fond general */
  --surface:   #16304d;   /* barres (haut/bas) */
  --card:      #1c3a5c;   /* cartes */
  --card-2:    #234669;   /* survol / variante */
  --line:      #2c4d72;   /* bordures */
  --text:      #eef4fb;   /* texte principal */
  --muted:     #9fb6d1;   /* texte secondaire */
  --accent:    #ff6b35;   /* orange volley */
  --accent-2:  #ffd23f;   /* jaune */
  --on-accent: #14243a;   /* texte sur orange/jaune */
  --ok:        #37d67a;   /* present */
  --ok-bg:     #143a2a;
  --danger:    #ff5a5a;   /* absent / suppression */
  --danger-bg: #3a1720;

  /* Espacements */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem;
  --space-4: 1rem;   --space-5: 1.5rem; --space-6: 2.25rem;

  /* Rayons & ombres */
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 18px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,.25);
  --shadow-md: 0 8px 22px rgba(0,0,0,.32);

  --tap-min: 44px;
  --bottomnav-h: 66px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
}

a { color: var(--accent); }

/* Lien d'evitement (accessibilite) */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: .5rem .9rem; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--space-4);
  background: linear-gradient(120deg, #12294a, #1c3a5c);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
  border-bottom: 3px solid var(--accent);
  flex-wrap: wrap;
}
.brand {
  font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em;
  color: #fff; text-decoration: none;
}
.topbar nav { display: none; gap: var(--space-1); flex: 1; }
.topbar nav a {
  color: var(--muted); text-decoration: none; padding: .4rem .8rem;
  border-radius: var(--radius-sm); font-size: .95rem; font-weight: 500;
}
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.auth { margin-left: auto; }
.auth a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth .link {
  background: none; border: none; color: var(--accent);
  font: inherit; font-weight: 600; cursor: pointer; padding: .4rem .6rem;
}

.container { max-width: 760px; margin: 0 auto; padding: var(--space-4); }

h1 { font-size: 1.5rem; font-weight: 700; margin: .3rem 0 var(--space-4); letter-spacing: -.01em; }

/* ---------- Accueil : cartes tableau de bord ---------- */
.hero h1 { margin-top: 0; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-5); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-md);
}
.card-num { font-size: 2.1rem; font-weight: 800; color: var(--accent); line-height: 1; }
.card-label { color: var(--muted); margin-top: var(--space-2); font-size: .9rem; }
.card--event { border-color: var(--accent-2); }
.card--event .card-num { color: var(--accent-2); }
.hint { color: var(--muted); margin-top: var(--space-5); }
.hint a { font-weight: 600; }

/* ---------- Barre d'outils (titre + bouton) ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.badge {
  font-size: .72rem; font-weight: 700; padding: .18rem .6rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); vertical-align: middle;
}

/* ---------- Liste des joueuses ---------- */
.list { list-style: none; padding: 0; margin: var(--space-4) 0; display: flex; flex-direction: column; gap: var(--space-3); }
.list li {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); display: flex; align-items: center; gap: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.jersey {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 1.05rem; display: grid; place-items: center;
}
.jersey--none { background: var(--accent-2); }

/* Titres de section (calendrier) */
.section-title {
  font-size: 1rem; font-weight: 700; color: var(--muted);
  margin: var(--space-5) 0 var(--space-2); display: flex; align-items: center; gap: var(--space-2);
}
.badge--muted { background: var(--card-2); color: var(--muted); }
/* Rangee date + heure cote a cote */
.row2 { display: flex; gap: var(--space-3); }
.row2 label { flex: 1; }
/* Evenements passes : legerement estompes */
.list--past li { opacity: .7; }
textarea { resize: vertical; min-height: 72px; }

/* --- Presences --- */
.back { color: var(--muted); text-decoration: none; font-weight: 600; }
.event-head { display: flex; gap: var(--space-4); align-items: flex-start; margin-bottom: var(--space-3); }
.event-head h1 { margin: 0 0 .2rem; }
.event-notes {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--space-3); color: var(--muted); font-size: .9rem;
}
.event-link { text-decoration: none; color: inherit; cursor: pointer; }
.event-link strong { color: var(--text); }

.recap { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.recap-item {
  flex: 1; min-width: 90px; text-align: center; padding: var(--space-3);
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card);
  font-size: .8rem; color: var(--muted);
}
.recap-item strong { display: block; font-size: 1.4rem; color: var(--text); }
.recap-present { border-color: var(--ok); }
.recap-present strong { color: var(--ok); }
.recap-absent { border-color: var(--danger); }
.recap-absent strong { color: var(--danger); }

.att-actions { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.att-actions .btn-secondary { flex: 1; font-size: .85rem; }
.att-list li { flex-wrap: wrap; }

/* Choix segmente present/absent/? */
.att-choice { display: flex; gap: 4px; }
.att-opt { position: relative; cursor: pointer; }
.att-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.att-opt span {
  display: block; padding: .5rem .7rem; min-height: var(--tap-min); min-width: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 600;
}
.att-opt-present input:checked + span { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.att-opt-absent  input:checked + span { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.att-opt-unknown input:checked + span { background: var(--card-2); color: var(--text); border-color: var(--muted); }
.att-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.att-save { margin: var(--space-4) 0; }
.att-save button { width: 100%; }

/* Pastilles de presence (vue lecture) */
.att-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.att-present { background: var(--ok); }
.att-absent { background: var(--danger); }
.att-unknown { background: var(--line); }

.player-info { flex: 1; min-width: 0; }
.player-info strong { font-weight: 600; font-size: 1.05rem; }
.player-meta { color: var(--muted); font-size: .84rem; margin-top: 2px; }

/* Pastilles de statut (colorees selon la situation) */
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.status-pill {
  display: inline-block; margin-top: 4px;
  font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px;
  border: 1px solid transparent;
}
.status-ok     { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok); }
.status-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.status-warn   { background: #3a2f14;          color: var(--accent-2); border-color: var(--accent-2); }
.status-muted  { background: var(--card-2);    color: var(--muted);  border-color: var(--line); }

/* Fieldset genre */
.genderset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3); display: flex; gap: var(--space-4); align-items: center; }
.genderset legend { color: var(--muted); font-size: .8rem; padding: 0 .4rem; }
.radio { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); font-size: .95rem; }
.radio input { min-height: auto; width: auto; }

.row-actions { display: flex; gap: var(--space-1); }
.icon-btn {
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  width: var(--tap-min); height: var(--tap-min); min-width: var(--tap-min);
  display: grid; place-items: center; cursor: pointer; font-size: 1.1rem; text-decoration: none;
  color: var(--text);
}
.icon-btn:hover { background: var(--line); }
.icon-btn.danger { color: var(--danger); }

/* ---------- Formulaires ---------- */
.form-page { max-width: 480px; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); max-width: 480px; }
label { display: flex; flex-direction: column; gap: var(--space-1); font-size: .85rem; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; padding: .7rem .8rem; min-height: var(--tap-min);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
input::placeholder { color: #6f88a8; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}

/* ---------- Boutons ---------- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--on-accent); border: none;
  padding: .7rem 1.1rem; min-height: var(--tap-min); border-radius: var(--radius-sm);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
button:hover, .btn:hover { background: #ff8355; }
.btn-secondary, button.btn-secondary {
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--line); }
.actions { display: flex; gap: var(--space-3); }

.error {
  color: var(--danger); background: var(--danger-bg);
  border: 1px solid var(--danger); border-radius: var(--radius-sm);
  padding: .6rem .8rem; font-size: .9rem;
}

/* ---------- Barre de navigation basse (mobile) ---------- */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0,0,0,.25);
}
.bottombar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: .5rem 0; min-height: var(--bottomnav-h);
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.bottombar a.active { color: var(--accent); }
.bottombar .icon { font-size: 1.35rem; line-height: 1; }

/* ---------- Ecrans plus larges (tablette / PC) ---------- */
@media (min-width: 721px) {
  .topbar nav { display: flex; }
  .bottombar { display: none; }
  body { padding-bottom: 0; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
}

/* ---------- Auto-declaration des presences (Joueuses & Coach) ---------- */
.declare-group { display: inline-flex; gap: 6px; align-items: center; }
.btn-declare {
  font-size: .8rem; padding: 4px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  cursor: pointer; font-weight: 600;
}
.btn-declare:hover { opacity: .9; }
.btn-declare.active-present { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.btn-declare.active-absent  { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.badge-announced {
  font-size: .75rem; padding: 2px 8px; border-radius: 99px; display: inline-block;
  background: var(--card-2); border: 1px solid var(--line); font-weight: 500;
}
.badge-announced.announced-present { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.badge-announced.announced-absent  { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }

/* ---------- Feuille de Match & Rotations Tactiques (Design Moderne & Pro) ---------- */
.match-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-4);
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}

/* Selecteur Championnat Belge : Premiere vs Reserve */
.category-switcher {
  display: flex;
  background: var(--card-2);
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--line);
  margin-bottom: var(--space-4);
  gap: 4px;
}
.category-btn {
  flex: 1;
  text-align: center;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.category-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,112,67,.35);
}

/* Tableau de score automatique en direct */
.live-score-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255,112,67,.12) 0%, rgba(15,33,54,.7) 100%);
  border: 1px solid rgba(255,112,67,.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: var(--space-4);
}
.live-score-title {
  font-size: .85rem;
  color: var(--muted);
  font-weight: 600;
}
.live-score-digits {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1px;
}
.live-score-digits span {
  color: var(--accent);
}

/* Onglets des sets */
.set-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}
.set-tab {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: .82rem;
  transition: all .15s ease;
}
.set-tab:hover { background: var(--line); }
.set-tab.active {
  background: #1e3a5f;
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent);
}
.set-tab-score {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.set-tab.active .set-tab-score { color: #ffab91; }

/* Plateau tactique de Volley-Ball epure (Anti-kitch) */
.court-tactical {
  position: relative;
  background: radial-gradient(circle at 50% 0%, #152b45 0%, #0d1b2a 100%);
  border: 1.5px solid #2d4f7c;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: var(--space-4);
  box-shadow: inset 0 2px 12px rgba(0,0,0,.4);
}

/* Filet moderne ultra-fin */
.net-sleek {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ff7043;
  position: relative;
}
.net-sleek::before, .net-sleek::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ff7043);
}
.net-sleek::after {
  background: linear-gradient(90deg, #ff7043, transparent);
}
.net-sleek span {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ff8a65;
}

/* Ligne d attaque (3 metres) */
.attack-line {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  position: relative;
}
.attack-line::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  border-top: 1px dashed rgba(255,255,255,.18);
}
.attack-line span {
  background: #11243b;
  padding: 0 8px;
  font-size: .62rem;
  color: #7b9eb4;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}

.court-grid-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.court-zone {
  background: rgba(13, 27, 42, 0.7);
  border: 1px solid #264366;
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s ease;
}
.court-zone:hover {
  border-color: #4a77a8;
}

.court-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.court-badge-pos {
  font-size: .7rem;
  font-weight: 800;
  background: rgba(255,112,67,.2);
  color: #ff8a65;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .5px;
}
.court-zone-role {
  font-size: .65rem;
  color: var(--muted);
  text-transform: uppercase;
}

.court-zone select, .libero-box select {
  width: 100%;
  padding: 6px 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

/* Libero stylise */
.libero-box {
  background: rgba(255, 171, 0, 0.08);
  border: 1px solid rgba(255, 171, 0, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: 10px;
}
.libero-badge {
  font-weight: 800;
  font-size: .75rem;
  color: #ffb300;
  background: rgba(255, 171, 0, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Saisie des scores de set */
.set-score-inputs {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: center;
  margin: var(--space-4) 0;
  background: var(--card-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.score-box label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.score-box input {
  width: 80px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 6px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .15s;
}
.score-box input:focus {
  border-color: var(--accent);
  outline: none;
}
.score-separator {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--muted);
  margin-top: 18px;
}

.match-debrief-box {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin-top: var(--space-3);
}

/* ---------- Navigation par Onglets Métiers (Présences vs Match) ---------- */
.main-event-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 5px;
  margin: var(--space-4) 0;
  gap: 6px;
}

.main-tab-btn {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.main-tab-btn:hover {
  background: var(--line);
  color: var(--text);
}

.main-tab-btn.active {
  background: var(--card-2);
  color: var(--accent);
  border-color: rgba(255,112,67,.3);
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

.main-tab-pane {
  animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
