/* ============================================================
   HEADER COMPONENT — header.css
   Floating C-Header: Stadium/Pill shape, metallic, solid shadow
   ============================================================ */

/* ── Outer sticky shell ──────────────────────────────────────── */
.bcm-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1280px;
    height: var(--bcm-header-height, 72px);
    border-radius: var(--bcm-radius-pill);
    /* Solid metallic surface so the header looks consistent on all pages */
    background: var(--bcm-metal-bg);
    /* Spec: 6px hard shadow + 1px metallic border */
    box-shadow: var(--bcm-shadow);
    border: var(--bcm-metal-border);
    z-index: 1000;
    transition:
        box-shadow var(--bcm-transition),
        filter     var(--bcm-transition),
        height     0.2s ease;
}

.bcm-header.is-scrolled {
    box-shadow: 4px 4px 0px var(--bcm-shadow-color);
}

/* Header hover glow */
.bcm-header:hover {
    filter: drop-shadow(0 0 6px var(--bcm-primary-glow));
}

/* Prevent the glow-hover scale from deforming the fixed header */
.bcm-header:active {
    transform: translateX(-50%) !important;
}

/* ── Inner flex container ────────────────────────────────────── */
.bcm-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 16px;
    /* Extra side padding so content clears the pill curve */
    padding-left: 28px;
    padding-right: 20px;
}

/* ── Logo ────────────────────────────────────────────────────── */
.bcm-header__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.bcm-header__logo img,
.bcm-header__logo .custom-logo {
    max-height: calc(var(--bcm-header-height, 72px) - 24px);
    width: auto;
    object-fit: contain;
}

.bcm-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bcm-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

/* ── Nav (center) ────────────────────────────────────────────── */
.bcm-header__nav {
    flex: 1 1 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    /* Must be visible — button box-shadows must render outside nav bounds */
    overflow: visible;
    padding: 6px 8px;
}

.bcm-nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    /* Single row, no wrapping */
    flex-wrap: nowrap;
    /* No overflow clipping — all box-shadows must show on all four sides */
    overflow: visible;
    white-space: nowrap;
    /* bottom padding gives the 3px drop-shadow full room to render */
    padding: 4px 2px 7px;
    list-style: none;
    margin: 0;
}

.bcm-nav-menu li {
    position: relative;
}

.bcm-nav-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bcm-text);
    border-radius: 40px;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background var(--bcm-transition),
        color      var(--bcm-transition),
        box-shadow var(--bcm-transition);
}

.bcm-nav-menu a:hover,
.bcm-nav-menu .current-menu-item > a,
.bcm-nav-menu .current-menu-ancestor > a {
    background: var(--bcm-primary);
    color: #ffffff;
    box-shadow: 3px 3px 0px var(--bcm-shadow-color);
}

/* Sub-menu (dropdown) */
.bcm-nav-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: var(--bcm-metal-bg);
    border-radius: 20px;
    /* Spec: 6px hard shadow + 1px metallic border */
    box-shadow: var(--bcm-shadow);
    border: var(--bcm-metal-border);
    padding: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.bcm-nav-menu li:hover > .sub-menu,
.bcm-nav-menu li:focus-within > .sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.bcm-nav-menu .sub-menu a {
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* ── Right Controls ──────────────────────────────────────────── */
.bcm-header__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Icon button ─────────────────────────────────────────────── */
/* Bulb-Click pop on every header button */
.bcm-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bcm-metal-bg);
    box-shadow: var(--bcm-shadow);
    color: var(--bcm-text);
    position: relative;          /* allows badge / tooltip absolute positioning */
    transition:
        filter     var(--bcm-transition),
        transform  var(--bcm-transition),
        box-shadow var(--bcm-transition);
    border: none;
    cursor: pointer;
}

.bcm-btn-icon:hover {
    filter: drop-shadow(0 0 var(--bcm-glow-intensity) var(--bcm-primary-glow));
}

.bcm-btn-icon:active {
    transform: scale(1.05);
    box-shadow: 2px 2px 0px var(--bcm-shadow-color);
}

/* ── Theme toggle icons ─────────────────────────────────────── */
.bcm-theme-icon { font-style: normal; font-size: 1rem; }
[data-theme="light"] .bcm-theme-icon--dark   { display: none; }
[data-theme="dark"]  .bcm-theme-icon--light  { display: none; }
[data-theme="dark"]  .bcm-theme-icon--dark   { display: inline; }
[data-theme="light"] .bcm-theme-icon--light  { display: inline; }

/* ── Hamburger ───────────────────────────────────────────────── */
.bcm-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    width: auto;
    height: auto;
    border-radius: 40px;
}

.bcm-hamburger__line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--bcm-text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ── Mobile Navigation drawer ────────────────────────────────── */
.bcm-mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    height: 100%;
    background: var(--bcm-metal-bg);
    padding: 80px 24px 40px;
    z-index: 1100;
    transform: translateX(110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.bcm-mobile-nav.is-open {
    transform: translateX(0);
}

.bcm-mobile-nav__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bcm-primary);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: var(--bcm-shadow);
    border: none;
    cursor: pointer;
    /* 360-degree spin animation on open */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bcm-mobile-nav.is-open .bcm-mobile-nav__close {
    transform: rotate(360deg);
}

.bcm-mobile-nav__close:hover { transform: rotate(360deg) scale(1.1); }
.bcm-mobile-nav__close:active { transform: rotate(360deg) scale(1.05); }

.bcm-mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bcm-mobile-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--bcm-text);
    border-radius: 12px;
    text-decoration: none;
    transition: background var(--bcm-transition), color var(--bcm-transition);
}

