﻿#mobileMenu .collapsing {
    -webkit-transition: height 0.2s ease-in !important;
    transition: height 0.2s ease-in !important;
    visibility: hidden;
}

#mobileMenu .collapse.show {
    -webkit-transition: height 0.2s ease-in !important;
    transition: height 0.2s ease-in !important;
    visibility: visible;
}

/* Navbar Base Styles */
#mainNav {
    background-color: transparent;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    transition: all 0.3s ease-in;
}

    /* Scrolled State */
    #mainNav.scrolled {
        background-color: rgba(15, 23, 42, 0.95); /* Matches bg-color5 (slate-900) */
        backdrop-filter: blur(10px);
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

.activeNavItem > a {
    color: var(--bg-color5) !important;
}

/* Nav Links Hover Effect */
.nav-link {
    position: relative;
}

    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background-color: var(--color1, #3b82f6); /* Fallback to blue if var not defined */
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .nav-link:hover::after {
        width: 80%;
    }

/* Dropdown Styles */
.dropdown-menu {
    min-width: 220px;
    margin-top: 0;
}

.dropdown-item {
    font-weight: 500;
    transition: all 0.2s;
}

    .dropdown-item:hover, .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.05);
        transform: translateX(5px);
    }

/* Desktop Hover Logic & Animations */
@media (min-width: 992px) {
    /* Level 1 Dropdown */
    .dropdown:hover > .dropdown-menu {
        display: block;
        animation: fadeInUp 0.3s ease forwards;
    }

    /* Level 2 Dropdown (Nested) */
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
        top: 0;
        left: 100%;
        margin-top: -0.5rem;
        margin-left: 0;
        animation: fadeInUp 0.3s ease forwards;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 15px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Mobile Offcanvas Specifics */
.offcanvas {
    width: 75vw !important;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.offcanvas-body .nav-link {
    padding: 0.5rem 0;
}

    .offcanvas-body .nav-link::after {
        display: none; /* Disable underline effect on mobile */
    }