/* ═══════════════════════════════════════════════════
   Mobile Hamburger Navigation — ImagineDay
   Shared across all pages with .nav-links
   ═══════════════════════════════════════════════════ */

/* ── Hamburger Button ── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    z-index: 10;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn span + span {
    margin-top: 5px;
}

/* Dark header theme (pricing, character-vault, my-stories) */
.header .hamburger-btn span {
    background: rgba(255, 255, 255, 0.9);
}

/* Light nav theme (create, library, story, etc.) */
.nav .hamburger-btn span {
    background: #1B1B3A;
}

/* Hamburger → X animation */
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5.5px);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5.5px);
}

/* ── Overlay backdrop (appended to body) ── */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(27, 27, 58, 0.45);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* ── Slide-out panel (appended to body, separate from .nav-links) ── */
.mobile-menu-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    padding: 1.2rem 1.8rem 2rem;
    z-index: 9999;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.mobile-menu-panel.dark-theme {
    background: #1B1B3A;
}
.mobile-menu-panel.light-theme {
    background: #fff;
    border-left: 3px solid #FFD166;
}

/* Panel open state */
.mobile-menu-panel.open {
    display: flex;
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
}

/* Close button */
.mobile-menu-panel .mobile-close-btn {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-bottom: 1rem;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu-panel.dark-theme .mobile-close-btn {
    color: rgba(255, 255, 255, 0.5);
}
.mobile-menu-panel.light-theme .mobile-close-btn {
    color: #999;
}
.mobile-menu-panel .mobile-close-btn:hover {
    opacity: 0.7;
}

/* Links in panel */
.mobile-menu-panel a {
    font-size: 1.08rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    padding: 0.85rem 0;
    text-decoration: none;
    display: block;
    transition: color 0.15s;
}

/* Dark theme links */
.mobile-menu-panel.dark-theme a {
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-menu-panel.dark-theme a:hover,
.mobile-menu-panel.dark-theme a.active {
    color: #FFD166;
}

/* Light theme links */
.mobile-menu-panel.light-theme a {
    color: #1B1B3A;
    border-bottom: 1px solid rgba(27, 27, 58, 0.06);
}
.mobile-menu-panel.light-theme a:hover,
.mobile-menu-panel.light-theme a.active {
    color: #EF476F;
}

/* Pro badge styling in panel */
.mobile-menu-panel .pro-badge {
    font-size: 0.85rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(27, 27, 58, 0.06);
    display: block;
    color: #7B2FBE;
    font-weight: 700;
}

/* ── Mobile breakpoint ── */
@media (max-width: 640px) {
    .hamburger-btn {
        display: flex;
    }

    /* Hide desktop nav links */
    .nav-links {
        display: none !important;
    }
}
