/*
Bootstrap Menu Extensions
Custom styles for nested dropdowns and menu enhancements
*/

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

.dropdown-submenu .dropdown-toggle::after {
    transform: rotate(-90deg);
    transition: transform 0.15s ease-in-out;
}

.dropdown-submenu .dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
    z-index: 1001; /* Higher than parent dropdown */
}

/* For right-aligned parent dropdowns, position submenus to the left */
.dropdown-menu-end .dropdown-submenu .dropdown-menu {
    left: -100%;
    right: 0;
}

/* Hide submenus by default - disable hover */
.dropdown-submenu .dropdown-menu {
    display: none !important;
}

/* Show submenu when explicitly set via JavaScript */
.dropdown-submenu .dropdown-menu[style*="display: block"] {
    display: block !important;
}

/* Prevent parent dropdown from closing when clicking submenu toggles */
.dropdown-submenu > .dropdown-toggle {
    position: relative;
}

.dropdown-submenu > .dropdown-toggle::after {
    content: "\f105"; /* FontAwesome chevron-right */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    border: 0;
    margin-left: auto;
    vertical-align: 0;
    transform: none;
}

/* Click-only submenu toggles - no hover activation */
.dropdown-submenu > .dropdown-toggle:hover {
    background-color: #f8f9fa;
    color: #212529;
}

/* Ensure proper spacing and cursor for submenu toggles */
.dropdown-submenu > .dropdown-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Active team styling */
.active-team {
    color: #006600 !important;
    font-weight: bold;
}

.active-team .fas {
    color: #006600 !important;
}

/* Team switch link styling */
.team-switch-link:hover {
    color: #0d6efd !important;
}

/* Ensure proper spacing for icons in dropdown items */
.dropdown-item i {
    width: 16px;
    margin-right: 8px;
    text-align: center;
}

/* Mobile responsiveness improvements */
@media (max-width: 991.98px) {
    .dropdown-submenu .dropdown-menu {
        position: static !important;
        float: none;
        margin-left: 20px;
        margin-top: 0;
        display: none;
        box-shadow: none;
        border: none;
        padding-left: 0;
    }
    
    /* Mobile: use click, not hover */
    
    .dropdown-submenu .dropdown-toggle::after {
        transform: rotate(0deg);
    }
}

/* Improve navbar brand spacing */
.navbar-brand {
    margin-right: 2rem;
}

/* Center team dropdown styling */
.mx-auto .nav-item {
    text-align: center;
}

/* Dropdown menu positioning improvements */
.dropdown-menu {
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
}

/* Hover effects for dropdown items */
.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Active dropdown item styling */
.dropdown-item.active {
    background-color: #0d6efd;
    color: white;
}

/* Ensure dropdowns don't break navbar height */
.navbar {
    min-height: 56px;
}

/* Improve mobile menu appearance */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding-top: 0.5rem;
    }
    
    .navbar-nav .nav-item {
        padding: 0.25rem 0;
    }
}