:root {
    --primary-color: #980303;
    --primary-color-light: #b03030;
    --primary-color-dark: #700202;
    --text-on-primary: #ffffff;
}

body {
    font-family: 'Roboto', Arial, sans-serif; /* Utilisation d'une police plus moderne */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #980303;
    color: #FFFFFF;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

header h1 {
    margin: 0 0 1rem 0;
    align-self: flex-start; /* Aligne le titre à gauche */
}

nav ul {
    list-style-type: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin-right: 1rem;
}

nav ul li a {
    color: #FFFFFF;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #fff;
}

.container {
    display: flex;
    flex: 1;
    background-color: #f5f5f5; /* Fond légèrement gris pour le contenu principal */
}

aside {
    background-color: #ffffff;
    padding: 2rem;
    width: 250px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1); /* Ombre légère pour la profondeur */
    z-index: 1; /* Assure que l'ombre apparaît au-dessus du contenu principal */
}

aside h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color-light);
}

aside ul {
    list-style-type: none;
    padding: 0;
}

aside ul li {
    margin-bottom: 0.8rem;
}

aside ul li a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

aside ul li a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem; /* Léger décalage vers la droite au survol */
}

main {
    flex: 1;
    padding: 1rem;
}

main h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color-light);
    padding-bottom: 0.5rem;
}

main a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

main a:hover {
    color: var(--primary-color-light);
}

footer {
    background-color: var(--primary-color-dark);
    color: var(--text-on-primary);
    text-align: center;
    padding: 1rem;
}

.sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--primary-color-light);
}

.sub-menu.active {
    max-height: 500px; /* Ajustez cette valeur selon la hauteur maximale de vos sous-menus */
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

.sub-menu li {
    margin-bottom: 0.5rem;
}

.toggle-sub {
    position: relative;
}

.toggle-sub::after {
    content: '\25BC';
    position: absolute;
    right: 0;
    transition: transform 0.3s ease;
}

.toggle-sub.active::after {
    transform: rotate(-180deg);
}

/* Styles pour la responsivité */

@media screen and (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    aside {
        width: 100%;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    main {
        padding: 1rem;
    }
}

@media screen and (max-width: 768px) {
    header {
        padding: 0.5rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    nav ul li {
        display: block;
        margin: 0.5rem 0;
    }

    aside {
        padding: 1rem;
    }

    .sub-menu {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }
}

@media screen and (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }

    aside h2 {
        font-size: 1rem;
    }

    aside ul li a {
        padding: 0.3rem 0;
    }

    footer {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

.toggle-sidebar {
    display: none;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
}

@media screen and (max-width: 768px) {
    .toggle-sidebar {
        display: block;
    }

    #sidebar {
        display: none;
    }

    #sidebar.active {
        display: block;
    }
}
