/* ========================================
   MODERN NAVBAR - STUNNING ANIMATIONS
   All Icons Cyan + Professional Effects
   ======================================== */

/* Keyframe Animations */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.3),
                    0 0 10px rgba(0, 212, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.6),
                    0 0 30px rgba(0, 212, 255, 0.4);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* opacity-only animation replaces background-position (non-composited) */
@keyframes gradientShift {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1; }
}

/* Navbar Base */
.navbar-modern {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2) !important;
    padding: 0.5rem 1rem !important;
    min-height: 56px !important;
    max-height: 56px !important;
    z-index: 1050 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

.navbar-modern.navbar-scrolled {
    background: rgba(15, 23, 42, 0.95) !important;
    box-shadow: 0 4px 30px rgba(0, 212, 255, 0.2) !important;
}

/* Logo Styling with Animation */
.navbar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
    color: #fff !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    position: relative !important;
}

.logo-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.logo-icon {
    color: #00d4ff !important;
    /* Explicit properties — "transition: all" includes scrollbar-color (from * selector), causing non-composited transitions */
    transition: transform 0.3s ease, filter 0.3s ease !important;
    position: relative !important;
    z-index: 2 !important;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5)) !important;
}

.logo-glow {
    position: absolute !important;
    inset: -8px !important;
    background: #00d4ff !important;
    opacity: 0 !important;
    filter: blur(15px) !important;
    border-radius: 50% !important;
    transition: opacity 0.3s ease !important;
    z-index: 1 !important;
}

.navbar-brand:hover .logo-glow {
    opacity: 0.6 !important;
    animation: glow 2s ease-in-out infinite !important;
}

.navbar-brand:hover .logo-icon {
    transform: scale(1.15) rotate(5deg) !important;
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.8)) !important;
}

.logo-text {
    color: #f8fafc !important;
    transition: color 0.3s ease !important;
}

.logo-highlight {
    color: #00d4ff !important;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5) !important;
    transition: text-shadow 0.3s ease !important;
}

.navbar-brand:hover .logo-highlight {
    text-shadow: 0 0 25px rgba(0, 212, 255, 0.8) !important;
}

.navbar-brand:hover {
    transform: scale(1.03) !important;
    text-decoration: none !important;
}

/* Navigation Links with Amazing Animations */
.nav-link-modern {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
}

.nav-link-modern::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 212, 255, 0.15),
        transparent
    ) !important;
    transition: left 0.6s ease !important;
}

.nav-link-modern:hover::before {
    left: 100% !important;
}

/* ALL ICONS CYAN - ANIMATED */
.nav-icon-animated {
    color: #00d4ff !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.4)) !important;
    position: relative !important;
    z-index: 2 !important;
}

.nav-link-modern:hover .nav-icon-animated {
    transform: scale(1.2) rotate(-5deg) !important;
    filter: drop-shadow(0 0 14px rgba(0, 212, 255, 0.9)) !important;
    animation: iconPulse 0.6s ease !important;
}

.nav-item.active .nav-link-modern .nav-icon-animated {
    transform: scale(1.15) !important;
    filter: drop-shadow(0 0 18px rgba(0, 212, 255, 1)) !important;
}

/* Hover State */
.nav-link-modern:hover {
    color: #e2e8f0 !important;
    background: rgba(0, 212, 255, 0.12) !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.25) !important;
}

/* Active State with Glow */
.nav-item.active .nav-link-modern {
    color: #00d4ff !important;
    background: rgba(0, 212, 255, 0.15) !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3),
                inset 0 0 20px rgba(0, 212, 255, 0.1) !important;
}

/* Indicator Line Animation */
.nav-indicator {
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, #00d4ff, #0891b2, #00d4ff) !important;
    background-size: 200% 100% !important;
    transition: width 0.3s ease !important;
    border-radius: 2px !important;
}

.nav-link-modern:hover .nav-indicator {
    width: 80% !important;
    animation: gradientShift 1.5s ease infinite !important;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6) !important;
}

.nav-item.active .nav-link-modern .nav-indicator {
    width: 90% !important;
    animation: gradientShift 2s ease infinite !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.8) !important;
}

/* Dropdown Styling */
.dropdown-toggle::after {
    margin-left: 6px !important;
    transition: transform 0.3s ease !important;
}

.dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg) !important;
}

/* Modern Dropdown Menu with Animations */
.dropdown-menu-modern {
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(0, 212, 255, 0.2) !important;
    padding: 8px !important;
    margin-top: 8px !important;
    min-width: 200px !important;
    animation: slideDown 0.3s ease !important;
}

