/* ===========================================================
   🎯 QUIZ ENTRE POTES — STYLE V2.4
   Auteur : vinrichka
   Description :
   Feuille de style modernisée, lisible et réactive
   Compatible thème sombre / clair / fun / full_dark
   =========================================================== */

/* -----------------------------------------------------------
   🧱 RESET GÉNÉRAL
   ----------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
}

/* === Animations & Transitions === */
.fade {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.fade.show {
  opacity: 1;
}



/* === Thèmes visuels — Général / Fun / Full Dark === */

/* Thème clair (par défaut) — Mode Général */
html[data-theme="general"] {
  --bg-color: #ffffff;
  --text-color: #111111;
  --accent-color: #007bff;
  --button-bg: #f5f5f5;
  --button-text: #111111;
  --border-color: #cccccc;
}



/* -----------------------------------------------------------
   🌈 AJUSTEMENTS VISUELS — MODE FUN
   ----------------------------------------------------------- */

/* Thème coloré — Mode Fun */
html[data-theme="fun"] {
  --bg-color: #fff8e1;
  --text-color: #222222;
  --accent-color: #ff6f61;
  --button-bg: #ffe57f;
  --button-text: #111111;
  --border-color: #ffb74d;
}

/* 🔸 1. Fond avec un léger dégradé chaleureux */
html[data-theme="fun"] body {
  background: linear-gradient(180deg, #fff8e1 0%, #ffefb2 100%);
}

/* 🔸 2. Boutons plus “rebondissants” et lumineux */
html[data-theme="fun"] .answerBtn {
  box-shadow: 0 3px 6px rgba(255, 193, 7, 0.25);
  transition: all 0.15s ease;
}

html[data-theme="fun"] .answerBtn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 10px rgba(255, 193, 7, 0.35);
}


/* 🔸 3. Micro-animation lente sur le titre */
html[data-theme="fun"] h1 {
  animation: funBounce 3s ease-in-out infinite alternate;
}

@keyframes funBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}



/* -----------------------------------------------------------
   🌑 AJUSTEMENTS VISUELS — MODE FULL DARK
   ----------------------------------------------------------- */


/* Thème sombre — Mode Full Dark */
html[data-theme="full_dark"] {
  --bg-color: #121212;
  --text-color: #f0f0f0;
  --accent-color: #e74c3c;
  --button-bg: #1f1f1f;
  --button-text: #f0f0f0;
  --border-color: #333333;
}
/* -----------------------------------------------------------
   🔧 CORRECTIONS ET AMÉLIORATIONS VISUELLES — MODE FULL DARK
   ----------------------------------------------------------- */

/* 1. Question principale : plus lisible */
html[data-theme="full_dark"] #quizQuestion {
  color: #f2f2f2;           /* blanc doux */
  font-weight: 600;         /* texte un peu plus marqué */
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.08); /* léger halo */
}

/* 2. Réponses : contraste un peu renforcé */
html[data-theme="full_dark"] .answerBtn {
  background: #232323;      /* un ton plus clair que le fond */
  border: 1px solid #333;   /* délimitation douce */
  color: #f5f5f5;           /* texte clair */
}

html[data-theme="full_dark"] .answerBtn:hover {
  background: #2c2c2c;      /* éclaircissement subtil */
}

/* 3. Résultat final : carte mieux détachée */
html[data-theme="full_dark"] #quizQuestion.finished {
  background: #1d1d1d;
  border: 1px solid #333;
  box-shadow: 0 0 15px rgba(0, 188, 212, 0.25); /* halo turquoise */
  color: #f2f2f2;
}




/* -----------------------------------------------------------
   🌗 BASE DU SITE
   ----------------------------------------------------------- */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  transition: background-color 0.4s, color 0.4s;
}

/* ===============================
   🏷️ Titre et sous-titre du quiz
   =============================== */
header {
  text-align: center; /* ✅ Centre tout le contenu du header */
}

