/* --- Réinitialisation & Styles de Base --- */
* {
    box-sizing: border-box; /* Inclut padding et border dans la largeur/hauteur totale */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Police système commune */
    line-height: 1.6; /* Espacement interligne confortable */
    margin: 0;
    padding: 0;
    background-color: #f0f4f8; /* Fond global légèrement bleuté/gris */
    color: #333; /* Couleur de texte par défaut */
}

/* --- Header --- */
header {
    background-color: #0056b3; /* Bleu institutionnel */
    color: white;
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
}

/* --- Contenu Principal --- */
main {
    max-width: 900px; /* **Limite la largeur du contenu principal** */
    margin: 30px auto; /* Centre le contenu avec marge haut/bas */
    padding: 25px 30px; /* Padding interne */
    background-color: #ffffff; /* Fond blanc pour le contenu */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Ombre portée plus marquée */
    border-radius: 8px;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    font-size: 0.9em;
    color: #555;
    border-top: 1px solid #ddd;
    background-color: #e9ecef; /* Fond légèrement gris pour le footer */
}

/* --- Styles Communs aux Modules --- */
.hidden {
    display: none;
}

button {
    display: inline-block; /* Permet margin auto si besoin */
    padding: 10px 20px;
    font-size: 1em;
    background-color: #007bff; /* Bleu primaire */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

button:hover {
    background-color: #0056b3; /* Bleu plus foncé au survol */
    transform: translateY(-1px); /* Léger effet de soulèvement */
}

button:disabled {
    background-color: #b0c4de; /* Bleu grisé pour désactivé */
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    font-weight: 500; /* Un peu moins gras */
    border: 1px solid transparent; /* Pour maintenir la mise en page */
}

.feedback.correct {
    background-color: #d1e7dd; /* Vert plus doux */
    color: #0f5132;
    border-color: #badbcc;
}

.feedback.incorrect {
    background-color: #f8d7da; /* Rouge clair */
    color: #842029;
    border-color: #f5c2c7;
}

/* ../css/module1.css */

/* Styles existants... */

/* Styles pour le conteneur des boutons de l'exercice 1 */
.ex1-button-row {
    margin-top: 15px; /* Espace au-dessus des boutons */
    margin-bottom: 10px; /* Espace en dessous des boutons, avant le feedback */
    display: flex; /* Active Flexbox */
    gap: 10px; /* Espace entre les boutons */
    align-items: center; /* Alignement vertical (utile si les boutons ont des hauteurs différentes) */
}

/* Styles pour le conteneur des boutons de l'exercice 1 (existant) */
.ex1-button-row {
    margin-top: 15px;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Styles pour le conteneur des boutons de l'exercice 2 (NOUVEAU) */
.ex2-button-row {
    margin-top: 15px; /* Espace au-dessus des boutons */
    margin-bottom: 10px; /* Espace en dessous des boutons, avant le feedback */
    display: flex; /* Active Flexbox */
    gap: 10px; /* Espace entre les boutons */
    align-items: center; /* Alignement vertical */
}

/* Styles optionnels pour les boutons dans ces rangées, si besoin (existant) */
.ex1-button-row button,
.ex2-button-row button { /* Ajout de .ex2-button-row ici */
    padding: 8px 15px;
}

/* Styles optionnels pour les boutons dans cette rangée, si besoin */
.ex1-button-row button {
    padding: 8px 15px; /* Exemple de padding */
    /* Ajoutez d'autres styles si vous le souhaitez */
}

/* Styles pour le feedback (ajustés ou existants) */
.feedback {
    margin-top: 10px; /* S'assure qu'il y a de l'espace si le feedback est sous la rangée de boutons */
    padding: 10px;
    border-radius: 5px;
    /* border: 1px solid #ccc; retirez ou ajustez si vous avez des bordures spécifiques pour correct/incorrect */
}

.feedback.correct {
    background-color: #e6ffed; /* Vert clair */
    border: 1px solid #5cb85c; /* Vert */
    color: #3c763d; /* Texte vert foncé */
}

.feedback.incorrect {
    background-color: #f2dede; /* Rouge clair */
    border: 1px solid #ebccd1; /* Rouge */
    color: #a94442; /* Texte rouge foncé */
}

.hidden {
    display: none !important; /* Pour s'assurer que l'élément est bien caché */
}

/* ... autres styles ... */

/* --- Section Introduction Spécifique Module --- */
#introduction {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}
#introduction h2 {
     color: #0056b3; /* Titre en bleu */
     margin-bottom: 15px;
}
#introduction p {
    color: #444; /* Texte un peu plus foncé */
    margin-bottom: 15px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%; /* S'adapte à la largeur limitée du main */
    background: #000;
    margin: 25px auto; /* Marge verticale et centrage horizontal */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0; /* Supprime la bordure par défaut */
}

#start-exercises {
    font-size: 1.1em;
    padding: 12px 25px;
    background-color: #28a745; /* Vert pour démarrer */
}
#start-exercises:hover {
     background-color: #218838; /* Vert plus foncé */
}

/* --- Section Exercice Spécifique Module --- */
.exercise-section {
    background-color: #f8f9fa; /* Fond légèrement gris pour section exo */
    border: 1px solid #dee2e6; /* Bordure discrète */
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
}

.exercise-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #495057; /* Titre d'exercice en gris foncé */
    font-size: 1.4em;
    border-bottom: 2px solid #007bff; /* Soulignement bleu */
    padding-bottom: 5px;
}
.exercise-section p {
    margin-bottom: 15px;
}