.dropdown-menu-modern .dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    color: #cbd5e1 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.dropdown-menu-modern .dropdown-item::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 212, 255, 0.1),
        transparent
    ) !important;
    transition: left 0.5s ease !important;
}

.dropdown-menu-modern .dropdown-item:hover::before {
    left: 100% !important;
}

.dropdown-menu-modern .dropdown-item i,
.dropdown-menu-modern .dropdown-item .nav-icon-animated {
    width: 18px !important;
    font-size: 15px !important;
    color: #00d4ff !important;
    transition: all 0.3s ease !important;
    text-shadow: 0 0 6px rgba(0, 212, 255, 0.5), 0 0 10px rgba(0, 212, 255, 0.25) !important;
    flex-shrink: 0 !important;
}

.dropdown-menu-modern .dropdown-item:hover {
    background: rgba(0, 212, 255, 0.15) !important;
    color: #00d4ff !important;
    text-decoration: none !important;
    transform: translateX(5px) !important;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2) !important;
}

.dropdown-menu-modern .dropdown-item:hover i,
.dropdown-menu-modern .dropdown-item:hover .nav-icon-animated {
    transform: scale(1.2) rotate(-10deg) !important;
    text-shadow: 0 0 12px rgba(0, 212, 255, 1), 0 0 24px rgba(0, 212, 255, 0.7) !important;
}

.dropdown-menu-modern .dropdown-item.active {
    background: rgba(0, 212, 255, 0.2) !important;
    color: #00d4ff !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3) !important;
}

.dropdown-menu-modern .dropdown-divider {
    border-top: 1px solid rgba(0, 212, 255, 0.2) !important;
    margin: 8px 0 !important;
}

/* Buttons with Amazing Effects */
.btn-ghost-modern {
    padding: 8px 16px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    background: transparent !important;
    color: #00d4ff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    line-height: 1.4 !important;
    position: relative !important;
    overflow: hidden !important;
}

.btn-ghost-modern::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: rgba(0, 212, 255, 0.2) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.6s, height 0.6s !important;
}

.btn-ghost-modern:hover::before {
    width: 300px !important;
    height: 300px !important;
}

.btn-ghost-modern:hover {
    background: rgba(0, 212, 255, 0.1) !important;
    border-color: #00d4ff !important;
    color: #f8fafc !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4) !important;
}

.btn-cta-modern {
    padding: 8px 20px !important;
    border-radius: 8px !important;
    border: none !important;
    background: linear-gradient(135deg, #00d4ff 0%, #0891b2 100%) !important;
    background-size: 200% 200% !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.4) !important;
    line-height: 1.4 !important;
    position: relative !important;
    overflow: hidden !important;
}

.btn-cta-modern::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    ) !important;
    transition: left 0.6s ease !important;
}

.btn-cta-modern:hover::before {
    left: 100% !important;
}

.btn-cta-modern:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 8px 35px rgba(0, 212, 255, 0.6) !important;
    color: #fff !important;
    text-decoration: none !important;
    animation: glow 1.5s ease-in-out infinite !important;
}

.btn-cta-modern:active {
    transform: translateY(-1px) scale(1.02) !important;
}

/* User Dropdown Special Styling */
.user-dropdown {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 6px 14px !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    background: rgba(0, 212, 255, 0.05) !important;
}

.user-dropdown .nav-icon-animated {
    color: #00d4ff !important;
}

.user-dropdown:hover {
    background: rgba(0, 212, 255, 0.15) !important;
    border-color: #00d4ff !important;
    color: #00d4ff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3) !important;
}

/* Mobile Navbar Toggle with Animation */
.navbar-toggler {
    border: none !important;
    padding: 6px !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

.navbar-toggler:hover {
    background: rgba(0, 212, 255, 0.2) !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4) !important;
}

.navbar-toggler:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3) !important;
}

.navbar-toggler-bar {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    background: #00d4ff !important;
    margin: 4px 0 !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.5) !important;
}

.navbar-toggler:hover .navbar-toggler-bar {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8) !important;
}

