/* --- Réinitialisation & Styles de Base --- */
* {
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f0f4f8;
    color: #333;
}
/* --- Header --- */
header {
    background-color: #0056b3;
    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;
}
header h2 {
    margin: 5px 0 0 0;
    font-size: 1.1em;
    font-weight: 400;
    color: #e0e0e0;
}
/* --- Contenu Principal --- */
main {
    max-width: 900px;
    margin: 30px auto;
    padding: 25px 30px;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    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;
}
/* --- Styles Communs aux Modules --- */
.hidden {
    display: none;
}
button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    background-color: #007bff;
    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;
    transform: translateY(-1px);
}
button:disabled {
    background-color: #b0c4de;
    color: #666;
    cursor: not-allowed;
    transform: none;
}
.feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    font-weight: 500;
    border: 1px solid transparent;
}
.feedback.correct {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}
.feedback.incorrect {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}
.emoji-correct { color: green; margin-right: 5px; font-size: 1.1em; vertical-align: middle; }
.emoji-incorrect { color: red; margin-right: 5px; font-size: 1.1em; vertical-align: middle; }

/* --- Section Introduction Spécifique Module --- */
#introduction {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}
#introduction h2 {
     color: #0056b3;
     margin-bottom: 15px;
     text-align: center;
}
#introduction p {
    color: #444;
    margin-bottom: 20px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
/* Styles Image unique Intro Module */
.intro-image-single {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
    text-align: center;
    margin: 25px auto;
    max-width: 500px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.intro-image-single img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0 auto 15px auto;
    border: 1px solid #eee;
}
.intro-image-single figcaption {
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
}

#start-exercises {
    font-size: 1.1em;
    padding: 12px 25px;
    background-color: #28a745;
    margin-top: 15px;
}
#start-exercises:hover {
     background-color: #218838;
}

/* --- Section Exercice Spécifique Module --- */
.exercise-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
}
.exercise-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.4em;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}
.exercise-section p {
    margin-bottom: 15px;
}

/* --- Styles Exercice QCM (Module 1 et 3) --- */
#qcm-form-1 label,
#true-false-form label {
    display: block;
    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;
}
#qcm-form-1 input[type="radio"],
#qcm-form-1 input[type="checkbox"], /* Ajout checkbox pour ex1 mod 2 */
#true-false-form input[type="radio"] {
    margin-right: 8px;
    vertical-align: middle;
}

/* --- Styles Exercice 2 (Tableau Cycle de vie - Module 3) --- */
.criteria-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95em; /* Réduire un peu la taille pour la densité */
}
.criteria-table th, .criteria-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    vertical-align: middle;
}
.criteria-table thead {
    background-color: #e9ecef;
    font-weight: bold;
    color: #495057;
}
.criteria-table tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}
.criteria-table input[type="radio"],
.criteria-table input[type="checkbox"] {
     margin-right: 5px;
     vertical-align: middle;
     cursor: pointer;
}
.criteria-table label {
     cursor: pointer;
     display: inline-block; /* Aligner avec checkbox */
     margin-right: 10px;
     margin-bottom: 0; /* Annuler marge label QCM */
     padding: 0; /* Annuler padding label QCM */
     border: none; /* Annuler border label QCM */
     background-color: transparent; /* Annuler fond label QCM */
}
 .criteria-table label:hover {
     background-color: transparent; /* Annuler hover label QCM */
     color: #0056b3;
}

/* --- Styles Exercice 3 (Ordonnancement - Module 3) --- */
#ranking-container {
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f1f3f5; /* Fond légèrement différent */
}
 #ranking-list {
     list-style: none;
     padding: 0;
     margin: 0;
 }
  #ranking-list li {
      background-color: white;
      border: 1px solid #ddd;
      padding: 12px 15px; /* Plus de padding */
      margin-bottom: 8px;
      border-radius: 4px;
      cursor: grab;
      display: flex;
      align-items: center;
      justify-content: space-between; /* Espace entre poignée/texte */
      box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  }
   #ranking-list li .rank-handle { /* Poignée pour glisser */
       font-weight: bold;
       margin-right: 15px;
       color: #aaa;
       cursor: grab;
       font-size: 1.2em; /* Plus visible */
   }
   #ranking-list li .rank-text { /* Pour le texte */
        flex-grow: 1; /* Prend l'espace restant */
   }
    #ranking-list li.dragging { /* Style pendant le drag */
       opacity: 0.5;
       background-color: #e9ecef;
       box-shadow: 0 4px 8px rgba(0,0,0,0.1);
   }


