/* ============================================================
   Pronostics CdM 2026 — Style Sheet
   Thème : Football / Stade / Nuit / Or & Vert Émeraude
   Polices : Bebas Neue (titres) + Barlow (corps)
   ============================================================ */

:root {
  --gold:        #F5C518;
  --gold-dark:   #C9971A;
  --emerald:     #00C97B;
  --emerald-dark:#009A5E;
  --night:       #0A0E1A;
  --night-mid:   #111827;
  --night-card:  #161D2F;
  --night-border:#1E2A42;
  --text:        #E8EDF7;
  --text-muted:  #7A8BA8;
  --red:         #E53E3E;
  --blue:        #3B82F6;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Barlow', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--night);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Fond étoilé ──────────────────────────────────────────── */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0,201,123,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(245,197,24,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.04) 0%, transparent 60%);
}
.stars::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 45%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 25%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 60%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 90%, rgba(255,255,255,0.3) 0%, transparent 100%);
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10,14,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--night-border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.navbar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; flex-shrink: 0;
}
.trophy-icon { font-size: 1.4rem; }
.brand-text {
  font-family: var(--font-display);
  font-size: 1.3rem; letter-spacing: 1px;
  color: var(--gold);
}
.navbar-menu {
  display: flex; align-items: center; gap: 0.25rem;
  list-style: none; flex: 1;
}
.navbar-menu a {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
}
.navbar-menu a:hover, .navbar-menu a.active {
  color: var(--text);
  background: var(--night-card);
}
.navbar-menu a.active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.nav-icon { font-size: 1rem; }

/* Dropdown admin */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--night-card);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-sm);
  min-width: 180px; list-style: none;
  box-shadow: var(--shadow);
  z-index: 200;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a {
  display: block; padding: 0.6rem 1rem;
  color: var(--text-muted); font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.15s;
}
.dropdown-menu li a:hover { background: var(--night-border); color: var(--text); }

.navbar-user {
  display: flex; align-items: center; gap: 0.75rem; margin-left: auto;
}
.user-pill {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.8rem 0.3rem 0.3rem;
  background: var(--night-card);
  border: 1px solid var(--night-border);
  border-radius: 999px;
  text-decoration: none; color: var(--text);
  font-size: 0.88rem; font-weight: 600;
  transition: border-color 0.2s;
}
.user-pill:hover { border-color: var(--emerald); }
.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--emerald), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--night);
}
.btn-logout {
  color: var(--text-muted); font-size: 1.1rem;
  text-decoration: none; padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.btn-logout:hover { color: var(--red); }

/* ── Layout principal ─────────────────────────────────────── */
.main-content {
  position: relative; z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Titres de page ───────────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
}
.page-title {
  font-family: var(--font-display);
  font-size: 2.5rem; letter-spacing: 2px;
  color: var(--gold);
  line-height: 1.1;
}
.page-subtitle {
  color: var(--text-muted); font-size: 1rem; margin-top: 0.25rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--night-card);
  border: 1px solid var(--night-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem; letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--night-border);
}
.card-title .accent { color: var(--gold); }

/* ── Grilles ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Stat cards (dashboard) ───────────────────────────────── */
.stat-card {
  background: var(--night-card);
  border: 1px solid var(--night-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem; color: var(--gold); line-height: 1;
}
.stat-sub { font-size: 0.82rem; color: var(--text-muted); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
table.data-table th {
  background: rgba(30,42,66,0.8);
  color: var(--text-muted);
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--night-border);
}
table.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(30,42,66,0.5);
  vertical-align: middle;
}
table.data-table tr:hover td { background: rgba(255,255,255,0.02); }
table.data-table tr:last-child td { border-bottom: none; }

/* ── Classement spécial ───────────────────────────────────── */
.rank-badge {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.rank-1 { background: var(--gold); color: var(--night); }
.rank-2 { background: #C0C0C0; color: var(--night); }
.rank-3 { background: #CD7F32; color: var(--night); }
.rank-other { background: var(--night-border); color: var(--text-muted); }

/* ── Matchs cards ─────────────────────────────────────────── */
.match-card {
  background: var(--night-card);
  border: 1px solid var(--night-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
}
.match-card:hover { border-color: rgba(245,197,24,0.3); transform: translateY(-1px); }
.match-card.locked { opacity: 0.6; }
.match-card.done { border-color: rgba(0,201,123,0.2); }

.match-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.match-phase-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
}
.match-date { font-size: 0.8rem; color: var(--text-muted); }

.match-teams {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.75rem;
}
.team-name {
  font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.5px;
  flex: 1; text-align: center;
}
.match-vs {
  font-family: var(--font-display); font-size: 1rem;
  color: var(--text-muted); flex-shrink: 0;
}
.real-score {
  font-family: var(--font-display); font-size: 1.4rem; color: var(--gold);
  text-align: center; letter-spacing: 2px;
}

.prono-form {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
}
.prono-input {
  width: 52px; height: 52px;
  background: var(--night);
  border: 2px solid var(--night-border);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-display); font-size: 1.5rem;
  text-align: center;
  transition: border-color 0.2s;
}
.prono-input:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(0,201,123,0.15);
}
.prono-sep {
  font-family: var(--font-display); font-size: 1.5rem; color: var(--text-muted);
}

.btn-prono {
  background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
  color: var(--night); font-weight: 700; font-size: 0.82rem;
  border: none; border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem; cursor: pointer;
  font-family: var(--font-body);
  transition: opacity 0.2s, transform 0.1s;
}
.btn-prono:hover { opacity: 0.9; transform: scale(1.03); }

/* Pronostics visibles des autres */
.pronos-all {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--night-border);
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.prono-chip {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem; font-weight: 600;
  background: var(--night);
  border: 1px solid var(--night-border);
}
.prono-chip.pts-4 { border-color: var(--gold); color: var(--gold); }      /* Score exact */
.prono-chip.pts-3 { border-color: var(--emerald); color: var(--emerald); }  /* Bon vainqueur */
.prono-chip.pts-0 { border-color: var(--red); color: var(--red); opacity: 0.7; }

/* ── Phase headers ────────────────────────────────────────── */
.phase-header {
  display: flex; align-items: center; gap: 1rem;
  margin: 2rem 0 1rem;
}
.phase-title {
  font-family: var(--font-display);
  font-size: 1.6rem; letter-spacing: 2px; color: var(--text);
}
.phase-line { flex: 1; height: 1px; background: var(--night-border); }
.group-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
  border-radius: 6px;
  font-family: var(--font-display); font-size: 1rem; color: var(--night);
}