/* Mobile Menu Styles */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(30, 41, 59, 0.98) !important;
        backdrop-filter: blur(12px) !important;
        border-radius: 12px !important;
        margin-top: 12px !important;
        padding: 16px !important;
        border: 1px solid rgba(0, 212, 255, 0.2) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                    0 0 30px rgba(0, 212, 255, 0.2) !important;
        animation: slideDown 0.3s ease !important;
    }

    /* Make both nav groups full-width on mobile */
    .navbar-nav.mx-auto,
    .navbar-nav.ml-auto {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        flex-direction: column !important;
    }

    /* Each nav item takes full row */
    .navbar-nav .nav-item {
        width: 100% !important;
    }

    /* Nav links: row layout, full width, text visible */
    .nav-link-modern {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        padding: 12px 16px !important;
        margin: 3px 0 !important;
        gap: 12px !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    /* Always show the text span - white so it's readable on the dark dropdown */
    .nav-link-modern span {
        display: inline !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #e2e8f0 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Override the default muted link color on mobile */
    .nav-link-modern {
        color: #e2e8f0 !important;
    }

    .nav-item.active .nav-link-modern,
    .nav-item.active .nav-link-modern span {
        color: #00d4ff !important;
    }

    /* Slightly larger icons on mobile for readability */
    .nav-link-modern .nav-icon-animated {
        font-size: 16px !important;
        flex-shrink: 0 !important;
        width: 20px !important;
        text-align: center !important;
    }

    .navbar-nav.ml-auto {
        border-top: 1px solid rgba(0, 212, 255, 0.2) !important;
        padding-top: 16px !important;
        margin-top: 16px !important;
    }

    /* User dropdown full-width on mobile */
    .user-dropdown {
        width: 100% !important;
        justify-content: flex-start !important;
        color: #e2e8f0 !important;
    }

    .user-dropdown span {
        color: #e2e8f0 !important;
    }

    .btn-ghost-modern,
    .btn-cta-modern {
        width: 100% !important;
        margin: 4px 0 !important;
        justify-content: center !important;
    }
}

/* Search Modal Styling */
.modal-search .modal-content {
    background: rgba(30, 41, 59, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
                0 0 40px rgba(0, 212, 255, 0.2) !important;
}

.modal-search .modal-header {
    border-bottom: 1px solid rgba(0, 212, 255, 0.2) !important;
    padding: 20px !important;
}

.modal-search .form-control {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    color: #fff !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

.modal-search .form-control:focus {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: #00d4ff !important;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2),
                0 0 20px rgba(0, 212, 255, 0.4) !important;
}

.modal-search .close {
    color: #94a3b8 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    transition: all 0.3s ease !important;
}

.modal-search .close:hover {
    color: #00d4ff !important;
    transform: rotate(90deg) scale(1.2) !important;
}

/* ========================================
   GLOBAL CUSTOM SCROLLBAR - Sleek dark theme
   Applied to ALL pages via base.html
   ======================================== */

/* Webkit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 14, 39, 0.5);
}

::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00e5ff;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #00d4ff rgba(10, 14, 39, 0.5);
}

/* ========================================
   GLOBAL LAYOUT FIXES - Single Scrollbar & Sticky Header
   Applied to ALL pages via base.html
   ======================================== */
html, body {
    overflow-x: hidden;
}

body > .wrapper {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
}

body > .wrapper > .main-panel {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.perfect-scrollbar-on .main-panel {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Disable perfect-scrollbar containers everywhere */
.ps-container,
.ps {
    overflow: auto !important;
}

.ps__rail-x,
.ps__rail-y {
    display: none !important;
}

/* Sticky navbar */
.navbar-modern {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1050 !important;
}

/* Ensure proper spacing */
body {
    padding-top: 0 !important;
}

.container-fluid {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

/* Remove sidebar for horizontal navbar */
.sidebar {
    display: none !important;
}

.main-panel,
.main-panel .content {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 56px !important;
}

.wrapper {
    padding-top: 0 !important;
}

/* Flexbox layout to push footer to bottom on all pages */
body {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0a0e27 !important;
    background-color: #0a0e27 !important;
}

body > .wrapper > .main-panel,
.main-panel .content {
    background-color: transparent !important;
    background: transparent !important;
}

body > .wrapper {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

body > .wrapper > .main-panel {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Push footer to the bottom */
.modern-footer-isolated {
    margin-top: auto !important;
    margin-bottom: 0 !important;
}

/* Hide the fixed-plugin gear widget (conflicts with chat & buttons) */
.fixed-plugin {
    display: none !important;
}

/* Navbar Items Gap */
.navbar-nav {
    gap: 4px !important;
}

.navbar-nav.ml-auto {
    gap: 12px !important;
}