.bcm-mobile-menu a:hover {
    background: var(--bcm-primary);
    color: #fff;
}

.bcm-mobile-menu .sub-menu a {
    padding-left: 32px;
    font-size: 0.9rem;
}

/* ── Overlay backdrop ────────────────────────────────────────── */
.bcm-overlay-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bcm-overlay-bg.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bcm-header {
        width: calc(100% - 24px);
        top: 8px;
    }

    .bcm-header__nav { display: none; }

    .bcm-hamburger { display: flex; }
}
/* On mobile: theme toggle + notif bell live inside the drawer instead */
@media (max-width: 768px) {
    #bcm-theme-toggle,
    .bcm-notif-wrap { display: none !important; }
}

/* ── Mobile Utility Row (inside drawer, logged-in) ───────────── */
.bcm-mob-util-row {
    display: flex;
    gap: 10px;
    padding: 0 0 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(128,128,128,.2);
}

/* Guest: single theme button — don't let it stretch full width */
.bcm-mob-util-row--guest {
    justify-content: flex-start;
}
.bcm-mob-util-row--guest .bcm-mob-util-btn {
    flex: 0 0 auto;
    min-width: 96px;
}

.bcm-mob-util-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    border-radius: 14px;
    background: var(--bcm-metal-bg);
    border: var(--bcm-metal-border);
    box-shadow: var(--bcm-shadow);
    color: var(--bcm-text);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background var(--bcm-transition), filter var(--bcm-transition);
    position: relative;
}

.bcm-mob-util-btn:hover {
    filter: drop-shadow(0 0 5px var(--bcm-primary-glow));
    color: var(--bcm-primary);
}

.bcm-mob-util-btn:active {
    transform: scale(0.97);
    box-shadow: 2px 2px 0 var(--bcm-shadow-color);
}

.bcm-mob-util-label {
    font-weight: 600;
    letter-spacing: .02em;
}

.bcm-mob-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Auth Buttons — Log In / Sign Up  (match BCM metallic style) ──
───────────────────────────────────────────────────────────── */
.bcm-btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    border-radius: var(--bcm-radius-pill, 50px);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition:
        filter     var(--bcm-transition),
        transform  var(--bcm-transition),
        box-shadow var(--bcm-transition);
}

.bcm-btn-login {
    background: var(--bcm-metal-bg);
    border: var(--bcm-metal-border);
    box-shadow: var(--bcm-shadow);
    color: var(--bcm-text);
}
.bcm-btn-login:hover {
    filter: drop-shadow(0 0 var(--bcm-glow-intensity, 6px) var(--bcm-primary-glow));
    color: var(--bcm-primary);
}
.bcm-btn-login:active {
    transform: scale(0.97);
    box-shadow: 2px 2px 0px var(--bcm-shadow-color);
}

.bcm-btn-signup {
    background: var(--bcm-primary, #3b82f6);
    border: 1.5px solid var(--bcm-primary, #3b82f6);
    box-shadow: var(--bcm-shadow);
    color: #fff;
}
.bcm-btn-signup:hover {
    filter: drop-shadow(0 0 var(--bcm-glow-intensity, 6px) var(--bcm-primary-glow));
    transform: translateY(-1px);
    color: #fff;
}
.bcm-btn-signup:active {
    transform: scale(0.97);
    box-shadow: 2px 2px 0px var(--bcm-shadow-color);
}

@media (max-width: 540px) {
    .bcm-btn-auth { height: 32px; padding: 0 12px; font-size: 0.74rem; }
}

/* Hide desktop auth buttons on mobile — they live inside the drawer instead */
@media (max-width: 768px) {
    .bcm-btn-auth { display: none; }
}

/* ── Mobile auth buttons (inside the nav drawer) ─────────────────── */
.bcm-mobile-auth-btns {
    display: flex;
    gap: 10px;
    padding: 16px 0 0;
    margin-top: 14px;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.bcm-mobile-auth-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid rgba(128, 128, 128, 0.25);
    color: var(--bcm-text);
    background: var(--bcm-metal-bg);
    transition: background var(--bcm-transition), color var(--bcm-transition);
}

.bcm-mobile-login-btn:hover {
    color: var(--bcm-primary);
    border-color: var(--bcm-primary);
}

.bcm-mobile-signup-btn {
    background: var(--bcm-primary);
    border-color: var(--bcm-primary);
    color: #fff;
}

.bcm-mobile-signup-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* ─────────────────────────────────────────────────────────────
   User Avatar + Dropdown
───────────────────────────────────────────────────────────── */
.bcm-user-menu-wrap {
    position: relative;
}

.bcm-user-btn {
    padding: 0;
    overflow: visible;   /* allow box-shadow border to show */
    width: 36px;
    height: 36px;
}

.bcm-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.bcm-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 160px;
    background: var(--bcm-metal-bg);
    border-radius: 10px;
    box-shadow: var(--bcm-shadow);
    padding: 8px 0;
    display: none;
    z-index: 1200;
    border: 1px solid rgba(255,255,255,0.08);
    animation: bcm-dropdown-in 0.15s ease;
}

.bcm-user-dropdown.open { display: block; }

@keyframes bcm-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bcm-user-drop-name {
    padding: 8px 16px 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bcm-text);
    opacity: 0.6;
    border-bottom: 1px solid rgba(128,128,128,0.2);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.bcm-user-dropdown a {
    display: block;
    padding: 7px 16px;
    font-size: 0.84rem;
    color: var(--bcm-text);
    text-decoration: none;
    transition: background 0.15s;
}

.bcm-user-dropdown a:hover {
    background: rgba(108,99,255,0.1);
    color: var(--bcm-primary, #6c63ff);
}