/**
 * STYLES POUR LE SYSTÈME DE QUIZZ DES MODULES
 * Version 2.0 - Modal full-screen avec navigation question par question
 */

/* ========================================
   SECTION D'EXAMEN (Bouton / Message complétion)
   ======================================== */

.exam-launch-section,
.module-completion-status {
  background: linear-gradient(135deg, rgba(187, 134, 252, 0.15) 0%, rgba(255, 107, 53, 0.15) 100%);
  border: 2px solid rgba(187, 134, 252, 0.3);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  margin: 2rem 0;
}

.exam-icon,
.completion-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 1s ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.exam-launch-section h3,
.module-completion-status h3 {
  color: white;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.exam-launch-section p,
.module-completion-status p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.start-exam-btn,
.retry-exam-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: linear-gradient(135deg, var(--accent-purple, #BB86FC) 0%, var(--accent-orange, #FF6B35) 100%);
  color: white;
  border: none;
  padding: 1.2rem 2.5rem;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 25px rgba(187, 134, 252, 0.4);
}

.start-exam-btn:hover,
.retry-exam-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 35px rgba(187, 134, 252, 0.6);
}

.start-exam-btn span:first-child,
.retry-exam-btn span:first-child {
  font-size: 1.5rem;
}

/* ========================================
   MODAL FULL-SCREEN
   ======================================== */

.quiz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.quiz-modal-container {
  width: 90%;
  max-width: 900px;
  height: 90vh;
  background: linear-gradient(135deg, #1a1f2e 0%, #0D1117 100%);
  border-radius: 20px;
  border: 2px solid rgba(187, 134, 252, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   HEADER DU MODAL
   ======================================== */

.quiz-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-progress-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quiz-module-badge {
  background: linear-gradient(135deg, var(--accent-purple, #BB86FC) 0%, var(--accent-orange, #FF6B35) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
}

.quiz-question-counter {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 600;
}

.quiz-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-close-btn:hover {
  background: rgba(255, 59, 48, 0.8);
  transform: rotate(90deg);
}

/* ========================================
   BARRE DE PROGRESSION
   ======================================== */

.quiz-progress-bar-container {
  padding: 1rem 2rem 0 2rem;
}

.quiz-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple, #BB86FC) 0%, var(--accent-orange, #FF6B35) 100%);
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* ========================================
   CONTENU DU MODAL (Questions)
   ======================================== */

.quiz-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.quiz-question-slide {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.question-content {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.question-title {
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  line-height: 1.4;
  text-align: center;
}

/* ========================================
   OPTIONS (Cards)
   ======================================== */

.question-options {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.option-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.option-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(187, 134, 252, 0.4);
  transform: translateX(5px);
}

.option-card.selected {
  background: rgba(187, 134, 252, 0.2);
  border-color: var(--accent-purple, #BB86FC);
  box-shadow: 0 0 20px rgba(187, 134, 252, 0.4);
}

.option-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-purple, #BB86FC) 0%, var(--accent-orange, #FF6B35) 100%);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.option-text {
  color: white;
  font-size: 1.1rem;
  line-height: 1.5;
}

.option-checkmark {
  display: none;
  color: var(--accent-purple, #BB86FC);
  font-size: 1.8rem;
  font-weight: 700;
}

.option-card.selected .option-checkmark {
  display: block;
}

/* ========================================
   FOOTER DU MODAL (Navigation)
   ======================================== */

.quiz-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 1rem;
}

.quiz-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-purple, #BB86FC);
  transform: translateY(-2px);
}

.quiz-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.quiz-submit-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: linear-gradient(135deg, #00FF7F, #00CC64);
  border: none;
  color: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 255, 127, 0.4);
  margin-left: auto;
}

.quiz-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 255, 127, 0.6);
}

.quiz-submit-btn span:first-child {
  font-size: 1.3rem;
}

/* ========================================
   RÉSULTATS
   ======================================== */

.quiz-result-success,
.quiz-result-echec {
  text-align: center;
  padding: 3rem 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.result-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: bounce 0.6s ease-out;
}

.quiz-result-success h2 {
  color: #00FF7F;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.quiz-result-echec h2 {
  color: #FF6B35;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.result-score {
  color: white;
  font-size: 1.5rem;
  margin: 1rem 0;
}

.result-score strong {
  color: var(--accent-purple, #BB86FC);
  font-size: 2rem;
}

.result-message {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  margin: 1rem 0;
}

.result-conseil {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
}

.result-xp {
  display: inline-block;
  background: linear-gradient(135deg, #FFD700, #FF6B35);
  color: #0D1117;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.5rem 0;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.7);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-purple, #BB86FC);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.result-button,
.retry-button,
.close-button {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.result-button {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.result-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-purple, #BB86FC);
  transform: translateY(-2px);
}

.result-button.next {
  background: linear-gradient(135deg, var(--accent-purple, #BB86FC) 0%, var(--accent-orange, #FF6B35) 100%);
  border-color: transparent;
}

.result-button.next:hover {
  box-shadow: 0 4px 20px rgba(187, 134, 252, 0.4);
}

.retry-button {
  background: linear-gradient(135deg, #FF6B35, #FF3B30);
  color: white;
}

.retry-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 107, 53, 0.6);
}

.close-button {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.result-error {
  background: rgba(255, 59, 48, 0.1);
  border: 2px solid #FF3B30;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1.5rem;
  color: white;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .quiz-modal-container {
    width: 95%;
    height: 95vh;
  }

  .quiz-modal-header {
    padding: 1rem;
  }

  .quiz-progress-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .quiz-module-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .quiz-question-counter {
    font-size: 0.9rem;
  }

  .quiz-modal-content {
    padding: 1.5rem 1rem;
  }

  .question-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
  }

  .option-card {
    padding: 1rem;
  }

  .option-letter {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .option-text {
    font-size: 1rem;
  }

  .quiz-modal-footer {
    flex-direction: column;
    padding: 1rem;
  }

  .quiz-nav-btn,
  .quiz-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .result-icon {
    font-size: 3.5rem;
  }

  .quiz-result-success h2,
  .quiz-result-echec h2 {
    font-size: 2rem;
  }

  .result-score {
    font-size: 1.2rem;
  }

  .result-xp {
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
  }

  .result-actions {
    flex-direction: column;
    width: 100%;
  }

  .result-button,
  .retry-button,
  .close-button {
    width: 100%;
    justify-content: center;
  }
}
