/* ==========================================================================
   BB10 Theme — Header, Navigation & Mega-Menu Styles
   ========================================================================== */

/* ── Fixed Header Scroll State ─────────────────────────────────────────── */
.bb-site-header {
    background-color: var(--bb-surface-header, rgba(7, 9, 14, 0.95));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--bb-border, rgba(255, 255, 255, 0.07));
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s ease;
}

.bb-site-header.scrolled {
    background-color: var(--bb-surface-header-scrolled, rgba(7, 9, 14, 0.98));
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px var(--bb-border, rgba(255, 255, 255, 0.04));
}

/* ── Premium Bigg Boss Living Eye Animations ──────────────────────────── */
.bb-logo-eye-svg {
    animation: bbEyeAuraGlow 4s ease-in-out infinite;
    transform-origin: center center;
    will-change: filter, transform;
}

@keyframes bbEyeAuraGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5)) drop-shadow(0 0 20px rgba(220, 38, 38, 0.25));
    }
    50% {
        filter: drop-shadow(0 0 18px rgba(245, 158, 11, 0.85)) drop-shadow(0 0 34px rgba(220, 38, 38, 0.45));
    }
}

/* 1. Subtle, Majestic Living Glance (Iris + Shutter + Pupil) */
.bb-eye-living-core {
    transform-box: fill-box;
    transform-origin: center center;
    animation: bbEyeSmoothGaze 6.5s ease-in-out infinite;
    will-change: transform;
}

@keyframes bbEyeSmoothGaze {
    0%, 20% {
        transform: translate(0, 0);
    }
    28%, 42% {
        transform: translate(-2px, 0.4px);
    }
    48%, 56% {
        transform: translate(0, 0);
    }
    64%, 78% {
        transform: translate(2px, -0.4px);
    }
    84%, 90% {
        transform: translate(0, 0.8px);
    }
    96%, 100% {
        transform: translate(0, 0);
    }
}

/* 2. Pupil Living Breathing Dilation */
.bb-eye-pupil {
    transform-box: fill-box;
    transform-origin: center center;
    animation: bbPupilGentleBreath 3.8s ease-in-out infinite;
    will-change: transform;
}

@keyframes bbPupilGentleBreath {
    0%, 100% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.12);
    }
    75% {
        transform: scale(0.94);
    }
}

/* 3. Cinematic Camera Aperture Tick Rotation */
.bb-eye-ticks {
    transform-box: fill-box;
    transform-origin: center center;
    animation: bbTicksSlowSpin 24s linear infinite;
    will-change: transform;
}

@keyframes bbTicksSlowSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 4. Nebula Core Ambient Heat */
.bb-eye-nebula {
    transform-box: fill-box;
    transform-origin: center center;
    animation: bbNebulaHeat 4s ease-in-out infinite;
    will-change: opacity, transform;
}

@keyframes bbNebulaHeat {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

/* ── Interactive Cursor Hover State ──────────────────────────────────── */
.bb-brand-logo:hover .bb-logo-eye-svg {
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.95)) drop-shadow(0 0 40px rgba(220, 38, 38, 0.6));
    transform: scale(1.05);
}

.bb-brand-logo:hover .bb-eye-living-core {
    animation-play-state: paused;
    transform: translate(0, 0) scale(1.06) !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bb-brand-logo:hover .bb-eye-pupil {
    animation-play-state: paused;
    transform: scale(0.9) !important;
    transition: transform 0.2s ease;
}

.bb-brand-logo:hover .bb-eye-ticks {
    animation-duration: 8s;
}

@media (prefers-reduced-motion: reduce) {
    .bb-logo-eye-svg,
    .bb-eye-living-core,
    .bb-eye-pupil,
    .bb-eye-ticks,
    .bb-eye-nebula {
        animation: none !important;
        transform: none !important;
    }
}

/* ── Desktop Dropdowns & Mega-Menus ────────────────────────────────────── */
.bb-dropdown-menu {
    will-change: opacity, transform;
}

/* Invisible bridge so cursor moving from link to dropdown does not lose hover */
[data-menu]::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
    z-index: 45;
}

/* ── Vote Pulse Ring ─────────────────────────────────────────────────────  */
@keyframes votePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.55); }
    50%       { box-shadow: 0 0 35px rgba(220, 38, 38, 0.85); }
}

/* ── Mobile Slide Drawer & Overlay ────────────────────────────────────────── */
#bb-mobile-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 88vw !important;
    max-width: 360px !important;
    height: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: var(--bb-drawer-bg, #07090e) !important;
    z-index: 99999 !important;
    transform: translateX(-100%);
    will-change: transform;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.9);
}

#bb-mobile-drawer.is-open {
    transform: translateX(0) !important;
}

#bb-drawer-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99990 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#bb-drawer-overlay.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ── <details> summary — remove native marker ────────────────────────────  */
details > summary {
    list-style: none;
    user-select: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

/* ── Mobile Bottom Nav ───────────────────────────────────────────────────  */
#bb-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bb-bottom-tab {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* ── Search Overlay ──────────────────────────────────────────────────────  */
#bb-search-overlay {
    transition: opacity 0.2s ease;
}

#bb-search-overlay.hidden {
    display: none !important;
}

/* ── Scrollbar inside drawer ──────────────────────────────────────────────  */
#bb-mobile-drawer *::-webkit-scrollbar {
    width: 4px;
}

#bb-mobile-drawer *::-webkit-scrollbar-track {
    background: transparent;
}

#bb-mobile-drawer *::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.25);
    border-radius: 10px;
}

/* ── Hide header spacer on sticky behaviour ──────────────────────────────  */
@media (max-width: 767px) {
    /* Desktop nav hidden on mobile — Tailwind md:hidden handles this */
}

/* ── Responsive nav overflow guard ───────────────────────────────────────  */
@media (max-width: 1024px) {
    .bb-site-header [data-menu] .bb-dropdown {
        /* Prevent mega menu overflow on smaller desktops */
        max-width: calc(100vw - 32px);
        right: 0;
        left: auto;
    }
}

/* ── WordPress Admin Bar Compatibility ──────────────────────────────────── */
.admin-bar .bb-site-header {
    top: 32px !important;
}
@media screen and (max-width: 782px) {
    .admin-bar .bb-site-header {
        top: 46px !important;
    }
}

.admin-bar main {
    padding-top: calc(64px + 46px) !important;
}
@media screen and (min-width: 640px) {
    .admin-bar main {
        padding-top: calc(94px + 32px) !important;
    }
}
@media screen and (min-width: 768px) {
    .admin-bar main {
        padding-top: calc(106px + 32px) !important;
    }
}

