/* Navbar Active Menu Highlighting Styles */

/* Navbar Logo Styles - Non-clickable display with perfect centering */
.navbar-brand-logo {
    float: left;
    height: 50px;
    padding: 0 15px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.navbar-brand-logo .navbar-logo {
    height: 40px !important;
    width: auto !important;
    max-width: 150px !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    display: block !important;
}

/* Responsive logo sizing with maintained centering */
@media (max-width: 768px) {
    .navbar-brand-logo {
        height: 45px;
        padding: 0 12px;
    }
    
    .navbar-brand-logo .navbar-logo {
        height: 35px !important;
        max-width: 120px !important;
    }
}

@media (max-width: 480px) {
    .navbar-brand-logo {
        height: 40px;
        padding: 0 10px;
    }
    
    .navbar-brand-logo .navbar-logo {
        height: 30px !important;
        max-width: 100px !important;
    }
}

/* Base active menu styles */
.navbar-nav .nav-item.active > .nav-link,
.navbar-nav .nav-item.active > a {
    color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2) !important;
    transition: all 0.3s ease !important;
}

/* Active menu underline indicator */
.navbar-nav .nav-item.active > .nav-link::after,
.navbar-nav .nav-item.active > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    opacity: 0.9;
}

/* Active menu left border indicator */
.navbar-nav .nav-item.active > .nav-link::before,
.navbar-nav .nav-item.active > a::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    opacity: 0.8;
}

/* Dark navbar active styles */
.navbar-wrapper.dark-navbar .navbar-nav .nav-item.active > .nav-link,
.navbar-wrapper.dark-navbar .navbar-nav .nav-item.active > a,
.navbar-wrapper.tech-navbar .navbar-nav .nav-item.active > .nav-link,
.navbar-wrapper.tech-navbar .navbar-nav .nav-item.active > a,
.navbar-wrapper.gradient-navbar .navbar-nav .nav-item.active > .nav-link,
.navbar-wrapper.gradient-navbar .navbar-nav .nav-item.active > a {
    color: #60a5fa !important;
    background-color: rgba(59, 130, 246, 0.2) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Light navbar active styles */
.navbar-wrapper.light-navbar .navbar-nav .nav-item.active > .nav-link,
.navbar-wrapper.light-navbar .navbar-nav .nav-item.active > a {
    color: #1d4ed8 !important;
    background-color: rgba(59, 130, 246, 0.12) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15) !important;
}

/* Dropdown active styles */
.navbar-nav .dropdown.active > .dropdown-toggle {
    color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2) !important;
}

.navbar-nav .dropdown.active > .dropdown-toggle::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    opacity: 0.8;
}

.navbar-nav .dropdown-menu .dropdown-item.active > .dropdown-link,
.navbar-nav .dropdown-menu .dropdown-item.active > a {
    color: #1d4ed8 !important;
    background-color: rgba(59, 130, 246, 0.15) !important;
    font-weight: 600 !important;
    border-left: 3px solid #3b82f6 !important;
    padding-left: 18px !important;
    margin-left: 5px !important;
    border-radius: 0 4px 4px 0 !important;
}

/* Hover effects for active items */
.navbar-nav .nav-item.active > .nav-link:hover,
.navbar-nav .nav-item.active > a:hover {
    color: #1d4ed8 !important;
    background-color: rgba(59, 130, 246, 0.25) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Focus styles for accessibility */
.navbar-nav .nav-item.active > .nav-link:focus,
.navbar-nav .nav-item.active > a:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2) !important;
}

/* Animation for active state changes */
.navbar-nav .nav-item > .nav-link,
.navbar-nav .nav-item > a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.navbar-nav .nav-item.active > .nav-link,
.navbar-nav .nav-item.active > a {
    animation: activeMenuGlow 0.6s ease-in-out;
}

@keyframes activeMenuGlow {
    0% {
        background-color: transparent;
        transform: scale(1);
        box-shadow: none;
    }
    50% {
        background-color: rgba(59, 130, 246, 0.3);
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    }
    100% {
        background-color: rgba(59, 130, 246, 0.15);
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }
}

/* Mobile responsive active styles */
@media (max-width: 767px) {
    .navbar-nav .nav-item.active > .nav-link,
    .navbar-nav .nav-item.active > a {
        border-left: 4px solid #3b82f6 !important;
        padding-left: 24px !important;
        margin-left: 8px !important;
        background-color: rgba(59, 130, 246, 0.1) !important;
        border-radius: 0 6px 6px 0 !important;
    }
    
    .navbar-nav .nav-item.active > .nav-link::after,
    .navbar-nav .nav-item.active > a::after,
    .navbar-nav .nav-item.active > .nav-link::before,
    .navbar-nav .nav-item.active > a::before {
        display: none;
    }
    
    .navbar-nav .dropdown.active > .dropdown-toggle {
        border-left: 4px solid #3b82f6 !important;
        padding-left: 24px !important;
        margin-left: 8px !important;
        background-color: rgba(59, 130, 246, 0.1) !important;
        border-radius: 0 6px 6px 0 !important;
    }
    
    .navbar-nav .dropdown.active > .dropdown-toggle::before {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .navbar-nav .nav-item.active > .nav-link,
    .navbar-nav .nav-item.active > a {
        background-color: #000 !important;
        color: #fff !important;
        border: 2px solid #3b82f6 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .navbar-nav .nav-item,
    .navbar-nav .dropdown-item,
    .navbar-nav .nav-item > .nav-link,
    .navbar-nav .nav-item > a {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .navbar-nav .nav-item.active > .nav-link,
    .navbar-nav .nav-item.active > a {
        background-color: transparent !important;
        color: #000 !important;
        font-weight: bold !important;
        text-decoration: underline !important;
        box-shadow: none !important;
    }
    
    .navbar-nav .nav-item.active > .nav-link::after,
    .navbar-nav .nav-item.active > a::after,
    .navbar-nav .nav-item.active > .nav-link::before,
    .navbar-nav .nav-item.active > a::before {
        display: none !important;
    }
}

/* Debug styles (remove in production) */
.navbar-debug .nav-item.active {
    border: 2px dashed #ff0000 !important;
}

.navbar-debug .dropdown.active {
    border: 2px dashed #00ff00 !important;
}

/* Ensure proper stacking context */
.navbar-nav {
    position: relative;
    z-index: 1000;
}

.navbar-nav .nav-item.active {
    position: relative;
    z-index: 1001;
}

/* Loading state for menu items */
.navbar-nav .nav-item.loading > .nav-link,
.navbar-nav .nav-item.loading > a {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.navbar-nav .nav-item.loading > .nav-link::after,
.navbar-nav .nav-item.loading > a::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #3b82f6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}