/* Réinitialisation */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Style global du body */
body {
  background: linear-gradient(135deg, #ffecd2, #fcb69f);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

/* Conteneur principal */
.container {
  background: #fff;
  width: 100%;
  max-width: 800px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 30px 25px; /* Plus d'espace pour améliorer la lisibilité */
  text-align: center;
  animation: fadeIn 0.6s ease forwards;
}

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

/* Titres et paragraphes */
h1, h2, p {
  color: #333;
  margin-bottom: 10px;
}

/* Boutons de base */
button {
  cursor: pointer;
  outline: none;
  border: none;
  border-radius: 6px;
  padding: 10px 15px;
  font-weight: bold;
}

/* Styles pour les champs de texte (inputs) */
input[type="text"],
textarea {
  width: 80%;
  max-width: 500px;
  padding: 12px;
  margin: 10px auto;
  display: block;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  transition: border 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #4caf50;
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* Classe utilitaire pour masquer */
.hidden { 
  display: none; 
}

/* Section de sélection de catégorie / Table des matières */
#category-container,
#toc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

/* Bouton de catégorie */
.category-btn {
  background: #FF7F50;
  color: #fff;
  padding: 15px 20px;
  font-size: 1.1em;
  transition: background 0.3s, transform 0.2s;
}
.category-btn:hover {
  background: #e06c3b;
  transform: scale(1.02);
}

/* Zone du quiz */
#quiz-container {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Section d'information du quiz */
#top-infos {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
#progressBar {
  width: 70%;
  height: 12px;
  background: #ddd;
  border-radius: 5px;
  overflow: hidden;
}
#progressBar > div {
  height: 100%;
  width: 0%;
  background: #4caf50;
  transition: width 0.3s;
}
#questionIndex {
  font-weight: bold;
  margin-right: 10px;
}

/* Zone de la question */
#question {
  font-size: 1.3em;
  margin: 15px 0 20px;
  color: #555;
}

/* Boutons des réponses */
#answers-container button {
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 8px auto;
  padding: 12px;
  font-size: 1em;
  background: #f0f0f0;
  color: #333;
  transition: background 0.3s, transform 0.2s;
  border-radius: 6px;
  cursor: pointer;
}
#answers-container button:hover {
  transform: scale(1.02);
}

/* Réponses correctes et incorrectes */
#answers-container button.correct {
  background: #4caf50 !important;
  color: #fff;
  animation: correctAnswer 0.4s ease-in-out;
}
@keyframes correctAnswer {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
#answers-container button.wrong {
  background: #f44336 !important;
  color: #fff;
  animation: wrongAnswer 0.4s ease-in-out;
}
@keyframes wrongAnswer {
  0% { transform: scale(1); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
#answers-container button.disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Zone d'explication */
#explanation {
  margin-top: 20px;
  font-style: italic;
  color: #555;
  padding: 15px;
  background: #f7f7f7;
  border-radius: 5px;
  min-height: 50px;
  max-width: 600px;
  line-height: 1.5;
}

/* Boutons de navigation du quiz */
#next-btn, #retry-btn {
  margin-top: 20px;
  padding: 12px 20px;
  background: #2196f3;
  color: #fff;
  font-size: 1em;
  transition: background 0.3s, transform 0.2s;
  border-radius: 6px;
}
#next-btn:hover, #retry-btn:hover {
  background: #1976d2;
  transform: scale(1.02);
}

/* Affichage du score */
#score {
  font-size: 1.1em;
  margin-top: 15px;
  color: #333;
}

/* Style pour le logo */
.logo {
  max-width: 150px;
  margin-bottom: 15px;
}

/* Bouton de retour à l'accueil */
.back-btn {
  margin-bottom: 20px;
  background: #2196f3;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.3s;
}
.back-btn:hover {
  background: #1976d2;
}

/* Styles pour l'accordéon (utilisé sur les pages d'information par exemple) */
.accordion-section {
  margin: 15px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  overflow: hidden;
}
.accordion-header {
  padding: 15px;
  background: #FF7F50;
  color: #fff;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.3s;
}
.accordion-header:hover {
  background: #e06c3b;
}
.accordion-content {
  padding: 15px;
  background: #fff;
  display: none;
  text-align: left;
  color: #333;
}
.accordion-content p {
  margin-bottom: 10px;
  line-height: 1.5;
}