/* ===================================
   Variables CSS pour palette de couleurs
   =================================== */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-success: #10b981;
    --color-success-glow: rgba(16, 185, 129, 0.3);
    --color-error: #ef4444;
    --color-error-glow: rgba(239, 68, 68, 0.3);
    --color-background: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-hover: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-in-out;
}

/* ===================================
   Reset et styles de base
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* ===================================
   Indicateur de progression
   =================================== */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
}

.progress-bar {
    width: 100%;
    max-width: 800px;
    height: 8px;
    background: var(--color-border);
    border-radius: 100px;
    overflow: hidden;
    margin: 0 auto 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 100px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

.progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.5px;
}

/* ===================================
   Conteneur principal du quiz
   =================================== */
.quiz-container {
    width: 100%;
    max-width: 800px;
    margin: 100px auto 40px;
    perspective: 1000px;
}

.question-card {
    background: var(--color-surface);
    border-radius: 24px;
    padding: 48px;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-base);
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.question-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 32px;
    line-height: 1.4;
    text-align: center;
}

/* ===================================
   Choix de réponses
   =================================== */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.choice-item {
    position: relative;
    background: var(--color-background);
    border: 2px solid var(--color-border);
    border-radius: 16px;
    padding: 20px 24px;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 16px;
    outline: none;
}

.choice-item:hover:not(.locked) {
    background: var(--color-hover);
    border-color: var(--color-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.choice-item:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.choice-label {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    transition: var(--transition-base);
}

.choice-text {
    flex: 1;
    font-size: 16px;
    color: var(--color-text);
    font-weight: 500;
}

/* État: Réponse correcte sélectionnée */
.choice-item.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--color-success);
    border-width: 3px;
    animation: correctPulse 0.6s ease-out;
    box-shadow: 0 0 0 0 var(--color-success-glow);
}

.choice-item.correct .choice-label {
    background: var(--color-success);
    animation: successGlow 1.5s ease-in-out infinite;
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--color-success-glow);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 10px var(--color-success-glow);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--color-success-glow);
    }
}

@keyframes successGlow {
    0%, 100% {
        box-shadow: 0 0 10px var(--color-success-glow);
    }
    50% {
        box-shadow: 0 0 20px var(--color-success-glow);
    }
}

/* État: Réponse incorrecte sélectionnée */
.choice-item.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-error);
    border-width: 3px;
    animation: shake 0.5s ease-in-out;
}

.choice-item.incorrect .choice-label {
    background: var(--color-error);
    animation: errorPulse 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes errorPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 15px var(--color-error-glow);
    }
    100% {
        transform: scale(1);
    }
}

/* État: Autres réponses (atténuées) */
.choice-item.dimmed {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(50%);
}

.choice-item.locked {
    pointer-events: none;
}

/* ===================================
   Panneau d'explication
   =================================== */
.explanation-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border);
    padding: 24px;
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
    max-height: 40vh;
    overflow-y: auto;
}

.explanation-panel.visible {
    transform: translateY(0);
}

.explanation-content {
    max-width: 800px;
    margin: 0 auto;
}

.explanation-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explanation-title.correct {
    color: var(--color-success);
}

.explanation-title.incorrect {
    color: var(--color-error);
}

.explanation-icon {
    font-size: 24px;
}

.explanation-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text);
    margin-bottom: 16px;
}

.explanation-section {
    margin-bottom: 16px;
}

.explanation-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.explanation-list {
    list-style: none;
    padding: 0;
}

.explanation-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.6;
}

.explanation-list li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--color-error);
    font-weight: 700;
}

/* ===================================
   Boutons de navigation
   =================================== */
.navigation-buttons {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 950;
}

.nav-button {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-base);
    outline: none;
    box-shadow: var(--shadow-md);
}

.nav-button:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-button:active:not(:disabled) {
    transform: translateY(0);
}

.nav-button:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-hover);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.nav-icon {
    font-size: 20px;
    font-weight: 700;
}

/* ===================================
   Indicateur de réponse (feedback visuel)
   =================================== */
.answer-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    pointer-events: none;
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.answer-indicator.show {
    transform: translate(-50%, -50%) scale(1);
}

.answer-indicator.correct-indicator {
    background: var(--color-success);
    color: white;
    box-shadow: 0 0 40px var(--color-success-glow);
}

.answer-indicator.incorrect-indicator {
    background: var(--color-error);
    color: white;
    box-shadow: 0 0 40px var(--color-error-glow);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .question-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .question-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .choice-item {
        padding: 16px 20px;
        flex-direction: row;
    }
    
    .choice-label {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .choice-text {
        font-size: 15px;
    }
    
    .navigation-buttons {
        bottom: 16px;
        gap: 12px;
    }
    
    .nav-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-icon {
        font-size: 24px;
    }
    
    .explanation-panel {
        padding: 20px 16px;
        max-height: 50vh;
    }
    
    .progress-container {
        padding: 12px 16px;
    }
    
    .quiz-container {
        margin-top: 80px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .question-card {
        padding: 24px 16px;
    }
    
    .question-title {
        font-size: 18px;
    }
    
    .choice-item {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .choice-text {
        font-size: 14px;
    }
}

/* ===================================
   Animations de chargement
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-in;
}

/* ===================================
   Accessibilité - Mode contraste élevé
   =================================== */
@media (prefers-contrast: high) {
    .choice-item {
        border-width: 3px;
    }
    
    .nav-button {
        border-width: 3px;
    }
}

/* ===================================
   Accessibilité - Réduction des animations
   =================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ----- FOOTER QUIZ (VERSION HORIZONTALE) ----- */
.quiz-footer {
  margin-top: 60px;
  background: linear-gradient(135deg, #2b2c92, #6a4bcf);
  color: #f5f7ff;
  padding: 2.2rem 2rem;
  border-top-left-radius: 25px;
  border-top-right-radius: 25px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  font-family: "Inter", sans-serif;
}

/* Disposition horizontale */
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 1.8rem;
}

/* Colonnes alignées horizontalement */
.footer-column {
  flex: 1;
  min-width: 260px;
}

.footer-column h3 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.footer-column p {
  margin: 0.3rem 0;
  line-height: 1.45;
  font-size: 0.95rem;
  opacity: 0.92;
}

.footer-column a {
  color: #ffffff;
  opacity: 0.9;
  text-decoration: none;
  transition: 0.25s ease;
}

.footer-column a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.footer-column ul li {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

/* Ligne du bas */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Responsive : revient à la version verticale sur mobile */
@media (max-width: 900px) {
  .footer-content {
    flex-direction: column;
    text-align: left;
  }
}

