/* ============================================================
   components.css — Composants réutilisables
   Chaque section correspond à un composant indépendant que
   l'on peut copier-coller sur n'importe quelle page.
   ============================================================ */

/* ===========================================
   CARD — Bloc de contenu générique
   Usage : <div class="card">...</div>
   =========================================== */
.card {
  background: var(--surface-high);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ===========================================
   BADGE PILL — Étiquette de statut
   Variantes : .completed | .active | .locked
   Usage : <span class="badge completed">Complété</span>
   =========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.badge.completed { background: rgba(107, 255, 143, 0.12); color: var(--secondary); }
.badge.active    { background: rgba(163, 166, 255, 0.12); color: var(--primary); }
.badge.locked    { background: rgba(109, 117, 140, 0.15); color: var(--outline); }

/* ===========================================
   SECTION HEADER — Titre de section en caps
   Usage : <div class="section-header">Titre</div>
   =========================================== */
.section-header {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-bottom: 16px;
}

/* ===========================================
   SECTION DIVIDER — Label centré avec lignes
   Usage : <div class="current-section-label">Texte</div>
   =========================================== */
.current-section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}
.current-section-label::before,
.current-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

/* ===========================================
   STREAK FLAME — Badge de jours consécutifs
   Usage : <div class="streak-flame">🔥 7 days</div>
   =========================================== */
.streak-flame {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 213, 116, 0.1);
  border: 1px solid rgba(255, 213, 116, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--tertiary);
}

/* ===========================================
   XP BAR — Barre de progression d'expérience
   Structure HTML requise :
   <div class="xp-bar">
     <div class="xp-fill" style="width: XX%;"></div>
   </div>
   =========================================== */
.xp-bar {
  height: 10px;
  background: var(--surface-highest);
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(to right, var(--tertiary), #f5a623);
  border-radius: 5px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
/* Effet de reflet animé sur la barre XP */
.xp-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 30px; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3));
  animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}

/* ===========================================
   AVATAR — Photo de profil ronde
   Usage : <img class="avatar" src="..." alt="">
   =========================================== */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ===========================================
   LEADERBOARD ITEM — Ligne du classement
   Variante : .me pour mettre en évidence l'utilisateur
   Usage :
   <div class="lb-item me">
     <span>1</span>
     <img class="avatar" ...>
     <div>Nom · XP</div>
   </div>
   =========================================== */
.lb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s;
  cursor: pointer;
}
.lb-item:hover { background: rgba(255, 255, 255, 0.04); }
.lb-item.me {
  background: rgba(163, 166, 255, 0.08);
  border: 1px solid rgba(163, 166, 255, 0.15);
}

/* ===========================================
   FAB — Bouton d'action principal flottant
   Usage : <button class="fab">...</button>
   =========================================== */
.fab {
  position: fixed;
  bottom: 32px; right: 320px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  color: #0f00a4;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(163, 166, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
}
.fab:hover  { transform: scale(1.12); box-shadow: 0 12px 48px rgba(163, 166, 255, 0.6); }
.fab:active { transform: scale(0.95); }

/* ===========================================
   CONTINUE BUTTON — Bouton principal in-card
   Usage : <button class="continue-btn">...</button>
   =========================================== */
.continue-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  color: #0e009d;
  border: none;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: 16px;
}
.continue-btn:hover  { transform: scale(1.02); box-shadow: 0 8px 32px rgba(163, 166, 255, 0.3); }
.continue-btn:active { transform: scale(0.98); }

.continue-btn--abandon {
  background: rgba(255, 213, 116, 0.08);
  color: var(--tertiary);
  border: 1px solid rgba(255, 213, 116, 0.15);
  width: auto;
 
}
.continue-btn--abandon:hover {
  box-shadow: 0 8px 32px rgba(255, 213, 116, 0.2);
}

/* ===========================================
   TOOLTIP — Info-bulle au survol
   Doit être enfant direct d'un .node-wrapper
   =========================================== */
.tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-highest);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 50;
}
.node-wrapper:hover .tooltip { opacity: 1; }

.filter-pill{
  padding:8px 14px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  letter-spacing:.04em;
  color:var(--on-surface-variant);
  background:rgba(255,255,255,0.04);
  backdrop-filter:blur(10px);
  transition:all .2s ease;
}

.filter-pill:hover{
  background:rgba(255,255,255,0.08);
  color:var(--on-surface);
}

.filter-pill.active{
  color:white;
  background:linear-gradient(135deg,var(--primary),var(--primary-dim));
  box-shadow:0 0 18px rgba(163,166,255,.35);
}