/* --- Styles Généraux pour éviter le défilement horizontal (Inspiration) --- */
*, *::before, *::after {
    /* Ceci garantit que le padding et la bordure sont inclus dans la largeur/hauteur de l'élément */
    box-sizing: border-box; 
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f8f8f8; /* Fond clair de l'inspiration */
    color: #333;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Conteneur du Quiz --- */
.quiz-container {
    background-color: #ffffff;
    border-radius: 1em; /* Rayon de bordure plus grand comme les sections */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
    
    display: flex;
    flex-direction: column; 
    width: 90%; 
    max-width: 1000px;
    
    position: relative; 
    min-height: 500px; 
}

/* --- En-tête et Titres --- */
.header-quizz {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.header-quizz h1 {
    font-size: 1.8em;
    color: #333;
    margin: 0;
}


.type-indication {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
    color: #ffffff;
    background-color: #d1789c; 
    border: 1px solid #c25078;
    margin: 0;
}

.intitule-question {
    font-size: 1.5em;
    color: #1a1a1a;
    margin: 20px 0;
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
}

.content-wrapper {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-grow: 1; 
}

.response-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.response-btn {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 15px;
    border: 2px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    width: 100%;
}

.response-btn:hover:not([disabled]) {
    border-color: #007bff;
}

.response-index {
    font-weight: bold;
    min-width: 25px;
    margin-right: 15px;
    color: #007bff;
}

.response-btn.selected {
    border-color: #007bff;
    background-color: #e6f0ff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.response-btn.correct {
    background-color: #e3f2e4; 
    border-color: #64dd17;
    color: #155724;
    font-weight: bold;
}

.response-btn.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.response-btn[disabled] {
    cursor: default;
}

.validate-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    background-color: #007bff; 
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 15px;
}

.validate-btn:hover:not([disabled]) {
    background-color: #0056b3;
}

.validate-btn[disabled] {
    background-color: #99c2ff;
    cursor: default;
}

.explanation-section {
    flex: 1;
    background-color: #e6f0ff; 
    padding: 20px;
    border-radius: 1em;
    display: none;
    border: 1px solid #cce0ff;
}

.explanation-section h3 {
    margin-top: 0;
    color: #007bff;
    font-size: 1.2em;
}

.feedback-text {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: bold;
}

.feedback-text.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback-text.failure {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.next-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s, transform 0.2s;
    z-index: 10;
}

.next-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.arrow-icon {
    font-size: 1.2em;
}

.quiz-container > .next-btn {
    position: absolute !important; 
    bottom: 30px !important; 
    right: 30px !important;  
    margin: 0 !important; 
    align-self: unset !important;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .response-section,
    .explanation-section {
        flex: auto;
    }

    .next-btn {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-top: 20px !important;
        align-self: flex-end !important;
    }

    .quiz-container {
        padding: 20px;
        min-height: auto;
    }
}