header h1 {
  font-size: clamp(1.5rem, 4vw, 1.8rem); /* ↓ réduit de ~15%, s'adapte à l'écran */
  font-weight: 700;
  line-height: 1.2; /* un peu plus compact */
  margin-bottom: 0.35rem;
  color: var(--text-color);
}

header em {
  font-size: clamp(0.9rem, 2.5vw, 1rem); /* ↓ réduit d'une taille environ */
  font-style: normal;
  color: var(--accent-color);
  opacity: 0.9; /* optionnel : rend le sous-titre légèrement plus doux */
}





/* -----------------------------------------------------------
   🎨 COULEUR DU TEXTE SECONDAIRE
   ----------------------------------------------------------- */
.subtitle,
h2,
h3 {
  color: rgba(0, 0, 0, 0.7);
}


/* -----------------------------------------------------------
   🎮 ZONE DE QUIZ
   ----------------------------------------------------------- */
/* -----------------------------------------------------------
   🎮 Sélecteur de mode (en bas du site)
   ----------------------------------------------------------- */
#mode-selector-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

#mode-selector-footer label {
  font-weight: 600;
  color: var(--text-color);
}

#mode-selector-footer select {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  transition: background-color 0.3s;
}

#mode-selector-footer select:hover {
  background-color: var(--accent-color);
  color: #fff;
}

#lang-selector-footer {
  display: flex;
  flex-direction: column;  /* ✅ icône au-dessus de la liste */
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
}



/* -----------------------------------------------------------
   ❓ QUESTIONS ET MESSAGES DE FIN
   ----------------------------------------------------------- */

/* Centre le texte des questions (et aussi du message final “Quiz terminé”) */
#quizQuestion {
  text-align: center;
}

/* Centre le texte des messages de fin affichés dans #quizAnswers */
#quizAnswers p {
  text-align: center;
  margin-top: 0.5rem; /* petit espace au-dessus pour l’aération */
}


/* -----------------------------------------------------------
   🎯 MISE EN VALEUR DE LA QUESTION
   ----------------------------------------------------------- */

/* Titre principal un peu plus sobre */
h1 {
  font-size: 1.9rem;
}

/* Question légèrement plus affirmée */
#quizQuestion {
  font-size: 1.4rem;
  margin: 0.8rem 0;
}



/* -----------------------------------------------------------
   🏁 STYLE DU MESSAGE FINAL (fin de quiz)
   ----------------------------------------------------------- */
#quizQuestion.finished {
  background-color: var(--button-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  margin: 1.5rem auto;
  text-align: center;
  transition: all 0.3s ease-in-out;
}


/* -----------------------------------------------------------
   ✨ ANIMATION D'APPARITION DU MESSAGE FINAL
   ----------------------------------------------------------- */
@keyframes fadeInZoom {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#quizQuestion.finished,
#quizAnswers.finished {
  animation: fadeInZoom 0.4s ease-out;
}



/* -----------------------------------------------------------
   🧩 RÉPONSES
   ----------------------------------------------------------- */
