/* ============================================================
   shared.css  —  Design system — AniFun
   Chargé EN PREMIER sur toutes les pages
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@700;800&display=swap');

/* ---- Variables globales ---- */
:root {
  --primary:       #22d1a1;
  --primary-dim:   #1ab88e;
  --secondary:     #ff6b81;
  --secondary-dim: #e05270;
  --accent:        #ffcc00;
  --accent-dim:    #e6b800;
  --bg:            #121212;
  --bg-raised:     #1a1a2e;
  --bg-card:       rgba(255, 255, 255, 0.05);
  --bg-glass:      rgba(255, 255, 255, 0.07);
  --text:          #e4e4e4;
  --text-muted:    rgba(255, 255, 255, 0.45);
  --border:        rgba(255, 255, 255, 0.10);
  --border-hover:  rgba(255, 255, 255, 0.22);
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     20px;
  --radius-pill:   50px;
  --shadow:        0 4px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg:     0 8px 40px rgba(0, 0, 0, 0.7);
  --transition:    0.28s ease;
  --font:          'Poppins', sans-serif;
  --font-heading:  'Montserrat', 'Poppins', sans-serif;
}

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

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar            { width: 5px; height: 5px; }
::-webkit-scrollbar-track      { background: var(--bg); }
::-webkit-scrollbar-thumb      { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,0.3); }

/* ---- Sélection texte ---- */
::selection { background: var(--primary); color: #000; }

/* ============================================================
   COMPOSANTS
   ============================================================ */

/* ---- Header de page ---- */
.page-header {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  text-align: center;
  padding: 2.5rem 1.5rem;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  width: 100%;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 45%, rgba(255,255,255,0.06));
  pointer-events: none;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.page-header h2,
.page-header p {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 400;
  margin-top: 0.5rem;
}

/* ---- Carte glass ---- */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.glass:hover {
  border-color: var(--border-hover);
}

/* ---- Boutons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.65em 1.5em;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), filter var(--transition);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  color: #fff;
  letter-spacing: 0.02em;
}
.btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,0,0,0.45); filter: brightness(1.08); }
.btn:active { transform: translateY(0);    box-shadow: none; }

.btn-primary   { background: linear-gradient(135deg, var(--primary), var(--primary-dim)); }
.btn-secondary { background: linear-gradient(135deg, var(--secondary), var(--secondary-dim)); }
.btn-accent    { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #1a1a1a; }
.btn-danger    { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.btn-ghost     {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.14); border-color: var(--border-hover); }

/* ---- Inputs ---- */
.input {
  width: 100%;
  padding: 0.75em 1.1em;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 209, 161, 0.15);
}
.input::placeholder { color: var(--text-muted); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-box {
  background: #1c1c2e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  max-width: 500px;
  width: 92%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s ease;
}
@keyframes modal-in {
  from { transform: scale(0.88) translateY(10px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}
.modal-box h2 { font-family: var(--font-heading); margin-bottom: 1rem; color: #fff; }
.modal-box p  { color: var(--text-muted); margin-bottom: 1.2rem; }

/* ---- Toast/notification ---- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(30, 30, 46, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75em 2em;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  box-shadow: var(--shadow);
}
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--primary);   color: var(--primary);   }
.toast.error   { border-color: var(--secondary); color: var(--secondary); }
.toast.warn    { border-color: var(--accent);    color: var(--accent);    }

/* ---- Tags / badges ---- */
.badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-primary   { background: rgba(34,209,161,0.15);  color: var(--primary);   }
.badge-secondary { background: rgba(255,107,129,0.15); color: var(--secondary); }
.badge-accent    { background: rgba(255,204,0,0.15);   color: var(--accent);    }

/* ---- Section title ---- */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================================
   ÉLÉMENTS COMMUNS À TOUTES LES PAGES
   ============================================================ */

/* ---- Bouton retour ---- */
#back-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
#back-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-hover);
  transform: translateX(-3px);
}

/* ---- Crédits ---- */
#credits {
  position: fixed;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  letter-spacing: 0.05em;
  font-family: var(--font);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .page-header { padding: 1.8rem 1rem; }
  .btn         { font-size: 0.88rem; padding: 0.6em 1.2em; }
  .modal-box   { padding: 1.5rem; }
}
@media (max-width: 480px) {
  #back-btn { padding: 6px 11px; font-size: 0.78rem; }
  .section-title { font-size: 1.2rem; }
}
