/* Header and Navigation Styles */

/* Page Header Styles */
.page-header {
    padding: 2rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 auto 0.75rem;
    max-width: 800px;
    line-height: 1.2;
}

.page-header .lead {
    font-size: 1.1rem;
    margin: 0 auto;
    max-width: 700px;
    opacity: 0.9;
    line-height: 1.5;
}

/* Make header more compact on smaller screens */
@media (max-width: 767.98px) {
    .page-header {
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .page-header .lead {
        font-size: 0.9rem;
    }
}

.fmwa-logo {
    height: 100%;  /* Make height 100% of parent */
    width: auto;
    max-width: none;  /* Remove max-width constraint */
    max-height: 100%;  /* Ensure it doesn't exceed parent height */
    object-fit: contain;
    display: block;
    margin: 0 15px 0 0;  /* Remove top/bottom margin */
    background: transparent;
    border: none;
    padding: 0;  /* Remove padding */
}

/* Ensure consistent height in navbar */
.navbar-brand {
    height: 100%;  /* Take full height of navbar */
    display: flex;
    align-items: center;
    padding: 0;  /* Remove any default padding */
}

/* Make sure navbar has enough height */
.navbar {
    min-height: 100px;  /* Adjust this value based on your needs */
}

/* Ensure logo container doesn't add extra spacing */
.navbar > .container-fluid {
    align-items: stretch;  /* Make children stretch to full height */
}

.fmwa-navbar-title {
    display: inline-block;
    white-space: normal;
    font-size: 1rem;
    font-weight: 700;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    line-height: 1.2;
}

/* Adjust logo and title for mobile */
@media (max-width: 767.98px) {
    .navbar-brand {
        max-width: 80%;
        padding: 0.5rem 0;
    }
    
    .fmwa-logo-stretch {
        height: 40px;
        margin-left: 5px;
        max-height: 100%;
    }
    
    .fmwa-navbar-title {
        font-size: 0.8rem;
        letter-spacing: 0.2px;
        white-space: normal;
        line-height: 1.1;
    }
    
    /* Improve mobile menu */
    .navbar-toggler {
        padding: 0.5rem;
        border: none;
        margin-right: 0.5rem;
    }
    
    .navbar-nav {
        padding: 1rem 0.5rem;
        background: #fff;
        margin-top: 0.5rem;
        border-radius: 0.25rem;
        box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    }
    
    .nav-item {
        margin: 0.25rem 0;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 0.25rem;
    }
    
    .dropdown-menu {
        position: static !important;
        float: none;
        margin: 0.25rem 1rem;
        border: 1px solid rgba(0,0,0,0.1);
    }
    
    .dropdown-item {
        padding: 0.5rem 1.5rem;
        word-break: break-word;
    }
    
    .logo-divider {
        height: 25px;
        margin: 0 5px;
    }
}

.logo-divider {
    display: inline-block;
    height: 30px;
    width: 1px;
    background-color: rgba(255,255,255,0.3);
    margin: 0 10px;
}

.navbar-tagline {
    color: white;
    font-size: 0.9rem;
    margin: 0 15px;
    font-style: italic;
    white-space: nowrap;
}

.top-bar {
    background-color: #014903;
    color: white;
    padding: 6px 0;
    font-size: 12px;
}

.main-nav {
    background-color: #014903;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-nav .navbar-brand img {
    height: 60px;
    transition: all 0.3s ease;
}

.main-nav .nav-link {
    color: white !important;
    font-weight: 500;
    padding: 12px 8px !important;
    text-transform: uppercase;
    font-size: 11px;
    white-space: nowrap;
    position: relative;
}

.main-nav .nav-link:hover {
    color: #f9ca24 !important;
}

/* Remove bottom border from active menu item */
.main-nav .nav-item .nav-link.active,
.main-nav .nav-item .nav-link:focus,
.main-nav .nav-item .nav-link:active {
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Dropdown styles */
.dropdown-menu {
    max-width: 280px;
    min-width: 200px;
    font-size: 0.9em;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    left: auto !important;
    right: 0;
    /* Ensure dropdown doesn't close when clicking inside */
    pointer-events: auto;
}

.dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    padding: 0.35rem 1.5rem;
    line-height: 1.4;
}

/* Dropdown submenu styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -0.5rem;
    margin-left: 0.1rem;
    border-radius: 0 6px 6px 6px;
    max-height: 80vh;
    overflow-y: auto;
}

.dropdown-submenu .dropdown-toggle::after {
    float: right;
    margin-top: 0.3em;
    margin-left: 0.5em;
    vertical-align: middle;
}

/* Completely disable hover behavior for dropdowns */
.dropdown-menu {
    pointer-events: none;
    opacity: 0;
    display: block !important;
    visibility: hidden;
    transition: none !important;
}

.dropdown-menu.show {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* Prevent any hover effects on dropdown toggles */
.dropdown-toggle::after {
    transition: none !important;
}

/* Disable hover on dropdown items */
.dropdown-item, .dropdown-toggle {
    pointer-events: auto;
}

/* Hide submenus by default */
.dropdown-menu > .dropdown-submenu > .dropdown-menu {
    display: none !important;
    pointer-events: none;
}

/* Only show submenus when parent has show class */
.dropdown-menu > .dropdown-submenu.show > .dropdown-menu {
    display: block !important;
    pointer-events: auto;
}

/* Adjust navbar items spacing */
.navbar-nav {
    width: 100%;
    justify-content: flex-end;
}

.nav-item {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

/* Departments dropdown specific adjustments */
#departmentsDropdown.dropdown-toggle::after {
    margin-left: 0.25em;
}

/* Ensure dropdowns stay within viewport */
.dropdown:not(.dropstart) .dropdown-menu {
    left: auto !important;
    right: 0;
    margin-right: 30px !important; /* Increased right margin */
    margin-top: 10px !important; /* Add top margin */
    min-width: 250px; /* Ensure minimum width */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Add shadow for depth */
    border: 1px solid rgba(0,0,0,0.1); /* Add subtle border */
}

/* Adjust position for dropdown-submenu */
.dropdown-submenu > .dropdown-menu {
    top: -10px;
    left: auto !important;
    right: 100%;
    margin-top: 0;
    margin-right: 20px !important; /* Increased spacing */
    border-radius: 6px !important;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2); /* Add shadow */
    border: 1px solid rgba(0,0,0,0.1); /* Match main dropdown */
}

/* Mobile Navigation Styles */
@media (max-width: 1199.98px) {
    .navbar-nav {
        flex-wrap: wrap;
    }
    
    .nav-item {
        margin: 2px 0;
    }
    
    .dropdown-menu {
        position: static !important;
        margin: 0.25rem 0 0.25rem 1.5rem !important;
        float: none;
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .dropdown-submenu .dropdown-menu {
        left: 0;
        margin-left: 1.5rem !important;
    }
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #014903;
        padding: 0.5rem;
        margin-top: 10px;
        border-radius: 4px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }
    
    .navbar-collapse.show {
        max-height: 1000px; /* Adjust based on your content */
    }
    
    .navbar-nav {
        margin: 0 !important;
    }
    
    .nav-item {
        margin-bottom: 5px;
    }
    
    .dropdown-menu {
        background-color: rgba(1, 73, 3, 0.9);
        border: none;
        margin: 5px 0 5px 15px;
        padding: 0;
    }
    
    .dropdown-item {
        color: white !important;
        padding: 8px 15px !important;
        font-size: 14px;
    }
    
    .dropdown-item:hover, 
    .dropdown-item:focus {
        background-color: #013602;
    }
    
    .dropdown-divider {
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin: 5px 0;
    }
    
    .dropdown-submenu .dropdown-menu {
        position: static;
        margin-left: 15px;
        border: none;
        box-shadow: none;
    }
    
    .dropdown-submenu .dropdown-toggle::after {
        float: right;
        transform: rotate(-90deg);
        margin-top: 8px;
    }
    
    .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.5);
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}

/* Welcome Section */
.welcome-section {
    background-color: #ffffff;
    color: #000000;
    padding: 8px 0;
    text-align: center;
    margin: 0;
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
}

.welcome-section h1 {
    font-size: 1.5rem;
    margin-bottom: 4px !important;
}

.welcome-section p {
    font-size: 0.9rem;
    margin-bottom: 4px !important;
}

.welcome-section .btn {
    padding: 2px 12px;
    font-size: 0.8rem;
    margin-top: 4px;
}