.answers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* --- Style par défaut --- */
.answerBtn {
  background-color: var(--button-bg);
  color: var(--button-text);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

/* --- Survol --- */
.answerBtn:hover:not(:disabled) {
  transform: scale(1.02);
  background-color: var(--accent-color);
  color: #fff;
}

/* Effet de clic sur les réponses */
.answerBtn:active {
  transform: scale(0.98);
}


/* --- États correct / incorrect universels --- */
.answerBtn.correct {
  background-color: #2ecc71 !important;
  border-color: #27ae60 !important;
  color: #fff !important;
  animation: pop 0.2s ease-in-out;
}

.answerBtn.incorrect {
  background-color: #e74c3c !important;
  border-color: #c0392b !important;
  color: #fff !important;
}

/* --- Désactivation --- */
.answerBtn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

/* --- Animation d’apparition pour la bonne réponse --- */
@keyframes pop {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* -----------------------------------------------------------
   🌈 EFFET DYNAMIQUE AU SURVOL DES RÉPONSES
   ----------------------------------------------------------- */
.answerBtn {
  transition: all 0.15s ease;
}

.answerBtn:hover {
  transform: scale(1.02);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}


/* -----------------------------------------------------------
   💬 MINI COMMENTAIRE
   ----------------------------------------------------------- */
/* -----------------------------------------------------------
   💬 MINI COMMENTAIRE — explication de la reponse 
   ----------------------------------------------------------- */
.mini-comment {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 1rem;
  font-style: italic;
  color: var(--text-color);
  background: transparent;
  border: none;
  padding: 0.5rem;
  opacity: 0;                 /* caché par défaut */
  transition: opacity 0.4s ease; /* effet fondu doux */
}

.mini-comment.visible {
  opacity: 1;                 /* visible en fondu */
}



/* -----------------------------------------------------------
   🔘 BOUTONS (SUIVANT / REJOUER)
   ----------------------------------------------------------- */
.buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* --- Boutons génériques --- */
button {
  background-color: var(--button-bg);
  color: var(--button-text);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  min-width: 120px;
}

/* --- Hover --- */
button:hover {
  background-color: var(--accent-color);
  color: #fff;
  transform: translateY(-2px);
}

/* --- Bouton SUIVANT isolé --- */
#nextBtn {
  display: block;
  margin: 1.5rem auto 1rem auto; /* centré + espacement haut/bas */
}

/* --- Bouton REJOUER (dans .buttons) --- */
#restartBtn {
  margin: 0 auto;
}


/* ===========================================================
   ⚙️ PIED DE PAGE HARMONISÉ — MODE + LANGUE
   =========================================================== */
.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

/* === 🎮 Sélecteur de mode === */
#themeMode {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s ease-in-out;
}

#themeMode:hover {
  background: var(--accent-color);
  color: #fff;
}



/* ==========================================================
   ⚙️ Pied de page — sélecteurs mode et langue
   ========================================================== */

.footer-bar {
  display: flex;
  justify-content: center;   /* centre horizontalement */
  align-items: center;       /* aligne verticalement */
  gap: 0.8rem;               /* espace entre les deux blocs */
  flex-wrap: nowrap;         /* ❗ reste sur une seule ligne */
  padding: 0.6rem 0.8rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* Chaque bloc (mode + langue) */
.footer-bar > div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0;             /* évite un décalage vertical */
}

/* Labels (emojis 🎮 / 🌍) */
.footer-bar label {
  font-size: 1rem;
  color: var(--text-color);
  font-weight: 600;
}

/* Sélecteurs */
.footer-bar select {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--button-bg);
  color: var(--button-text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  max-width: 44vw;           /* pour que les 2 tiennent côte à côte */
}

.footer-bar select:hover {
  background-color: var(--accent-color);
  color: #fff;
}

/* 🪶 Adaptation pour très petits écrans */
@media (max-width: 350px) {
  .footer-bar {
    flex-wrap: wrap;          /* si l'écran est trop étroit, repasse à la ligne */
  }

  .footer-bar select {
    max-width: 100%;
  }
}




/* ===========================================================
   🌑 VARIANTE AUTOMATIQUE — MODE FULL DARK
   =========================================================== */
html[data-theme="full_dark"] .footer-bar {
  border-top: 1px solid #2a2a2a;
}

html[data-theme="full_dark"] #themeMode {
  background: #1f1f1f;
  border-color: #333;
  color: #f5f5f5;
}

html[data-theme="full_dark"] #themeMode:hover {
  background: #e74c3c;
  color: #fff;
}

html[data-theme="full_dark"] .lang-btn {
  background: #1f1f1f;
  border-color: #333;
}

html[data-theme="full_dark"] .lang-btn img {
  border: 1px solid #444;
}

html[data-theme="full_dark"] .lang-menu {
  background: #1b1b1b;
  border-color: #333;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.05);
}

html[data-theme="full_dark"] .lang-option {
  color: #f2f2f2;
}

html[data-theme="full_dark"] .lang-option:hover {
  background: #e74c3c;
  color: #fff;
}