/* --- Styles Leçon --- */
#micro-cours {
    background-color: #fdfdfe;
    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;
     font-size: 1.5em;
     border-bottom: 2px solid #b8daff;
     padding-bottom: 8px;
}
#micro-cours strong {
    color: #0056b3;
}
#micro-cours ul {
    margin-left: 20px;
    list-style: disc;
    margin-bottom: 15px;
}
#micro-cours ul ul {
     list-style: circle;
     margin-top: 5px;
     margin-bottom: 10px;
}
#micro-cours li {
    margin-bottom: 8px;
}

/* --- Styles Résultats Module --- */
#module-results {
    background-color: #d1ecf1;
    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;
    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;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
    margin: 5px 10px;
}
.module-nav a:hover {
    background-color: #5a6268;
}

/* --- STYLES SPÉCIFIQUES PAGE D'ACCUEIL (index.html) --- */
#index-main { text-align: center; }
#intro-text { margin-bottom: 30px; font-size: 1.1em; color: #444; max-width: 750px; margin-left: auto; margin-right: auto; }
#intro-video-container { max-width: 700px; margin: 30px auto; padding: 15px; background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; box-shadow: 0 3px 6px rgba(0,0,0,0.1); }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; background: #000; border-radius: 4px; margin-bottom: 15px; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
#intro-video-container figcaption { font-size: 0.95em; color: #555; line-height: 1.5; text-align: center; }
#index-main h2 { color: #0056b3; margin-top: 40px; margin-bottom: 25px; }
#module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; padding: 0 10px; text-align: left; }
.module-card { background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 20px; text-decoration: none; color: inherit; transition: transform 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column; }
.module-card:hover { transform: translateY(-5px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); }
.module-card h3 { margin-top: 0; margin-bottom: 10px; color: #0056b3; font-size: 1.2em; }
.module-card p { font-size: 0.95em; color: #555; flex-grow: 1; margin-bottom: 15px; }
.module-card .start-module-btn { display: inline-block; padding: 8px 15px; background-color: #007bff; color: white; border-radius: 5px; text-align: center; text-decoration: none; margin-top: auto; align-self: center; transition: background-color 0.2s ease; }
.module-card .start-module-btn:hover { background-color: #0056b3; }
#bilan-link-container { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; text-align: center; }
#bilan-link { display: inline-block; padding: 12px 30px; font-size: 1.1em; background-color: #6c757d; color: white; text-decoration: none; border-radius: 5px; transition: background-color 0.2s ease; }
#bilan-link:hover { background-color: #5a6268; }

/* --- Responsivité --- */
@media (max-width: 960px) {
    main { max-width: 95%; padding: 20px; }
     header h1 { font-size: 1.6em; }
     header h2 { font-size: 1em; }
}
@media (max-width: 768px) {
    header h1 { font-size: 1.5em; }
     header h2 { font-size: 0.95em; }
    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; }
    #matching-container, #matching-comm-container { flex-direction: column; gap: 15px; }
    .match-list, .comm-list, .match-columns { flex-basis: auto; width: 100%; }
    .match-columns, .comm-dropzones { flex-direction: column; gap: 15px; }
    .dropzone, .match-list, .dropzone-comm, .comm-list { min-height: 150px; padding: 15px; }
    .draggable, .draggable-comm { padding: 8px 10px; }
    .image-comparison-container { flex-direction: column; align-items: center; }
    .intro-image { width: 90%; max-width: none; min-width: 0; flex: none; }
    #intro-video-container { max-width: 95%; }
    .intro-image-single { width: 90%; }
     #fill-in-blanks-form input[type="text"] { width: 80px; }
     .criteria-table { font-size: 0.9em; } /* Réduire taille texte tableau */
     .criteria-table th, .criteria-table td { padding: 6px 8px; }
     #ranking-list li { padding: 8px 12px; }
}
@media (max-width: 480px) {
    header h1 { font-size: 1.3em; }
     header h2 { font-size: 0.9em; }
    main { padding: 10px; border-radius: 0; margin-top: 15px; margin-bottom: 15px; }
    .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; display: block; width: 80%; margin-left: auto; margin-right: auto; }
    #module-grid { grid-template-columns: 1fr; gap: 15px; padding: 0 5px; }
    .module-card { padding: 15px; }
    #bilan-link { padding: 10px 20px; font-size: 1em; width: 80%; }
    #intro-text { font-size: 1em; }
    #intro-video-container { max-width: 100%; padding: 10px; }
    .intro-image-single { width: 100%; padding: 10px; }
    .dropzone-comm { min-height: 60px; padding: 10px; }
    .draggable-comm { padding: 8px 10px; }
     #fill-in-blanks-form input[type="text"] { width: 70px; font-size: 0.9em; }
      .criteria-table { font-size: 0.85em; }
      .criteria-table th, .criteria-table td { padding: 5px; }
      #ranking-list li { padding: 6px 10px; }
      #ranking-list li .rank-handle { margin-right: 8px; font-size: 1.1em;}
}