/* =========================
   BluePanel - Top Navbar
   - No inline CSS/JS
   - Bootstrap RTL compatible
   ========================= */

.bp-navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-bottom: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 8px 28px rgba(16,24,40,0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1100;
    transition: background 200ms ease, box-shadow 200ms ease, backdrop-filter 200ms ease;
}

.bp-navbar .container {
    gap: 0.75rem;
}

.bp-navbar.bp-navbar--scrolled {
    background: linear-gradient(135deg, rgba(102,126,234,0.92) 0%, rgba(118,75,162,0.92) 55%, rgba(240,147,251,0.92) 100%);
    box-shadow: 0 12px 40px rgba(16,24,40,0.30);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.bp-brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 14px;
    padding: 6px;
    background: rgba(255,255,255,0.14);
    box-shadow: 0 10px 26px rgba(0,0,0,0.20);
}

.bp-brand-title {
    letter-spacing: -0.2px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.22);
}

.bp-navbar .navbar-toggler {
    border: 1px solid rgba(255,255,255,0.36);
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    box-shadow: 0 8px 20px rgba(0,0,0,0.16);
}

.bp-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.18rem rgba(255,255,255,0.25);
}

.bp-nav-link {
    color: rgba(255,255,255,0.92) !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

.bp-nav-link:hover,
.bp-nav-link:focus {
    color: #fff !important;
    background: rgba(255,255,255,0.14);
    transform: translateY(-1px);
}

.bp-nav-link i {
    opacity: 0.95;
}

.bp-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff !important;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    text-decoration: none;
    transition: background 120ms ease, transform 120ms ease;
}

.bp-user-chip:hover,
.bp-user-chip:focus {
    background: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}

.bp-navbar .dropdown-toggle::after {
    vertical-align: middle;
}

.bp-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bp-btn {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(255,255,255,0.22);
}

.bp-btn--glass {
    color: #fff;
    background: rgba(255,255,255,0.10);
}

.bp-btn--glass:hover,
.bp-btn--glass:focus {
    color: #fff;
    background: rgba(255,255,255,0.18);
}

.bp-btn--primary {
    border: none;
    color: #0b1220;
    background: linear-gradient(135deg, #fbbf24 0%, #fde68a 100%);
}

.bp-btn--primary:hover,
.bp-btn--primary:focus {
    filter: brightness(0.97);
}

/* Dropdowns */
.bp-navbar .dropdown-menu.bp-dropdown {
    border: 0;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.20);
    z-index: 1200;
    /*
       IMPORTANT:
       Bootstrap 5 positions dropdowns using Popper by setting a `transform:`
       on the `.dropdown-menu` element.

       If we override `transform` (or `position`) here, Popper can no longer
       place the menu next to its toggle and it will “stick” to the left/top
       of the page (exactly the bug shown in your screenshots).

       So: only animate opacity/visibility, never transform.
    */
    opacity: 0;
    visibility: hidden;
    transition: opacity 160ms ease;
    min-width: 18rem;
    max-width: min(92vw, 24rem);
}

.bp-navbar .dropdown-menu.bp-dropdown.show {
    opacity: 1;
    visibility: visible;
}

.bp-navbar .dropdown-item {
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
}

.bp-navbar .dropdown-item:hover,
.bp-navbar .dropdown-item:focus {
    background: rgba(102,126,234,0.12);
}

.bp-navbar .dropdown-header {
    color: #4f46e5;
    font-weight: 800;
}

/* Fix occasional z-index issues with sticky elements (do NOT touch dropdown positioning) */
.bp-navbar { position: relative; }

@media (max-width: 991.98px) {
    .bp-navbar .navbar-collapse {
        margin-top: 0.75rem;
        padding: 0.8rem;
        border-radius: 16px;
        background: rgba(12, 18, 32, 0.22);
        border: 1px solid rgba(255,255,255,0.18);
        box-shadow: 0 16px 38px rgba(12, 18, 32, 0.28);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .bp-navbar .navbar-nav {
        align-items: stretch !important;
    }

    .bp-nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .bp-user-chip {
        width: 100%;
        justify-content: center;
    }

    .bp-navbar .d-lg-flex {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    .bp-navbar .btn.bp-btn {
        width: 100%;
    }

    .bp-navbar .dropdown {
        width: 100%;
    }

    .bp-navbar .dropdown-menu.bp-dropdown {
        position: static !important;
        transform: none !important;
        inset: auto !important;
        width: 100%;
        max-width: 100%;
        margin-top: 0.5rem;
        box-shadow: 0 10px 26px rgba(0,0,0,0.18);
    }
}
