/* ========================================
   FluentBizz — Shared navbar (partials/navbar.html)
   Self-contained: defines its own palette
   fallbacks so it works on every base
   template, with or without panel-theme.css.
   ======================================== */

:root {
    --fb-primary: #febd2f;
    --fb-secondary: #f4a821;
    --fb-dark: #2c2b30;
    --fb-error: #dc3545;
    --fb-shadow-light: rgba(254, 189, 47, 0.3);
    --fb-shadow-medium: rgba(254, 189, 47, 0.4);
}

.fb-nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    /* Above the sticky panel topbars (.scheduler-topbar / .campaign-topbar
       at z-index 1020) so the user dropdown is never covered; below
       Bootstrap offcanvas (1045) and modals (1055). */
    z-index: 1040;
    animation: fbNavSlideDown 0.4s ease-out;
}

@keyframes fbNavSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fb-nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

/* Fluid variant (panel bases): content stretches to the edges
   up to a sane cap so ultra-wide monitors don't over-stretch. */
.fb-nav-inner-fluid {
    width: 100%;
    max-width: 1600px;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Brand */
.fb-nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.fb-nav-brand img {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.fb-nav-brand:hover img {
    transform: scale(1.05);
}

/* Mobile toggler */
.fb-nav-toggler {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.fb-nav-toggler span {
    width: 100%;
    height: 3px;
    background: var(--fb-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.fb-nav-toggler:hover span {
    background: var(--fb-primary);
}

/* Desktop menu */
.fb-nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fb-nav-menu > li {
    position: relative;
}

.fb-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--fb-dark);
    text-decoration: none;
    font-size: 0.938rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fb-nav-link i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.fb-nav-link:hover {
    color: var(--fb-primary);
    background: rgba(254, 189, 47, 0.1);
}

.fb-nav-link:hover i {
    transform: translateY(-2px);
}

/* Active state */
.fb-nav-link.active,
.fb-nav-link.active:hover {
    color: var(--fb-primary);
    background: rgba(254, 189, 47, 0.12);
}

/* User trigger with avatar */
.fb-nav-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 1rem 0.375rem 0.375rem;
    color: var(--fb-dark);
    text-decoration: none;
    font-size: 0.938rem;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: none !important;
    background: transparent;
    white-space: nowrap;
    /* Kill any native button chrome some platforms draw regardless
       of the border reset above. */
    -webkit-appearance: none;
    appearance: none;
}

/* Bootstrap draws the dropdown caret with border-based triangles
   in currentColor (near-black here) — make it brand amber. */
.fb-nav-user.dropdown-toggle::after {
    border-top-color: var(--fb-primary);
}

/* Hard reset across states: some base templates still carry global
   !important rules from the old navbar that leak onto this button. */
.fb-nav-user:hover,
.fb-nav-user:focus,
.fb-nav-user:focus-visible,
.fb-nav-user:active,
.fb-nav-user.show {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.fb-nav-user:hover,
.fb-nav-user.show {
    background: rgba(254, 189, 47, 0.1) !important;
    color: var(--fb-primary);
}

.fb-nav-user:focus-visible {
    outline: 2px solid var(--fb-primary) !important;
    outline-offset: 2px;
}

.fb-nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fb-primary), var(--fb-secondary));
    color: #fff;
    font-size: 0.813rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 8px var(--fb-shadow-light);
}

/* CTA button (anonymous) */
.fb-nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, var(--fb-primary), var(--fb-secondary));
    color: #fff !important;
    text-decoration: none;
    font-size: 0.938rem;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 4px 15px var(--fb-shadow-light);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fb-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--fb-shadow-medium);
    color: #fff !important;
}

/* Dropdown (reuses Bootstrap .dropdown-menu mechanics).
   !important on padding/background/color: some base templates still
   carry global !important dropdown rules from the removed navbar
   (e.g. clean_internal.html inline styles) that would otherwise win. */
.fb-dropdown-menu {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    padding: 0.5rem !important;
    margin-top: 0.5rem !important;
    min-width: 220px;
    /* Override Bootstrap's blue active/hover defaults with brand colors */
    --bs-dropdown-link-hover-color: var(--fb-primary);
    --bs-dropdown-link-hover-bg: rgba(254, 189, 47, 0.1);
    --bs-dropdown-link-active-color: #8a6400;
    --bs-dropdown-link-active-bg: rgba(254, 189, 47, 0.22);
    --bs-dropdown-link-disabled-color: #adb5bd;
}

