/* Variables CSS */
:root {
    --primary-color: #3182ce; /* Bleu vif */
    --success-color: #2f9e44; /* Vert vif */
    --error-color: #f87171; /* Rouge vif */
    --bg-color: #f7fafc; /* Fond gris clair */
    --card-bg: #ffffff; /* Blanc pur */
    --text-color: #1a202c; /* Gris très foncé */
    --shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 16px;
    --footer-bg: #2d3748; /* Gris foncéy */
    --footer-text: #e2e8f0;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 70px 1rem 60px; 
    line-height: 1.5;
}

/* Navbar */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--text-color);
    color: white;
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
}

.progress-bar {
    width: 180px;
    height: 5px;
    background: #4a5568;
    border-radius: 3px;
}

.progress {
    width: 0;
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.5s ease-in-out;
}

.timer {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    color: white;
}

/* Conteneur du quiz */
.quiz-container {
    max-width: 800px;
    margin: 1.5rem auto;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Question */
.question-container {
    text-align: center;
}

.question {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Options */
.options-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.option-btn {
    padding: 0.8rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: scale(1.02);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Animations */
@keyframes fade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.animate-fade {
    animation: fade 0.4s ease-out;
}

.shake {
    animation: shake 0.3s ease-in-out;
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

.question-container.exit {
    animation: fadeOut 0.4s ease-out forwards;
}

/* Résultat final */
.final-score {
    text-align: center;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
}

.final-score h2 {
    font-size: 1.4rem; 
    margin-bottom: 0.8rem; 
}

.score {
    font-size: 1.8rem; 
    color: var(--success-color);
    background: var(--card-bg);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 0.8rem auto; 
    width: fit-content;
}

.questions-review {
    margin: 1rem auto;
    max-width: 600px;
}

.question-review {
    padding: 0.6rem;
    margin: 0.3rem 0;
    border-radius: 8px;
    font-size: 0.85rem; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-review span {
    font-size: 0.9rem;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem; 
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-top: 1rem; 
}

/* Responsive */
@media (max-width: 768px) {
    .final-score h2 {
        font-size: 1.2rem;
    }

    .score {
        font-size: 1.6rem; 
    }

    .question-review {
        font-size: 0.8rem; 
    }

    .retry-btn {
        font-size: 0.85rem; 
        padding: 0.5rem 1rem; 
    }
}

@media (max-width: 480px) {
    .final-score h2 {
        font-size: 1.1rem;
    }

    .score {
        font-size: 1.4rem; 
        padding: 0.5rem 1rem; 
    }

    .question-review {
        font-size: 0.75rem; 
    }

    .retry-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}
/* Footer */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 0.75rem 1rem;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
    font-size: 0.9rem;
}

.footer-content p {
    flex: 1;
    text-align: left;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.contact-link {
    color: var(--footer-text);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.contact-link:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}


/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 60px 0.5rem 50px; 
    }

    .quiz-container {
        margin: 1rem;
        padding: 1rem;
    }

    .question {
        font-size: 1.2rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .progress-bar {
        width: 140px;
    }

    .timer {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .final-score h2 {
        font-size: 1.4rem;
    }

    .score {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.8rem;
        text-align: center;
    }

    .footer-content p {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .question {
        font-size: 1.1rem;
    }

    .option-btn {
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    .final-score h2 {
        font-size: 1.3rem;
    }

    .score {
        font-size: 1.8rem;
        padding: 0.6rem 1.2rem;
    }

    .retry-btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    .question-review {
        font-size: 0.9rem;
    }

    .footer-content {
        font-size: 0.75rem;
    }
}

/* Dialogue d'accueil */
.welcome-dialog {
    border: none;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    padding: 1.5rem;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    animation: slide-up 0.3s ease-out forwards; /* Animation rapide depuis le bas */
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
}

.welcome-dialog:hover {
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12); /* Ombre plus prononcée */
}

/* Animation de montée depuis le bas */
@keyframes slide-up {
    0% {
        transform: translate(-50%, 100vh); /* Départ depuis le bas de l'écran */
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%); /* Arrivée au centre */
        opacity: 1;
    }
}

.welcome-dialog[open]::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.dialog-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.dialog-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.welcome-dialog h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin:0;
    color: var(--text-color);
    line-height: 1.4;
    
}

.start-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.start-btn:hover {
    background: var(--success-color);
    transform: scale(1.05);
}

/* Fond sombre derrière le dialogue */
.welcome-dialog[open]::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
    .welcome-dialog {
        padding: 1rem;
    }

    .welcome-dialog h2 {
        font-size: 1.2rem;
    }

    .dialog-logo {
        width: 80px;
        height: 80px;
    }

    .start-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}
