/**
 * Navigation Styles
 */

/* General Navigation Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    background-color: #1f315d;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navigation-wrapper {
    width: 100%;
    height: 100%;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative; /* Add this for proper positioning of mobile menu toggle */
}

/* Logo Styles */
.site-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%; /* Ensure full height */
}

.custom-logo-link {
    display: flex; /* Change from block to flex */
    align-items: center;
    height: 100%;
    padding: 10px 0;
}

.custom-logo {
    max-height: 62px;
    width: auto;
    vertical-align: middle; /* Add this */
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

/* Desktop Menu Styles */
.menu-left,
.menu-right {
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%; /* Ensure full height */
}

.menu-left {
    justify-content: flex-end;
    padding-right: 30px;
}

.menu-right {
    justify-content: flex-start;
    padding-left: 30px;
}

.menu-items {
    display: flex;
    align-items: center; /* Add this */
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%; /* Ensure full height */
}

.menu-items li {
    margin: 0 15px;
    display: flex; /* Add this */
    align-items: center; /* Add this */
    height: 100%; /* Add this */
}

.menu-items a {
    text-decoration: none;
    color: #ffffff; /* Change from #333 to white */
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    height: 100%;
}

.menu-items a:hover {
    color: #666;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: absolute;
    left: 20px;
    top: 50%; /* This should be 50% not arbitrary value */
    transform: translateY(-50%); /* Ensure true centering */
    z-index: 100;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #ffffff; /* Change from #333 */
    transition: all 0.3s ease;
    margin-bottom: 2px; /* Slight spacing between bars */
}

.bar:last-child {
    margin-bottom: 0;
}

/* Mobile Menu Container */
.mobile-menu-container {
    display: none;
    width: 100%;
    background-color: #1f315d; /* Match header background */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 80px;
    left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.mobile-menu {
    padding: 20px;
}

.mobile-menu-items {
    list-style: none;
    margin: 0;
    padding: 0px 0;
}

.mobile-menu-items li {
    margin: 10px 0;
    text-align: center;
}

.mobile-menu-items a {
    text-decoration: none;
    color: #ffffff; /* Change from #333 */
    font-size: 18px;
    font-weight: 500;
    display: block;
    padding: 8px 0;
}

/* Active mobile menu styles */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

.mobile-menu-container.active {
    display: block;
    max-height: 500px;
}

/* Content spacing to account for fixed header */
.site-content-wrapper {
    padding-top: 40px;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .menu-left,
    .menu-right {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .site-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-container {
        position: relative;
    }
}

/* Mobile Navigation Fixes */

/* Fix logo size in mobile view */
@media (max-width: 991px) {
    .site-logo {
        position: absolute;
        left: 50%;
        top: 50%; /* Add this */
        /* transform: translate(-50%, -50%); //Change from translateX to translate for both axes */
        height: auto; /* Reset the height constraint */
    }
    
    .custom-logo-link {
        padding: 10px 0;
        display: block; /* Change to block for mobile */
    }
    
    .custom-logo {
        max-height: 62px; /* Slightly smaller for mobile */
        width: auto;
        vertical-align: middle;
    }
    
    /* Fix hamburger menu positioning */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 24px;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(100%);
        z-index: 100;
    }
    
    /* Ensure proper spacing for the hamburger icon bars */
    .hamburger-icon {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 100%;
        height: 100%;
    }
    
    /* Ensure the navigation wrapper has proper height */
    .navigation-wrapper {
        width: 100%;
        height: 80px; /* Explicitly set height to match header */
    }
    
    /* Ensure the nav container has proper height */
    .nav-container {
        height: 100%;
        position: relative;
    }
    
    /* Mobile menu container positioning */
    .mobile-menu-container {
        top: 80px; /* Make sure this matches the header height */
    }
    
    /* Remove padding from mobile menu items */
    .mobile-menu .menu-left {
        padding-right: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    .mobile-menu .menu-right {
        padding-left: 0;
        padding-top: 0;
        margin-top: 0;
    }
    
    /* Add some spacing between the menus if needed */
    .mobile-menu .menu-left + .menu-right {
        margin-top: 10px;
    }
    
    /* Make menu items stack properly in mobile view */
    .mobile-menu .menu-items {
        display: block;
        width: 100%;
    }
    
    .mobile-menu .menu-items li {
        margin: 10px 0;
        display: block;
        height: auto;
        text-align: center;
    }
    
    .mobile-menu .menu-items a {
        display: block;
        padding: 8px 0;
        height: auto;
    }
}

/* Better animation for the hamburger icon */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Improve bar visibility and responsive behavior */
.bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    margin-bottom: 2px; /* Slight spacing between bars */
}

.bar:last-child {
    margin-bottom: 0;
}