﻿/* =========================================================
   1. NAVBAR ACTIVE + HOVER STYLES
   ========================================================= */

/* Target the Active Link with the custom class to ensure high specificity */
.mud-navmenu a.mud-nav-link.navlink-active-custom {
    /* 1. Set text color to the high-contrast Warning/Amber color */
    color: var(--mud-palette-warning) !important;
    /* 2. Strong visual marker: thick bottom border in the same high-contrast color */
    border-bottom: 4px solid var(--mud-palette-warning) !important;
    /* 3. Make the text slightly bolder for emphasis */
    font-weight: 600 !important;
    /* 4. Use a subtle, darker background to reinforce the active state 
       (Looks like a dark hover effect, but permanent for the active state) 
    background-color: rgba(0, 0, 0, 0.3) !important;*/
    /* Adjust padding to make room for the border */
    padding-bottom: 5px !important;
    /* Reset MudBlazor's default active color that was causing issues */
    border-radius: 0 !important;
}

/* Inactive links get a very subtle white highlight on hover, but remain white text */
.mud-navmenu a.mud-nav-link:hover:not(.navlink-active-custom) {
    background-color: rgba(255, 255, 255, 0.1) !important; /* Subtle white/transparent hover */
    color: var(--mud-palette-appbar-text) !important; /* Keep text color white */
}


/* =========================================================
   2. DROPDOWN COMPONENT
   ========================================================= */

.dropdown-section {
    position: relative;
    margin: 0 8px;
}

.dropdown-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

    .dropdown-header:hover {
        background-color: #f1f3f5;
    }

.dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    padding: 6px 0;
    margin-top: 6px;
    z-index: 1500;
    animation: dropdownFade 0.15s ease-out;
}

/* Removed duplicate .dropdown-links (same as panel) */

.dropdown-link {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    color: #343a40;
    animation: dropdownFade 0.15s ease-out;
}

    .dropdown-link:hover {
        background-color: #f1f3f5;
    }

    .dropdown-link.active {
        background-color: #e9ecef;
        font-weight: 600;
    }


/* =========================================================
   3. OVERLAY (CLICK OUTSIDE)
   ========================================================= */

.dropdown-overlay {
    position: fixed;
    top: 64px; /* only below AppBar */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1340; /* below menu (1400), above page */
}


/* =========================================================
   4. NAVBAR LAYOUT
   ========================================================= */

.app-brand-text {
    font-size: 1.25rem;
    line-height: 1.2;
}

.app-nav-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
}

.mobile-menu-toggle {
    margin-right: 0.5rem;
}


/* =========================================================
   5. ANIMATIONS
   ========================================================= */

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   6. RESPONSIVE (MOBILE FIRST)
   ========================================================= */

@media (max-width: 960px) {

    .app-brand-text {
        font-size: 1rem;
    }

    .app-nav-menu {
        display: none;
        position: absolute;
        top: 100%; /* better than 64px */
        left: 0;
        right: 0;
        z-index: 1400;
        flex-direction: column;
        align-items: stretch;
        background-color: var(--mud-palette-appbar-background);
        padding: 0.5rem 0.75rem 0.75rem;
        gap: 0.2rem;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        white-space: normal;
    }

        .app-nav-menu.app-nav-menu-open {
            display: flex;
        }

    .app-nav-link {
        width: 100%;
        margin: 0 !important;
        border-radius: 6px;
    }

    .app-dropdown-slot {
        width: 100%;
    }
}

@media (min-width: 961px) {
    .app-nav-menu {
        display: flex;
    }
}
