/* ===========================================
   MODERN NAVBAR - THEME & EFFECTS
   Location: wwwroot/css/navbar/navbar-theme.css
   Purpose: Visual effects, animations, and theme variants
   Professional Dark/Light Mode Support
   =========================================== */

/* === SCROLL EFFECTS === */
.modern-navbar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-navbar.scrolled {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.modern-navbar.scrolled .navbar-brand {
    font-size: 1.35rem;
}

/* Mobile/Tablet scroll effects */
@media (max-width: 991px) {
    .modern-navbar.scrolled {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .modern-navbar.scrolled .navbar-brand {
        font-size: 1.15rem;
    }
}

/* === HOVER GLOW EFFECTS === */
.modern-navbar .nav-link {
    position: relative;
}

.modern-navbar .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--navbar-accent-gold) 0%, #fcd34d 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Desktop hover */
@media (min-width: 992px) {
    .modern-navbar .nav-link:hover::before,
    .modern-navbar .nav-link.active::before {
        width: 70%;
    }
}

/* Mobile/Tablet - always show underline for active links */
@media (max-width: 991px) {
    .modern-navbar .nav-link.active::before {
        width: 70%;
    }

    .modern-navbar .nav-link:active::before {
        width: 70%;
    }
}

/* === DROPDOWN ARROW ANIMATION === */
.modern-navbar .dropdown-toggle::after {
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
    border-top-color: rgba(255, 255, 255, 0.7);
}

.modern-navbar .dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* === USER PROFILE ENHANCEMENTS === */
.modern-navbar .username-display {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.modern-navbar .user-profile-container {
    position: relative;
}

.modern-navbar .user-profile-container .nav-link {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modern-navbar .user-profile-container .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 25px rgba(96, 165, 250, 0.2);
}

/* === ROLE BADGES IN NAVBAR === */
.modern-navbar .user-roles-display {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.modern-navbar .role-badge-modern {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.modern-navbar .role-badge-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* === ICON STYLING === */
.modern-navbar .bi {
    transition: transform 0.3s ease;
}

.modern-navbar .nav-link:hover .bi,
.modern-navbar .dropdown-item:hover .bi {
    transform: scale(1.1);
}

/* === DIVIDER IN DROPDOWNS === */
.modern-navbar .dropdown-divider.migration-divider {
    border-top: 2px dashed rgba(96, 165, 250, 0.3);
    margin: 0.75rem 0;
}

/* === LOADING STATE === */
.modern-navbar.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* === NOTIFICATION BADGE === */
.modern-navbar .notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* === FOCUS VISIBLE (Accessibility) === */
.modern-navbar .nav-link:focus-visible,
.modern-navbar .navbar-brand:focus-visible,
.modern-navbar .dropdown-item:focus-visible,
.modern-navbar .navbar-toggler:focus-visible {
    outline: 3px solid var(--navbar-accent-gold);
    outline-offset: 2px;
    border-radius: 10px;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3);
}

/* === MOBILE FOCUS MANAGEMENT === */
@media (max-width: 991px) {
    .modern-navbar .navbar-collapse:focus {
        outline: none;
    }

    .modern-navbar .navbar-collapse[role="dialog"] {
        outline: none;
    }

    .modern-navbar .nav-link:focus,
    .modern-navbar .dropdown-item:focus,
    .modern-navbar .dropdown-toggle:focus {
        background: rgba(255, 255, 255, 0.2);
        outline: 2px solid var(--navbar-accent-gold);
        outline-offset: -2px;
    }

    .modern-navbar .nav-link:focus-visible,
    .modern-navbar .dropdown-item:focus-visible {
        outline: 3px solid var(--navbar-accent-gold);
        outline-offset: 2px;
        background: rgba(255, 255, 255, 0.25);
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .modern-navbar,
    .modern-navbar *,
    .modern-navbar::before,
    .modern-navbar::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === DARK MODE ENHANCEMENTS === */
@media (prefers-color-scheme: dark) {
    /* Navbar subtle glow effect */
    .modern-navbar {
        border-bottom: 1px solid rgba(96, 165, 250, 0.1);
    }

    .modern-navbar.scrolled {
        border-bottom-color: rgba(96, 165, 250, 0.15);
    }

    /* Dropdown dark mode enhancements */
    .modern-navbar .dropdown-menu {
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .modern-navbar .dropdown-item:hover {
        background: rgba(96, 165, 250, 0.12);
    }

    .modern-navbar .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.08);
    }

    /* Active link glow in dark mode */
    .modern-navbar .nav-link.active {
        box-shadow: 0 0 15px rgba(96, 165, 250, 0.15);
    }

    /* Brand icon glow in dark mode */
    .modern-navbar .navbar-brand i {
        filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.5));
    }

    /* Auth buttons dark mode */
    .modern-navbar .auth-link {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .modern-navbar .auth-link:hover {
        border-color: rgba(96, 165, 250, 0.3);
        box-shadow: 0 0 20px rgba(96, 165, 250, 0.15);
    }

    /* Logout button dark mode */
    .modern-navbar #logout:hover {
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5);
    }
}

/* === LIGHT MODE SPECIFIC === */
@media (prefers-color-scheme: light) {
    /* Dropdown has subtle shadow in light mode */
    .modern-navbar .dropdown-menu {
        box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    }

    /* Slightly different active state */
    .modern-navbar .nav-link.active {
        background: rgba(255, 255, 255, 0.18);
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .modern-navbar {
        border-bottom: 2px solid #ffffff;
    }

    .modern-navbar .nav-link,
    .modern-navbar .dropdown-item {
        border: 1px solid transparent;
    }

    .modern-navbar .nav-link:hover,
    .modern-navbar .dropdown-item:hover {
        border-color: #ffffff;
    }

    .modern-navbar .dropdown-menu {
        border: 2px solid currentColor;
    }
}

/* === GLASSMORPHISM ENHANCEMENT === */
@supports (backdrop-filter: blur(20px)) {
    .modern-navbar {
        background: linear-gradient(135deg,
            rgba(26, 26, 46, 0.95) 0%,
            rgba(22, 33, 62, 0.95) 50%,
            rgba(15, 52, 96, 0.95) 100%);
    }

    @media (prefers-color-scheme: dark) {
        .modern-navbar {
            background: linear-gradient(135deg,
                rgba(10, 10, 15, 0.95) 0%,
                rgba(17, 24, 39, 0.95) 50%,
                rgba(15, 23, 42, 0.95) 100%);
        }
    }
}

/* === DROPDOWN HOVER STATES === */
.modern-navbar .dropdown-item {
    position: relative;
    overflow: hidden;
}

.modern-navbar .dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, var(--navbar-accent) 0%, var(--navbar-accent-gold) 100%);
    transform: scaleY(0);
    transition: transform 0.2s ease;
    border-radius: 0 2px 2px 0;
}

.modern-navbar .dropdown-item:hover::before {
    transform: scaleY(1);
}

.modern-navbar .dropdown-item.active::before {
    transform: scaleY(1);
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
}

/* === SUBTLE ANIMATIONS === */
/* (shimmer removed — conflicted with transition: all on .navbar-brand) */

/* === PRINT STYLES === */
@media print {
    .modern-navbar {
        display: none !important;
    }
}
