

/* === css/navbar.css === */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

body {
    padding-top: 60px;
}

.main-navbar {
    background: linear-gradient(to right, #2c3e50, #3498db);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    min-height: 60px;
    height: auto;
    display: flex;
    align-items: center;
    padding: 5px 25px;
    box-sizing: border-box;
    justify-content: flex-start;
    margin: 0;
}

.navbar-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-size: 1.3em;
    font-weight: 600;
    white-space: nowrap;
}

.navbar-brand a:hover {
    color: #ecf0f1;
}

.navbar-brand .navbar-logo {
    height: 40px;
    width: auto;
    margin-right: 12px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    order: 3; 
    margin-left: auto;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-links-container {
    height: 100%;
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

ul.navbar-links {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: auto;
    flex-wrap: wrap;
    justify-content: center;
}

ul.navbar-links > li {
    position: relative;
    height: 50px;
}

ul.navbar-links > li > a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 15px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.95em;
    white-space: nowrap;
    transition: background-color 0.2s ease-in-out;
    border-radius: 4px;
}

ul.navbar-links > li > a:hover,
ul.navbar-links > li > a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

ul.navbar-links > li > a i.fas {
    margin-right: 8px;
}

.dropbtn .fa-chevron-down {
    font-size: 0.7em;
    margin-left: 8px;
    transition: transform 0.2s;
}

.dropdown.is-open > a.dropbtn .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 240px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1051;
    list-style: none;
    padding: 8px 0;
    margin-top: 0;
    border-radius: 0 0 5px 5px;
    border: 1px solid #e7e7e7;
    border-top: none;
    left: 0;
}

.dropdown.is-open > .dropdown-content,
.sub-dropdown-trigger.is-open > .sub-dropdown-content {
    display: block;
}

.sub-dropdown-trigger {
    position: relative;
}

.sub-dropdown-content {
    display: none;
    position: absolute;
    left: 100%;
    top: -1px;
    background-color: #ffffff;
    min-width: 240px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1052;
    list-style: none;
    padding: 8px 0;
    margin-left: 0;
    border-radius: 5px;
    border: 1px solid #e7e7e7;
}

.dropdown-content a {
    padding: 10px 20px;
    text-decoration: none; 
    display: block;
    white-space: nowrap; 
    color: #34495e; 
    font-size: 0.9em;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-content a:hover {
    background-color: #f8f9fa; 
    color: #2980b9;
}

.sub-dropdown-trigger > a.sub-dropbtn {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.sub-dropdown-trigger > a.sub-dropbtn .fa-chevron-right {
    font-size: 0.7em;
    margin-left: 15px;
    color: #bdc3c7;
}

@media (min-width: 481px) and (max-width: 1400px) {
    .main-navbar {
        width:100%;
    }
}

@media (max-width: 992px) {
    .main-navbar {
        justify-content: space-between;
        width: 100%;
        min-height: 60px;
        height: 60px;
        padding: 0 10px;
        flex-wrap: wrap;
        margin: 0;
        left: 0;
        right: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }
    
    .navbar-links-container {
        /* MODIFIED: Changed from absolute position to be part of the normal flow */
        position: relative;
        width: 100%;
        order: 4; /* Ensures it appears below the brand and toggle button */
        height: auto;
    }
    
    ul.navbar-links {
        flex-direction: column;
        width: 100%;
        height: auto;
        padding: 0;
        margin: 0;
        flex-wrap: nowrap;
        display: flex;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.4s ease-in-out;
        /* This gives the menu its own solid background */
        background: linear-gradient(to right, #2c3e50, #3498db);
        box-shadow: inset 0 3px 5px rgba(0,0,0,0.2);
    }
    
    ul.navbar-links.mobile-open {
        max-height: calc(100vh - 20px);
        padding-top: 10px;
        padding-bottom: 30px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    ul.navbar-links.mobile-open > li:first-child {
        margin-top: 30px;
    }
    
    ul.navbar-links > li {
        width: 100%;
        height: auto;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    ul.navbar-links > li:last-child {
        border-bottom: none;
    }
    
    ul.navbar-links > li > a {
        width: 100%;
        height: auto;
        padding: 15px 25px;
        justify-content: flex-start;
        border-radius: 0;
    }
    
    ul.navbar-links > li > a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-content {
        position: static;
        display: none;
        background-color: rgba(0,0,0,0.1);
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
    }
    
    .dropdown.is-open > .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        color: #ecf0f1;
        padding: 12px 45px;
        font-size: 0.9em;
    }
    
    .dropdown-content a:hover {
        background-color: rgba(255,255,255,0.1);
        color: #ffffff;
    }
    
    .sub-dropdown-content {
        position: static;
        margin-left: 20px;
        background-color: rgba(0,0,0,0.15);
    }
    
    .sub-dropdown-content a {
        padding: 10px 65px;
    }
}

@media (max-width: 480px) {
    * {
        box-sizing: border-box;
    }
    
    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        overflow-x: hidden;
    }

    .main-navbar {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 10px !important;
        margin: 0 !important;
        left: 0 !important;
        right: 0 !important;
        box-sizing: border-box !important;
    }

    .navbar-brand {
        padding-left: 0;
    }

    .navbar-brand a {
        font-size: 1.1em;
    }

    .navbar-brand .navbar-logo {
        height: 35px;
        margin-right: 8px;
    }

    .mobile-menu-toggle {
        padding-right: 0;
    }
}