/**
 * Mobile header + slide-out menu — dark theme polish, correct z-index stack.
 */

:root {
    --jr-z-mobile-menu-backdrop: 11990;
    --jr-z-mobile-menu-panel: 12000;
}

/* ── Mobile header icon row (bell, messages, menu) ── */
.jr-mobile-header-actions {
    flex-shrink: 0;
    margin-left: auto;
}

.jr-mobile-header-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    color: var(--jr-text-secondary, #a3a3a3);
    background: transparent;
    border: none;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.jr-mobile-header-btn:hover,
.jr-mobile-header-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--jr-text-primary, #fff);
}

.jr-mobile-header-btn--menu {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.jr-mobile-header-btn__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.jr-mobile-header-actions .jr-prefs-root {
    display: inline-flex;
}

.jr-mobile-header-actions .jr-prefs-trigger {
    width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    border-radius: 999px;
}

@media (max-width: 767px) {
    #siteHeader nav {
        height: 4rem;
        min-height: 4rem;
    }

    #siteHeader .jr-mobile-header-actions .jr-prefs-trigger span:not(.fi) {
        display: none;
    }

    [data-jr-theme="spotify"] #siteHeader,
    html[data-jr-theme="spotify"] #siteHeader {
        background: rgba(18, 18, 18, 0.94) !important;
        border-bottom-color: rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    [data-jr-theme="spotify"] #siteHeader .jr-mobile-header-btn,
    html[data-jr-theme="spotify"] #siteHeader .jr-mobile-header-btn {
        color: #e5e5e5;
    }

    [data-jr-theme="spotify"] #siteHeader .jr-mobile-header-btn--menu,
    html[data-jr-theme="spotify"] #siteHeader .jr-mobile-header-btn--menu {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.12);
    }
}

/* ── Drawer shell ── */
.jr-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: var(--jr-z-mobile-menu-panel);
    pointer-events: none;
}

.jr-mobile-menu.is-open {
    pointer-events: auto;
}

.jr-mobile-menu__backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--jr-z-mobile-menu-backdrop);
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.jr-mobile-menu.is-open .jr-mobile-menu__backdrop {
    opacity: 1;
}

.jr-mobile-menu__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--jr-z-mobile-menu-panel);
    width: min(100vw, 22rem);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: #121212;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.55);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.jr-mobile-menu.is-open .jr-mobile-menu__panel {
    transform: translateX(0);
}

.jr-mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #1a1a1a 0%, #121212 100%);
}

.jr-mobile-menu__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.jr-mobile-menu__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.jr-mobile-menu__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.jr-mobile-menu__search {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.jr-mobile-menu__search input[type="text"] {
    background: #242424 !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

.jr-mobile-menu__profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 16px 12px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(29, 185, 84, 0.12) 0%, rgba(243, 152, 26, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.jr-mobile-menu__profile img {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.jr-mobile-menu__profile-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.jr-mobile-menu__profile-link {
    font-size: 0.8125rem;
    color: #1db954;
    text-decoration: none;
    font-weight: 600;
}

.jr-mobile-menu__tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px 14px;
}

.jr-mobile-menu__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 76px;
    padding: 12px 10px;
    border-radius: 14px;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.jr-mobile-menu__tile i {
    font-size: 1.25rem;
    color: #1db954;
}

.jr-mobile-menu__tile:active {
    background: #242424;
    border-color: rgba(29, 185, 84, 0.35);
}

.jr-mobile-menu__tile-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.jr-mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 12px;
}

.jr-mobile-menu__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 12px;
    color: #e5e5e5;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.jr-mobile-menu__link i {
    width: 1.25rem;
    text-align: center;
    color: #a3a3a3;
}

.jr-mobile-menu__link:active,
.jr-mobile-menu__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.jr-mobile-menu__divider {
    height: 1px;
    margin: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
}

.jr-mobile-menu__actions {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jr-mobile-menu__btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 999px;
    background: #f3981a;
    color: #0a0a0a;
    font-size: 0.9375rem;
    font-weight: 800;
    text-decoration: none;
    border: none;
}

.jr-mobile-menu__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.jr-mobile-menu__btn-prefs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin: 0 16px 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.jr-mobile-menu__guest {
    padding: 24px 16px;
}

html.jr-mobile-menu-open {
    overflow: hidden;
}

html.jr-mobile-menu-open body {
    overflow: hidden;
}

[data-jr-theme="light"] .jr-mobile-menu__panel {
    background: #fffbfa;
    border-left-color: #e2e8f0;
}

[data-jr-theme="light"] .jr-mobile-menu__head {
    background: #fff;
    border-bottom-color: #e2e8f0;
}

[data-jr-theme="light"] .jr-mobile-menu__title,
[data-jr-theme="light"] .jr-mobile-menu__profile-name,
[data-jr-theme="light"] .jr-mobile-menu__link {
    color: #0f172a;
}

[data-jr-theme="light"] .jr-mobile-menu__tile {
    background: #fff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-jr-theme="light"] .jr-mobile-menu__search input[type="text"] {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
