/* Variables et reset */
:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --secondary: #818CF8;
  --success: #34D399;
  --danger: #F87171;
  --background: #F9FAFB;
  --text: #1F2937;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Container principal */
.quiz-box {
  background: white;
  max-width: 800px;
  width: 100%;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Barre d'info supérieure */
.info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--background);
  border-radius: 12px;
  font-weight: 500;
}

.timer {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

/* Questions et options */
.question {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
  line-height: 1.4;
}

.option {
  background: white;
  border: 2px solid #E5E7EB;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.option:hover {
  border-color: var(--primary);
  background: #F5F3FF;
  transform: translateY(-2px);
}

.option.correct {
  background: var(--success);
  border-color: var(--success);
  color: white;
  transform: scale(1.02);
}

.option.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  transform: scale(0.98);
}

/* Boîte de résultats */
#resultBox {
  display: none;
  text-align: center;
}

#resultBox h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

#finalScore, #finalPercent {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

#finalMention {
  font-size: 1.5rem;
  color: var(--primary);
  margin: 1rem 0;
  font-weight: 700;
}

hr {
  margin: 2rem 0;
  border: none;
  height: 1px;
  background: #E5E7EB;
}

/* Liste historique */
#historyList {
  list-style: none;
  margin: 1rem 0;
  text-align: left;
}

#historyList li {
  padding: 0.75rem;
  border-bottom: 1px solid #E5E7EB;
  color: #4B5563;
}

/* Boutons */
button, #backBtn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

button:hover, #backBtn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.question, .option {
  animation: fadeIn 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 640px) {
  .quiz-box {
    padding: 1rem;
    border-radius: 12px;
  }

  .info {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .question {
    font-size: 1.1rem;
  }

  .option {
    padding: 0.75rem 1rem;
  }
}

/* Glassmorphism effect */
.quiz-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
  z-index: -1;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Floating animation for elements */
.timer, #scoreLive {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}