.fb-dropdown-menu .dropdown-item {
    padding: 0.625rem 1rem !important;
    margin: 0 !important;
    border-radius: 8px !important;
    font-size: 0.938rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.fb-dropdown-menu .dropdown-item i {
    color: var(--fb-primary);
    transition: color 0.2s ease;
}

.fb-dropdown-menu .dropdown-item:hover {
    background: rgba(254, 189, 47, 0.1) !important;
    color: var(--fb-primary) !important;
}

.fb-dropdown-menu .dropdown-item.active,
.fb-dropdown-menu .dropdown-item:active {
    background: rgba(254, 189, 47, 0.22) !important;
    color: #8a6400 !important;
    font-weight: 600;
}

.fb-dropdown-menu .dropdown-item.active i,
.fb-dropdown-menu .dropdown-item:active i {
    color: var(--fb-primary) !important;
}

.fb-dropdown-menu .dropdown-item.text-danger,
.fb-dropdown-menu .dropdown-item.text-danger i {
    color: var(--fb-error) !important;
}

.fb-dropdown-menu .dropdown-item.text-danger:hover,
.fb-dropdown-menu .dropdown-item.text-danger:focus {
    background: rgba(220, 53, 69, 0.08) !important;
    color: var(--fb-error) !important;
}

.fb-dropdown-menu .dropdown-item.text-danger:hover i,
.fb-dropdown-menu .dropdown-item.text-danger:focus i {
    color: var(--fb-error) !important;
}

.fb-dropdown-menu .dropdown-divider {
    margin: 0.5rem 0;
    opacity: 0.1;
}

.fb-dropdown-header {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a9a9e;
}

/* Mobile offcanvas */
.fb-offcanvas {
    width: 300px !important;
}

.fb-offcanvas .offcanvas-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.fb-offcanvas .offcanvas-header img {
    height: 40px;
    width: auto;
}

.fb-offcanvas .btn-close {
    background-size: 1.25rem;
    opacity: 0.6;
}

.fb-offcanvas .btn-close:hover {
    opacity: 1;
}

.fb-offcanvas .offcanvas-body {
    padding: 1rem 0;
}

.fb-mobile-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0 1rem 0.75rem;
    background: rgba(254, 189, 47, 0.1);
    color: var(--fb-dark);
    font-weight: 600;
    font-size: 0.938rem;
    border-radius: 12px;
}

.fb-mobile-user .fb-nav-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.fb-mobile-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fb-mobile-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--fb-dark);
    text-decoration: none;
    font-size: 0.969rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.fb-mobile-links a i {
    width: 20px;
    font-size: 1.063rem;
    color: var(--fb-primary);
    text-align: center;
}

.fb-mobile-links a:hover {
    background: rgba(254, 189, 47, 0.1);
    color: var(--fb-primary);
}

.fb-mobile-links a.active {
    color: var(--fb-primary);
    background: rgba(254, 189, 47, 0.12);
}

.fb-mobile-links a.text-danger,
.fb-mobile-links a.text-danger i {
    color: var(--fb-error);
}

.fb-mobile-links a.text-danger:hover {
    background: rgba(220, 53, 69, 0.08);
}

.fb-mobile-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 0.5rem 1.5rem;
}

.fb-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.5rem;
    margin: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--fb-primary), var(--fb-secondary));
    color: #fff !important;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--fb-shadow-light);
    transition: all 0.3s ease;
}

.fb-mobile-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--fb-shadow-medium);
}

/* Responsive */
@media (max-width: 991px) {
    .fb-nav-menu {
        display: none;
    }

    .fb-nav-toggler {
        display: flex;
    }

    .fb-nav-inner {
        padding: 0.75rem 1rem;
    }

    .fb-nav-inner-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .fb-nav-brand img {
        height: 40px;
    }
}

@media (max-width: 576px) {
    .fb-nav-inner {
        padding: 0.625rem 1rem;
    }

    .fb-nav-brand img {
        height: 35px;
    }

    .fb-offcanvas {
        width: 270px !important;
    }
}