/* --- Styles Exercice 1 (QCM) --- */
#qcm-form-1 label,
#true-false-form label { /* Style commun pour les labels radio/checkbox */
    display: block; /* Un par ligne */
    margin-bottom: 12px;
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#qcm-form-1 label:hover,
#true-false-form label:hover {
    background-color: #e9ecef; /* Léger gris au survol */
}
#qcm-form-1 input[type="radio"],
#true-false-form input[type="radio"] {
    margin-right: 8px;
    vertical-align: middle;
}

/* --- Styles Exercice 2 (Associer - Drag & Drop) --- */
#matching-container {
    display: flex;
    gap: 25px; /* Espace entre les colonnes */
    flex-wrap: wrap; /* Passe en colonne sur petit écran */
}

.match-list {
    border: 1px dashed #adb5bd; /* Bordure tiret plus visible */
    padding: 20px;
    min-height: 200px;
    flex-basis: 300px; /* Largeur de base */
    flex-grow: 1;
    background-color: #f1f3f5; /* Fond gris clair */
    border-radius: 5px;
}
.match-list p:first-child {
    margin-top: 0;
    font-weight: 600; /* Semi-gras */
    text-align: center;
    color: #495057;
    margin-bottom: 20px;
}

.match-columns {
    display: flex;
    flex-grow: 2; /* Prend plus de place que la liste source */
    gap: 20px;
}

.dropzone {
    border: 2px dashed #007bff; /* Bordure bleue pour zone de dépôt */
    padding: 20px;
    min-height: 200px;
    flex: 1; /* Partage équitablement l'espace */
    background-color: #e9f7ff; /* Fond bleu très pâle */
    border-radius: 5px;
    transition: background-color 0.2s, border-color 0.2s;
}
.dropzone p:first-child {
    margin-top: 0;
    font-weight: 600;
    text-align: center;
    color: #0056b3;
    margin-bottom: 20px;
}

.dropzone.over {
    background-color: #cfe2ff; /* Bleu plus soutenu au survol */
    border-color: #0056b3;
}

.draggable {
    background-color: #ffffff;
    padding: 10px 12px; /* Plus d'espace interne */
    border: 1px solid #ced4da;
    margin-bottom: 10px;
    cursor: grab;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
.draggable:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.draggable:active {
    cursor: grabbing;
}
.draggable.dragging {
    opacity: 0.6;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* --- Styles Exercice 3 (Vrai/Faux) --- */
.tf-statement {
    margin-bottom: 15px;
    padding: 15px;
    border-left: 4px solid #17a2b8; /* Cyan pour V/F */
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0; /* Arrondi seulement à droite */
}
.tf-statement p {
    margin-bottom: 10px;
    font-weight: 500;
}
.tf-statement label {
    margin-right: 20px;
    padding: 5px 0; /* Réduire padding vertical pour V/F */
    background-color: transparent; /* Pas de fond spécifique */
    border: none;
}
.tf-statement label:hover {
     background-color: transparent;
     color: #0056b3; /* Change couleur texte au survol */
}

/* --- Styles Leçon --- */
#micro-cours {
    background-color: #fdfdfe; /* Fond presque blanc */
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 25px;
    color: #333;
}
#micro-cours h2 {
     margin-top: 0;
     margin-bottom: 20px;
     color: #004085; /* Bleu foncé pour titre leçon */
     font-size: 1.5em;
     border-bottom: 2px solid #b8daff;
     padding-bottom: 8px;
}
#micro-cours strong {
    color: #0056b3; /* Mots clés en bleu */
}
#micro-cours ul {
    margin-left: 20px;
    list-style: disc; /* Puces standard */
    margin-bottom: 15px;
}
#micro-cours li {
    margin-bottom: 8px;
}

/* --- Styles Résultats Module --- */
#module-results {
    background-color: #d1ecf1; /* Cyan clair */
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 20px;
    margin-top: 30px;
    border-radius: 5px;
    text-align: center;
}
#module-results p {
    font-size: 1.15em;
    margin-bottom: 15px;
    font-weight: 500;
}
#module-results span {
    font-weight: bold;
}
#show-lesson-btn {
    background-color: #ffc107; /* Jaune pour voir leçon */
    color: #333;
}
#show-lesson-btn:hover {
    background-color: #e0a800;
}

/* --- Styles Navigation Module --- */
.module-nav {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.module-nav a {
    display: inline-block;
    padding: 10px 25px;
    background-color: #6c757d; /* Gris secondaire */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
    margin: 0 10px;
}
.module-nav a:hover {
    background-color: #5a6268; /* Gris plus foncé */
}

/* --- Responsivité --- */
@media (max-width: 960px) {
    main {
        max-width: 95%; /* Prend plus de largeur sur tablettes */
        padding: 20px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5em;
    }
    main {
        padding: 15px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    button {
        padding: 8px 15px;
        font-size: 0.95em;
    }
    .exercise-section h2 {
        font-size: 1.3em;
    }
    #micro-cours h2 {
        font-size: 1.3em;
    }

    /* Adaptation Drag & Drop */
    #matching-container {
        flex-direction: column;
        gap: 15px;
    }
    .match-list, .match-columns {
        flex-basis: auto;
        width: 100%;
    }
    .match-columns {
       flex-direction: column;
       gap: 15px;
    }
    .dropzone, .match-list {
        min-height: 150px; /* Réduire hauteur min */
        padding: 15px;
    }
    .draggable {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3em;
    }
    main {
        padding: 10px;
        border-radius: 0; /* Pleine largeur sur très petit écran */
    }
    .exercise-section {
        padding: 15px;
    }
     #micro-cours {
        padding: 15px;
    }
    #module-results {
        padding: 15px;
    }
     #module-results p {
        font-size: 1em;
     }
    .module-nav a {
        padding: 8px 15px;
        font-size: 0.9em;
        margin-bottom: 10px; /* Empiler si besoin */
    }
}