/* ==========================================================================
   NAVBAR ENHANCEMENTS - Modern UI/UX with Polish  
   Matches the sidebar design language for consistent experience
   Additional styles to enhance navbar.css
   ========================================================================== */

/* NAVIGATION LINKS - Enhanced */
.navbar-nav {
    gap: 0.25rem;
}

.navbar-nav .nav-link {
    color: var(--navbar-text, #495057) !important;
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
    padding: 0.625rem 1rem !important;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    overflow: hidden;
}

/* Shimmer effect on hover */
.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.15), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
    border-radius: 0.5rem;
    z-index: 0;
}

.navbar-nav .nav-link:hover::before {
    left: 100%;
}

.navbar-nav .nav-link:hover {
    color: #0b5ed7 !important;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(13, 110, 253, 0.12) 100%);
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    color: #0d6efd !important;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12) 0%, rgba(13, 110, 253, 0.18) 100%);
    font-weight: 600;
    box-shadow: inset 0 -3px 0 #0d6efd, 0 2px 8px rgba(13, 110, 253, 0.15);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #0d6efd, transparent);
    border-radius: 2px 2px 0 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar-nav .nav-link.active::after {
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

/* BUTTON STYLES - Enhanced */
.navbar-nav .btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-width: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    position: relative;
    overflow: hidden;
}

.navbar-nav .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.navbar-nav .btn:hover::before {
    left: 100%;
}

.navbar-nav .btn i {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 2;
}

.navbar-nav .btn:hover i {
    transform: scale(1.15) rotate(5deg);
}

.navbar-nav .btn-outline-primary:hover {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.35);
}

.navbar-nav .btn-outline-primary.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    box-shadow: 0 2px 12px rgba(13, 110, 253, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.navbar-nav .btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.25);
}

.navbar-nav .btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.45);
}

/* DROPDOWN MENUS - Enhanced */
.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
    animation: dropdownSlideIn 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98);
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.navbar-nav .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 20px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.98);
    transform: rotate(45deg);
    border-radius: 2px;
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

.navbar-nav .dropdown-item {
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.navbar-nav .dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.1), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.navbar-nav .dropdown-item:hover::before {
    left: 100%;
}

.navbar-nav .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.15) 100%);
    color: #0b5ed7;
    transform: translateX(5px);
    padding-left: 1.125rem;
}

.navbar-nav .dropdown-item.active {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.18) 0%, rgba(13, 110, 253, 0.25) 100%);
    color: #0d6efd;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #0d6efd;
}

.navbar-nav .dropdown-item i {
    font-size: 1rem;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}

.navbar-nav .dropdown-item:hover i {
    transform: scale(1.2) rotate(5deg);
}

.navbar-nav .dropdown-item.active i {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.1); }
}

/* USER PROFILE - Enhanced */
.user-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
    font-weight: 600;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: transform 0.5s ease;
}

.user-profile-toggle:hover .user-avatar::before {
    transform: rotate(45deg);
}

.user-profile-toggle:hover .user-avatar {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

.user-profile-toggle {
    padding: 0.375rem 0.75rem !important;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-toggle:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06) 0%, rgba(13, 110, 253, 0.1) 100%);
}

.user-profile-toggle:hover .user-name {
    color: #0d6efd !important;
}

/* NOTIFICATION DROPDOWN - Enhanced */
.notification-dropdown .nav-link,
.notification-dropdown > a,
.notification-dropdown > button {
    position: relative;
    padding: 0.5rem !important;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.notification-dropdown .nav-link::before,
.notification-dropdown > a::before,
.notification-dropdown > button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.15), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.notification-dropdown .nav-link:hover::before,
.notification-dropdown > a:hover::before,
.notification-dropdown > button:hover::before {
    left: 100%;
}

.notification-dropdown .nav-link:hover,
.notification-dropdown > a:hover,
.notification-dropdown > button:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(13, 110, 253, 0.12) 100%);
    color: #0d6efd;
    transform: scale(1.05);
}

.notification-dropdown .nav-link:hover i,
.notification-dropdown > a:hover i,
.notification-dropdown > button:hover i {
    animation: bellRing 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-12deg); }
    20%, 40%, 60%, 80% { transform: rotate(12deg); }
}

/* NOTIFICATION BADGE - Enhanced */
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 50%;
    padding: 0.2em 0.4em;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
    z-index: 2;
}

.notification-badge.badge-updated {
    animation: badgePop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 2px 12px rgba(220, 53, 69, 0.6);
    }
}

@keyframes badgePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* NOTIFICATION ITEMS - Enhanced */
.notification-item {
    padding: 0.875rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.notification-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.08), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.notification-item:hover::before {
    left: 100%;
}

.notification-item:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.1) 100%);
    transform: translateX(3px);
}

.notification-item.unread {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.15) 100%);
    border-left: 4px solid #0d6efd;
    padding-left: calc(0.875rem - 4px);
}

.notification-item.unread::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #0d6efd;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.6);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(13, 110, 253, 0.6); }
    50% { box-shadow: 0 0 15px rgba(13, 110, 253, 0.9); }
}

.notification-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12) 0%, rgba(13, 110, 253, 0.18) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d6efd;
    font-size: 1.125rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-item:hover .notification-icon {
    transform: scale(1.15) rotate(8deg);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.18) 0%, rgba(13, 110, 253, 0.25) 100%);
}

/* REAL-TIME STATUS */
.real-time-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.6);
    animation: statusPulse 2s infinite;
    margin-left: 0.5rem;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(40, 167, 69, 0.6);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.9);
    }
}

.real-time-status.disconnected {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.6);
    animation: none;
}

/* TOAST NOTIFICATIONS */
.toast {
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: toastSlideIn 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        background: linear-gradient(135deg, rgba(248, 249, 250, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
        border-radius: 0.75rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        animation: mobileMenuSlide 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    @keyframes mobileMenuSlide {
        from {
            opacity: 0;
            transform: translateY(-15px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
