/* ---------- Réinitialisation de base et typographie ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Open Sans", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* ---------- Conteneur principal ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.containerPrincipal {
    display: flex;
    gap: 20px;
}

/* ---------- En-tête ---------- */
header {
    background-color: #ffffff;
    color: #271a38;
    padding-right: 20px;
    border-bottom: solid 1px #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header .logo {
    font-size: 1.8em;
    font-weight: bold;
}

header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: #d1c4e9;
}

.navbar {
    background-color: #7451eb;
    padding: 0px;
}

/* ---------- Zone principale ---------- */
main {
    background-color: #fff;
    padding: 40px;
    margin: 20px 0;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.next-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff;
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    transition: background-color 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.next-button:hover {
    background-color: #0056b3;
    color: #fff;
}
.solution {
    display: none;
}

/* ---------- Titres et paragraphes ---------- */
h1, h2, h3, h4, h5, h6 {
    color: #271a38;
    margin: 1em 0 0.5em;
    line-height: 1.2;
}

h1 {
    font-size: 0em;
}

p {
    margin-bottom: 1em;
    text-align: justify;
}

/* ---------- Blocs de contenu spécifiques ---------- */
.definition,
.proposition,
.exemple,
.remarque,
.preuve {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    background-color: #f1f3f5;
    border-left: 4px solid;
}

.definition {
    border-color: #3498db;
}

.proposition {
    border-color: #8e44ad;
}

.exemple {
    border-color: #27ae60;
}

.remarque {
    border-color: #f39c12;
}

.preuve {
    border-color: #e74c3c;
}

pre {
    white-space: pre-wrap; /* Permet le retour à la ligne */
    word-wrap: break-word;  /* Coupe les mots trop longs si nécessaire */
    overflow-x: hidden;     /* Évite le défilement horizontal */
    max-width: 100%; 
}


/* ---------- Réinitialisation et layout de base ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    }

    /* ---------- Sidebar ---------- */
    #sidebar {
    width: 250px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
    transition: width 0.3s;
    }
    /* Lorsque le menu est réduit */
    #sidebar.collapsed {
    width: 10px;
    overflow: hidden;
    border-right: hidden;
    }
    #sidebar.collapsed ul {
        display: none;
    }
    #sidebar.collapsed li {
        display: none;
    }

    /* Bouton pour réduire/étendre la sidebar */
    #sidebar .toggle-btn {
    border: none;
    background-color: white;
    cursor: pointer;
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #7451eb;
    }
    /* Liste du menu */
    #sidebar ul {
    list-style: none;
    padding: 0;
    }
    #sidebar li {
    margin-bottom: 10px;
    cursor: pointer;
    }
    #sidebar a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 8px 10px;
    border-radius: 3px;
    transition: background-color 0.3s;
    }
    #sidebar a:hover {
    background-color: #e0e0e0;
    }
    /* Pour les items qui ont des sous-menus */
    .expandable > span {
    display: block;
    position: relative;
    padding-right: 20px;
    }
    .expandable > span::after {
    content: "\25B6"; /* flèche vers la droite */
    position: absolute;
    right: 0;
    transition: transform 0.3s;
    }
    /* Quand l'item est étendu, on tourne la flèche */
    .expandable.active > span::after {
    transform: rotate(90deg);
    }
    /* Sous-menu */
    .nested {
    list-style: none;
    padding-left: 15px;
    margin-top: 5px;
    display: none;
    }
    .expandable.active .nested {
    display: block;
    }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    /* Sidebar en colonne fixe */
    #sidebar {
      width: 250px;
      min-height: 100vh;
      transform: translateX(0);
    }
    /* Affichage du bouton toggle caché sur desktop */
    .toggle-btn {
      display: none;
    }
    /* Le contenu principal prend le reste de l'espace */
    main.container {
      flex: 1;
      padding: 20px;
    }
  }
  
  /* Layout pour les écrans petits (mobile) */
  @media (max-width: 767px) {
    /* Le containerPrincipal passe en mode bloc */
    .containerPrincipal {
      display: block;
    }
    /* Sidebar en position fixe hors écran par défaut */
    #sidebar {
      position: fixed;
      width: 200px;
      height: 100%;
      top: 0;
      left: -200px;
      z-index: 1000;
    }
    /* Affichage du bouton toggle */
    .toggle-btn {
      display: block;
      position: fixed;
      top: 15px;
      left: 15px;
      z-index: 1100;
    }
    /* Lorsque la sidebar est "active", elle se déplace dans l'écran */
    #sidebar.collapsed {
      transform: translateX(200px);
    }
    /* Pour le contenu principal, on ajoute un padding afin de laisser de l’espace pour le bouton */
    main.container {
      padding: 20px;
      margin-top: 60px;
    }
  }