 /* Custom CSS for layout and styling */
 body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header-top {
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff !important;
    cursor: pointer;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* @media (min-width: 768px) {
    .main-content-wrapper {
        flex-direction: row;
    }
}

.sidebar {
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 1rem;
    min-width: 250px;
    max-width: 250px;
    display: none;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
} */

/* The sidebar now needs to have a specific width */
.sidebar {
    min-width: 250px;
    max-width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 1rem;
    display: none;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* New CSS to contain the sidebar and content */
@media (min-width: 768px) {
    .main-content-wrapper {
        display: flex; /* Re-apply flex to align sidebar and content on desktop */
        flex-direction: row;
    }
}

.sidebar.show {
    display: block;
}

.sidebar-heading {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #343a40;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sidebar-heading:hover {
    color: #007bff;
}

.sidebar-heading.active {
    color: #007bff;
}

.sidebar-nav .nav-link {
    padding: 0.75rem 1rem;
    color: #495057;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: #e2e6ea;
    color: #0056b3;
}

.sidebar-nav .nav-link.active {
    background-color: #007bff;
    color: #fff;
}

.sidebar-nav .group-title-link {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 600;
    padding-left: 0.5rem;
    background-color: #e9ecef;
    cursor: pointer;
}

.content-area {
    padding: 1.5rem;
    flex-grow: 1;
}

.footer {
    background-color: #343a40;
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
}

.footer a {
    color: #adb5bd;
    text-decoration: none;
    margin: 0 0.75rem;
    cursor: pointer;
}

.footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.rounded-corners {
    border-radius: 0.75rem !important;
}

.btn-outline-primary {
    border-radius: 0.5rem;
}

.form-control {
    border-radius: 0.5rem;
}

.search-result-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.search-result-item h5 {
    margin-bottom: 0.5rem;
    color: #007bff;
}

.search-result-item p {
    font-size: 0.9rem;
    color: #495057;
}

/* Style for highlighted search terms */
.highlight {
    background-color: #fff3cd;
    font-weight: bold;
}

/* Custom styles for messages */
.message-box {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0.5rem;
    display: none;
}

.message-box.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* NEW CSS for collapsible sidebar */
.sidebar-nav .collapse {
    margin-left: 1rem;
}

.sidebar-nav .group-title-link {
    cursor: pointer;
}

/* NEW CSS for dropdown menu */
/* Fix 1: Ensure the entire dropdown menu has the desired background */
.dropdown-menu {
    background-color:#f8f9fa !important; /* Use !important to ensure Bootstrap's white background is overridden */
    border: 1px solid #e9ecef; /* Optional: adds a subtle border for separation */
}

.dropdown-menu .dropdown-header {
    font-weight: bold;
    color: #495057; /* A slightly darker gray for the header text */
    text-decoration: none;
    /* Remove any background color from here to let it inherit the menu background */
}

/* Fix 2: Increase specificity for hover and focus to ensure highlighting works */
/* We target the .dropdown-menu container to make the selector more specific */
.dropdown-menu .dropdown-header:hover,
.dropdown-menu .dropdown-header:focus {
    background-color: #007bff; /* Highlighter color */
    color: #fff; /* Text color on hover/focus */
}

/* Optional: Ensure the active (clicked/selected) state also uses your highlight color */
.dropdown-menu .dropdown-header.active {
    background-color: #007bff;
    color: #fff;
}




.dropdown-menu .dropdown-item {
    font-size: 0.9rem;
    white-space: normal;
}

/* .dropdown-menu .dropdown-item:hover {
    background-color: #007bff; The new highlighter color 
    color: #fff; Changes the text color to white for contrast 
} */

/* Fix 2: Increase specificity for hover and focus to ensure highlighting works */
/* We target the .dropdown-menu container to make the selector more specific */
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: #007bff; /* Highlighter color */
    color: #fff; /* Text color on hover/focus */
}



/* You may also want to style the active state 
.dropdown-menu .dropdown-item:active {
    background-color: #007bff;
    color: #fff;
}*/

/* Optional: Ensure the active (clicked/selected) state also uses your highlight color */
.dropdown-menu .dropdown-item.active {
    background-color: #007bff;
    color: #fff;
}


/* Style for submenu items in the dropdown */
.dropdown-menu .dropdown-item {
    padding-left: 2rem; /* Indents the text */
}

/* NEW CSS to fix dropdown active state */
.navbar-nav .dropdown.active .dropdown-toggle {
    color: var(--bs-navbar-active-color);
}


/* Highlight for dropdown items on hover */
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #007bff;
    color: #fff;
}

/* Highlight for active links in the sidebar */
.sidebar .nav-link.active {
    background-color: #007bff;
    color: #fff;
}



/* Add this new CSS to your stylesheet or <style> block */
#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    font-size: 24px;
    border: none;
    outline: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    opacity: 0.8;
    transition: background-color 0.3s, opacity 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#scrollToTopBtn:hover {
    background-color: #0056b3;
    opacity: 1;
}


/* 1. Main Navigation Menu Items (Navbar) */
/* Targets ALL nav-links (including dropdowns and regular links) */
.navbar-nav .nav-item .nav-link:hover,
.navbar-nav .nav-item .nav-link:focus {
    /* Background color when hovering over the link */
    background-color: #007bff; 
    /* Text color change for better contrast */
    color: #fff !important; 
    border-radius: 0.25rem;
}

/* Ensure the *truly* active link, set by JS, uses the same style */
.navbar-nav .nav-item.active .nav-link,
.navbar-nav .nav-item.active .nav-link:hover,
.navbar-nav .nav-item.active .nav-link:focus {
    background-color: #007bff;
    color: #fff !important;
    border-radius: 0.25rem;
}

/* Optional: If dropdown toggles show an arrow, ensure it stays visible/white on hover */
.navbar-nav .nav-item .nav-link.dropdown-toggle::after {
    filter: invert(100%) brightness(200%); /* Helps make the arrow white */
}

/* 2. Utility Links (Header Top) */
/* Targets all links in the header-top utility area, including Downloads, Contact, Login, Help */
.header-top .utility-link:hover,
.header-top .utility-link:focus {
    /* Background color when hovering */
    background-color: #007bff;
    /* Text/Icon color change */
    color: #fff !important; 
    /* Optional: Padding and border-radius match the main menu */
    padding: 0.25rem 0.5rem; /* Re-apply padding since it was overridden */
    border-radius: 0.25rem;
}

/* Restore the text color of the icon and text inside the link to default when not hovered,
   then apply hover/focus effects */
.header-top .utility-link {
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

/* Fixes the invisibility of the dropdown caret in the main navigation */
.navbar-nav .nav-link.dropdown-toggle::after {
    /* Set the caret color to Bootstrap's standard dark text color or primary color */
    color: var(--bs-body-color, #212529); /* Ensures the caret is dark grey */
    
    /* Ensure the caret is not being filtered to be white/invisible when inactive */
    filter: none;
    
    /* Ensure opacity is 1 (fully visible) */
    opacity: 1;
}

/* Optional: Ensure the caret remains white/visible when the link is hovered or active */
.navbar-nav .nav-item .nav-link:hover.dropdown-toggle::after,
.navbar-nav .nav-item.active .nav-link.dropdown-toggle::after {
    /* Inverts the color to white when the background is the primary blue (#007bff) */
    filter: invert(100%) brightness(200%); 
}