.form-nav-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: sticky;
    top: 40px; /* Ensure it stays below the header */
    height: 50px; /* Set a fixed height */
    background-color: var(--element_contrast);
    padding: 8px 0; /* Adjust padding */
    box-shadow: 0 2px 5px var(--element_shadow_dark);
    z-index: 149; /* Ensure it is above content */
    display: none; /* Hide by default on large screens */
}

.form-nav-vertical {
    position: fixed;
    width: 220px; /* Restore the width */
    height: 100vh; /* Adjust height to fill the screen */
    padding: 15px;
    overflow-y: auto; /* Enable scrolling if necessary */
    z-index: 99; /* Keep it behind the horizontal menu */
    display: block; /* Show by default on large screens */
    /*border-right: 1px solid var(--element_border);*/
    background-color: var(--element_contrast);
    box-shadow: 0 4px 8px var(--element_shadow_dark);
}

.side-nav {}

.side-nav a {
    border-radius: 10px;
    padding: var(--small-padding);
    text-decoration: none;
    font-size: .9em;
    color: var(--Default_Text);
    display: inline-block; /* Affiche les liens à l'horizontale */
    margin: 0 5px; /* Ajoute un espace entre chaque lien */
    white-space: nowrap;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.side-nav a:hover,
.side-nav a.active {
    background-color: #ddd;
    box-shadow: 0 2px 10px #ddd;
}

/* Floating Vertical Sidebar */
.side-nav-vertical {
    position: fixed;
    top: 50%; /* Centers it vertically */
    transform: translateY(-50%); /* Adjusts for true center */
    left: 20px; /* Moves it into the blank space */
    width: 220px; /* Adjust width if needed */
    max-height: 80vh; /* Prevents it from getting too tall */
    overflow-y: auto; /* Enables scrolling if needed */
}

/* Sidebar Title */
.side-nav-vertical h3 {
    font-size: 1em;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

/* Sidebar Sections */
.nav-section {
    margin-bottom: 10px;
}

/* Sidebar Links */
.side-nav-vertical a {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 6px 10px;
    border-radius: 5px;
    transition: background 0.3s ease, color 0.3s ease;
    margin-bottom: 3px;
    font-size: 0.95em;
}

/* Hover & Active State */
.side-nav-vertical a:hover,
/* Keep existing active state for main sections */
/* Active section in the sidebar */
.side-nav-vertical a.active,
.side-nav a.active {
    background-color: #bbb; /* Darker background when active */
    color: #fff;
    font-weight: bold;
}

/* Apply the same active background to H2 (sub-menu) links */
.sub-menu a.active {
    background-color: #bbb; /* Darker to differentiate H2s */
    color: #fff;
    font-weight: bold;
    padding-left: 15px; /* Indent H2s slightly */
}


/* Sub-menu for H2 items */
.sub-menu {
    list-style: none;
    padding-left: 10px;
    margin: 5px 0 10px;
    margin-top: 2px;
}

.sub-menu li {
    margin-bottom: 5px;
}

/* Style for H2 links */
.sub-menu a {
    font-size: 0.75em;
    color: #666;
    padding: 5px 8px;
    display: block;
    border-radius: 3px;
    transition: background 0.3s ease;
    margin-bottom: 2px;
}

/* Hover & Active State for H2 links */
.sub-menu a:hover,
.sub-menu a.active {
    background-color: #e0e0e0;
    color: #000;
}


/* Responsive Behavior */
@media (max-width: 1200px) {
    .form-nav-horizontal {
        display: flex; /* Show horizontal navigation on small screens */
    }

    
    
    .form-nav-vertical {
        display: none; /* Hide vertical navigation on small screens */
    }
    
    .side-nav-vertical {
        position: absolute;
        width: 100%;
        left: 0;
        top: auto;
        bottom: 0;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .side-nav-vertical a {
        flex: 1;
        text-align: center;
    }
}