/* ── Boutons généraux ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 700; font-size: 0.88rem;
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
  color: var(--night);
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--night);
}
.btn-gold:hover { opacity: 0.88; }
.btn-danger {
  background: rgba(229,62,62,0.15); color: var(--red);
  border: 1px solid rgba(229,62,62,0.3);
}
.btn-danger:hover { background: rgba(229,62,62,0.25); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--night-border);
}
.btn-ghost:hover { background: var(--night-card); color: var(--text); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

/* ── Formulaires ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.2rem; }
.form-label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select, .form-textarea {
  background: var(--night);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(0,201,123,0.12);
}
.form-select option { background: var(--night-mid); }

/* ── Alertes / Messages ───────────────────────────────────── */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.alert-success { background: rgba(0,201,123,0.12); border: 1px solid rgba(0,201,123,0.3); color: var(--emerald); }
.alert-error   { background: rgba(229,62,62,0.12); border: 1px solid rgba(229,62,62,0.3); color: var(--red); }
.alert-info    { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: var(--blue); }
.alert-warning { background: rgba(245,197,24,0.12); border: 1px solid rgba(245,197,24,0.3); color: var(--gold); }

/* ── Login page ───────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--night-card);
  border: 1px solid var(--night-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  position: relative;
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--emerald), var(--gold), var(--emerald));
  background-size: 200% 100%;
  animation: shimmer 3s ease infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.login-logo {
  text-align: center; margin-bottom: 1.5rem;
}
.login-logo .trophy { font-size: 3rem; display: block; animation: bounce 2s ease infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.login-title {
  font-family: var(--font-display);
  font-size: 2rem; letter-spacing: 2px; color: var(--gold);
  text-align: center; margin-bottom: 0.25rem;
}
.login-subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* ── Page connexion graphique ─────────────────────────────── */
.login-pitch {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 200px; z-index: 0; pointer-events: none;
  opacity: 0.07;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0,201,123,0.3) 100%);
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 0; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--night-border);
}
.tab-btn {
  padding: 0.6rem 1.4rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.88rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Countdown ────────────────────────────────────────────── */
.countdown {
  display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap;
}
.countdown-unit {
  display: flex; flex-direction: column; align-items: center;
  background: var(--night);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem; min-width: 64px;
}
.countdown-val {
  font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); line-height: 1;
}
.countdown-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── Champion prono card ──────────────────────────────────── */
.champion-card {
  background: linear-gradient(135deg, rgba(245,197,24,0.08), rgba(0,201,123,0.05));
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.champion-card .card-title { color: var(--gold); border-bottom-color: rgba(245,197,24,0.2); }

/* ── Graphique ────────────────────────────────────────────── */
.chart-wrapper {
  position: relative; width: 100%; height: 300px;
}
canvas { max-width: 100%; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--night-border);
  margin-top: 3rem;
  position: relative; z-index: 1;
}

/* ── Status badges ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-open    { background: rgba(0,201,123,0.15); color: var(--emerald); }
.badge-locked  { background: rgba(245,197,24,0.12); color: var(--gold); }
.badge-done    { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-cancel  { background: rgba(229,62,62,0.12); color: var(--red); }

/* ── Utilitaires ──────────────────────────────────────────── */
.text-gold  { color: var(--gold); }
.text-green { color: var(--emerald); }
.text-red   { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.font-display { font-family: var(--font-display); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ── Matches grid ─────────────────────────────────────────── */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--night-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Animations entrée ────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }
.fade-up-1 { animation-delay: 0.05s; opacity: 0; }
.fade-up-2 { animation-delay: 0.1s; opacity: 0; }
.fade-up-3 { animation-delay: 0.15s; opacity: 0; }
.fade-up-4 { animation-delay: 0.2s; opacity: 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar-menu { display: none; }
  .brand-text { font-size: 1rem; }
  .main-content { padding: 1rem; }
  .page-title { font-size: 1.8rem; }
  .matches-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE COMPLÉMENTAIRE — corrections globales mobile
   ============================================================ */

/* Stat cards : 2 colonnes sur mobile au lieu de 4 */
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.8rem; }
}

/* Tables admin : scroll horizontal */
@media (max-width: 768px) {
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table th, .data-table td { font-size: 0.78rem; padding: 0.5rem 0.6rem; }
}

/* Formulaires admin : pleine largeur */
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .prono-form { flex-wrap: wrap; justify-content: center; }
  .match-teams { gap: 0.4rem; }
  .team-name { font-size: 0.9rem; }
  .page-title { font-size: 1.6rem; }
}

/* Dropdown admin navbar : hors écran sur mobile → désactiver hover */
@media (max-width: 768px) {
  .dropdown-menu { display: none !important; }
}

/* Champion card sur mobile */
@media (max-width: 600px) {
  .champion-card form { flex-direction: column; align-items: stretch; }
  .champion-card form .form-input { min-width: unset; }
}
