/* =============================================================
   Mobile bottom tab bar + random FAB (frontend shell)
   Loaded after layout.css
   ============================================================= */

/* ── Bottom tab bar ── */
#mobile-bottom-nav,
#mobile-bottom-nav.mbn-root {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 64px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(18, 18, 22, 0.72) 0%, rgba(8, 8, 10, 0.96) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#mobile-bottom-nav .mbn-link {
    position: relative;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 14px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

#mobile-bottom-nav .mbn-glow {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    opacity: 0;
    background: radial-gradient(ellipse 80% 80% at 50% 100%, rgba(229, 9, 20, 0.35) 0%, transparent 70%);
    transition: opacity 0.25s ease;
    pointer-events: none;
}

#mobile-bottom-nav .mbn-link--active .mbn-glow {
    opacity: 1;
}

#mobile-bottom-nav .mbn-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

#mobile-bottom-nav .mbn-link--active .mbn-icon-wrap {
    color: #fff;
    background: linear-gradient(145deg, rgba(229, 9, 20, 0.35) 0%, rgba(229, 9, 20, 0.12) 100%);
    border-color: rgba(229, 9, 20, 0.45);
    box-shadow: 0 0 24px rgba(229, 9, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#mobile-bottom-nav .mbn-link:not(.mbn-link--active):active .mbn-icon-wrap {
    transform: scale(0.96);
}

#mobile-bottom-nav .mbn-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}

#mobile-bottom-nav .mbn-link--active .mbn-label {
    color: #fff;
}

#mobile-bottom-nav .mbn-link:not(.mbn-link--active):hover .mbn-icon-wrap {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

/* Match Tailwind md breakpoint — base rule uses flex !important which overrides md:hidden */
@media (min-width: 768px) {
    #mobile-bottom-nav,
    #mobile-bottom-nav.mbn-root {
        display: none !important;
    }
}

@keyframes fabPulse {
    0%,
    100% {
        box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
    }
    50% {
        box-shadow:
            0 4px 24px rgba(139, 92, 246, 0.7),
            0 0 40px rgba(139, 92, 246, 0.15);
    }
}

/* ── Fixed column: random FAB (look only) + back-to-top — one anchor, same as before */
.mfa-stack {
    position: fixed;
    right: 20px;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

/* Random: purple circle + emoji — not separately position:fixed; stacks above back-to-top */
#randomMovieFab {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fabPulse 3s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
    #randomMovieFab {
        display: none !important;
    }
}

.mfa-stack > * {
    pointer-events: auto;
}

#backToTopBtn {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #e50914, #ec4899);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.45), 0 2px 8px rgba(0, 0, 0, 0.4);
    display: none;
    opacity: 0;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(16px) scale(0.85);
}
