#header {
    height: 5.5rem;
    background: #2c3e50;
    box-shadow: 0 3px 20px rgba(0,0,0,0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: all 0.3s ease;
    border-top: none;
}

#header.scrolled {
    height: 4.5rem;
    box-shadow: 0 3px 25px rgba(0,0,0,0.35);
    background: #1e2b38;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    position: relative;
    padding-right: 1.5rem;
}

.navbar-brand img {
    height: 40px;
    transition: height 0.3s ease;
    filter: brightness(0) invert(1);
}

.site-title-container {
    display: flex;
    align-items: center;
    position: static;
    left: auto;
    transform: none;
    padding: 0;
    margin: 0 auto;
    width: auto;
}

.site-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: #ffffff;
    transition: all 0.3s ease;
    text-align: center;
    margin: 0;
    letter-spacing: 0.5px;
    position: relative;
    padding: 0;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

#header.scrolled .site-title {
    font-size: 1.8rem;
}

#header.scrolled .navbar-brand img {
    height: 35px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    justify-content: flex-end;
    position: relative;
}

/* Main Navigation */
.navigation {
    display: flex;
    align-items: center;
    margin-top: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item {
    position: relative;
    margin: 0 0.25rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 4px;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
}

/* Home button styling */
.nav-link[href="/"] {
    font-weight: 600;
    color: #fff;
    background-color: #3498db;
    border-radius: 4px;
    padding: 0.6rem 1.25rem;
    margin-right: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-link[href="/"]:hover {
    background-color: #2980b9;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
}

.dropdown-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.3s ease;
}

.has-dropdown:hover .dropdown-indicator {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: #2c3e50;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 101;
    padding: 0.5rem 0;
    list-style: none;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu .nav-item {
    margin: 0;
    width: 100%;
}

.dropdown-menu .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    border-radius: 0;
    justify-content: space-between;
}

.dropdown-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.navbar-buttons {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

.login-status-wrapper {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
}

.login-status-wrapper:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.login-status-wrapper i {
    margin-right: 0.5rem;
    color: #ffffff;
}

/* Mobile Menu Button */
.mobile-menu {
    display: none;
}

.button_container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
    cursor: pointer;
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.button_container span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.button_container.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.button_container.active span:nth-child(2) {
    opacity: 0;
}

.button_container.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Mobile Menu Styles */
.mobile-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-logo {
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e2b38;
}

.mobile-logo img {
    height: 40px;
    filter: none;
}

.mobile-site-title {
    margin: 1rem 0 0;
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.5px;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.overlay-menu {
    padding: 2rem 1.5rem;
    flex: 1;
    overflow-y: auto;
    background: #2c3e50;
}

.overlay-menu .nav-list {
    flex-direction: column;
    align-items: flex-start;
}

.overlay-menu .nav-item {
    width: 100%;
    margin: 0 0 1rem 0;
}

.overlay-menu .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    padding: 0.75rem 0;
    width: 100%;
    justify-content: space-between;
}

/* Mobile home button styling */
.overlay-menu .nav-link[href="/"] {
    font-weight: 600;
    color: #fff;
    background-color: #0056b3;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,86,179,0.2);
}

.overlay-menu .nav-link[href="/"]:hover {
    background-color: #004494;
}

/* Responsive Styles */
@media (max-width: 840px) {
    .navbar-menu {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    #header {
        height: 4.5rem;
    }
    
    .navbar-brand img {
        height: 32px;
        filter: brightness(0) invert(1);
    }
    
    .site-title {
        font-size: 1.6rem;
    }
    
    .site-title-container {
        position: static;
        width: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
    }
}

/* Tree Menu for Sidebar */
.tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tree li {
    margin-bottom: 0.5rem;
}

.tree .toggler {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    cursor: pointer;
    position: relative;
}

.tree .toggler:before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    color: #3498db;
}

.tree .tree-opened > .toggler:before {
    content: '-';
}

.tree .tree-closed > ul {
    display: none;
}

.tree a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
}

.tree a:hover,
.tree a.active {
    color: #3498db;
}

/* Footer Styling */
#footer {
    background: #2c3e50;
    color: #fff;
    padding: 3rem 0;
    margin-top: 3rem;
    position: relative;
}

#footer p,
#footer a {
    color: #ffffff;
}

#footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin-bottom: 2rem;
    padding-right: 2rem;
}

.footer-section h4 {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.75rem;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
}

.footer-section h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #3498db;
}

.footer-section p, 
.footer-section a {
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
    font-size: 1.05rem;
}

.footer-section a {
    display: block;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%;
    font-size: 1rem;
    color: #ffffff;
    font-family: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
}

@media (max-width: 768px) {
    .footer-section {
        flex: 100%;
        padding-right: 0;
    }
}
