/* ==========================================================================
   NFGPlus Frontend PWA — Material 3 x Modern Streaming Design System
   ========================================================================== */

:root {
    /* Material 3 Dark Palette Tokens */
    --md-sys-color-background: #111114;
    --md-sys-color-on-background: #E2E2E6;
    --md-sys-color-surface: #111114;
    --md-sys-color-surface-dim: #111114;
    --md-sys-color-surface-container: #1E1E22;
    --md-sys-color-surface-container-high: #28282B;
    --md-sys-color-surface-container-highest: #333338;
    --md-sys-color-on-surface: #E2E2E6;
    --md-sys-color-on-surface-variant: #C4C6D0;
    --md-sys-color-primary: #A8C7FA;
    --md-sys-color-on-primary: #062E6F;
    --md-sys-color-primary-container: #0842A0;
    --md-sys-color-on-primary-container: #D3E3FD;
    --md-sys-color-secondary-container: #4A4458;
    --md-sys-color-on-secondary-container: #E8DEF8;
    --md-sys-color-tertiary-container: #3E4759;
    --md-sys-color-outline: #8E9099;
    --md-sys-color-outline-variant: #44474E;
    
    /* Gradients & Glassmorphism */
    --jellyfin-gradient: linear-gradient(135deg, #aa5cc3, #00a4dc);
    --netflix-accent: #E50914;
    --glass-bg: rgba(30, 30, 34, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-surface: rgba(40, 40, 43, 0.6);

    /* Shape & Elevation Tokens */
    --md-shape-corner-small: 8px;
    --md-shape-corner-medium: 12px;
    --md-shape-corner-large: 16px;
    --md-shape-corner-extra-large: 28px;
    --md-shape-corner-full: 9999px;

    --md-elevation-1: 0 1px 3px rgba(0,0,0,0.3);
    --md-elevation-2: 0 4px 12px rgba(0,0,0,0.4);
    --md-elevation-3: 0 8px 24px rgba(0,0,0,0.5);
    --md-elevation-4: 0 16px 36px rgba(0,0,0,0.6);
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, .hero-title, .brand-title {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-sys-color-outline-variant); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-color-outline); }

/* ── App Layout Structure ─────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* M3 Navigation Rail (Desktop) */
.m3-nav-rail {
    width: 88px;
    background: var(--md-sys-color-surface-container);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    border-right: 1px solid var(--glass-border);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--md-shape-corner-medium);
    margin-bottom: 32px;
}

.m3-nav-items-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.m3-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    width: 100%;
    padding: 6px 0;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.m3-nav-item .icon-wrapper {
    width: 56px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--md-shape-corner-full);
    transition: all 0.2s;
}

.m3-nav-item .label {
    font-size: 0.75rem;
    font-weight: 600;
}

.m3-nav-item.active .icon-wrapper {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.m3-nav-item.active .label {
    color: var(--md-sys-color-on-surface);
}

/* Mobile Bottom Navigation */
.m3-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 68px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
}

/* Main Content Area */
.main-viewport {
    flex: 1;
    margin-left: 88px;
    padding-bottom: 60px;
    position: relative;
}

/* Top App Header & Floating Search Bar */
.top-header {
    position: fixed;
    top: 0;
    left: 88px;
    right: 0;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: linear-gradient(to bottom, rgba(17, 17, 20, 0.9) 0%, rgba(17, 17, 20, 0) 100%);
    backdrop-filter: blur(10px);
    z-index: 40;
    transition: background 0.3s;
}

.m3-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-shape-corner-full);
    padding: 8px 18px;
    width: 100%;
    max-width: 420px;
    transition: all 0.2s;
}

.m3-search-bar:focus-within {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px rgba(168, 199, 250, 0.2);
    background: var(--md-sys-color-surface-container-highest);
}

.m3-search-bar input {
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface);
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    outline: none;
}

.m3-search-bar input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--md-shape-corner-full);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
}

.sync-badge.synced { color: #81C784; background: rgba(129, 199, 132, 0.1); }
.sync-badge.syncing { color: var(--md-sys-color-primary); }
.sync-badge.syncing .spin { animation: spin 1s linear infinite; }
.sync-badge.offline { color: #FFB74D; background: rgba(255, 183, 77, 0.1); }

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

/* ── Hero Cinematic Banner ────────────────────────────────────────────────── */
.hero-banner {
    height: 75vh;
    min-height: 520px;
    max-height: 750px;
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: flex-end;
    padding: 0 48px 64px 48px;
    position: relative;
}

.hero-content {
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}

.hero-logo {
    max-height: 80px;
    max-width: 320px;
    object-fit: contain;
    object-position: left center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.m3-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--md-shape-corner-small);
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: #FFF;
}

.m3-badge.rating { background: #E5A00D; color: #000; }
.m3-badge.type { background: var(--jellyfin-gradient); color: #FFF; }
.m3-badge.quality { border: 1px solid rgba(255,255,255,0.4); background: transparent; }

.hero-overview {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.m3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--md-shape-corner-full);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.m3-btn-filled {
    background: #FFFFFF;
    color: #111114;
}

.m3-btn-filled:hover {
    background: #E2E2E6;
    transform: scale(1.03);
}

.m3-btn-tonal {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #FFFFFF;
}

.m3-btn-tonal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.03);
}

/* ── Content Rows & Horizontal Carousels ─────────────────────────────────── */
.rows-container {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding: 0 48px;
    margin-top: -30px;
    position: relative;
    z-index: 20;
}

.m3-content-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.row-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.row-controls {
    display: flex;
    gap: 8px;
}

.row-btn-nav {
    width: 32px;
    height: 32px;
    border-radius: var(--md-shape-corner-full);
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--glass-border);
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.row-btn-nav:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.row-cards-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 4px 16px 4px;
}

.row-cards-container::-webkit-scrollbar { display: none; }

/* ── Media Card Component ─────────────────────────────────────────────────── */
.m3-media-card {
    flex: 0 0 170px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
}

.m3-media-card:hover {
    transform: translateY(-6px) scale(1.03);
}

.card-poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--md-shape-corner-large);
    overflow: hidden;
    background: var(--md-sys-color-surface-container-high);
    box-shadow: var(--md-elevation-1);
}

.card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    border-radius: var(--md-shape-corner-small);
    font-size: 0.75rem;
    font-weight: 700;
}

.card-badge.rating {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #FFD54F;
    display: flex;
    align-items: center;
    gap: 2px;
}

.card-badge.rating .material-symbols-outlined { font-size: 0.85rem; }

.card-badge-type {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    background: var(--jellyfin-gradient);
    color: #FFF;
    padding: 2px 6px;
    border-radius: var(--md-shape-corner-small);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-year {
    font-size: 0.8rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* ── Live Search View ─────────────────────────────────────────────────────── */
.search-view {
    display: none;
    padding: 96px 48px 48px 48px;
}

.search-view.active { display: block; }

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
}

.m3-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--md-sys-color-on-surface-variant);
    grid-column: 1 / -1;
}

.m3-empty-state .material-symbols-outlined { font-size: 3.5rem; margin-bottom: 12px; }

/* ── Detail Modal / Bottom Sheet ─────────────────────────────────────────── */
.m3-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.m3-modal-backdrop.active { display: flex; }

.m3-modal-sheet {
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--glass-border);
    border-radius: var(--md-shape-corner-extra-large);
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--md-elevation-4);
    animation: modalPop 0.25s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.detail-hero {
    height: 320px;
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #FFF;
    width: 36px;
    height: 36px;
    border-radius: var(--md-shape-corner-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.detail-hero-info h2 { font-size: 2.2rem; color: #FFF; margin-bottom: 8px; }
.detail-badges { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 12px; }

.detail-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-overview {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--md-sys-color-on-surface-variant);
}

/* Episodes List */
.m3-episodes-section { display: flex; flex-direction: column; gap: 16px; }
.episodes-header { display: flex; align-items: center; justify-content: space-between; }
.m3-select {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 8px 16px;
    border-radius: var(--md-shape-corner-medium);
    font-family: inherit;
    outline: none;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.m3-episode-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-shape-corner-large);
    cursor: pointer;
    transition: background 0.2s;
}

.m3-episode-item:hover { background: var(--md-sys-color-surface-container-highest); }

.ep-still-wrapper {
    position: relative;
    width: 140px;
    aspect-ratio: 16/9;
    border-radius: var(--md-shape-corner-medium);
    overflow: hidden;
    flex-shrink: 0;
}

.ep-still { width: 100%; height: 100%; object-fit: cover; }
.ep-play-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.4); color: #FFF; opacity: 0;
    transition: opacity 0.2s;
}
.m3-episode-item:hover .ep-play-overlay { opacity: 1; }

.ep-meta { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ep-meta h4 { font-size: 1rem; color: var(--md-sys-color-on-surface); }
.ep-overview { font-size: 0.85rem; color: var(--md-sys-color-on-surface-variant); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── ExoPlayer In-Browser Overlay (Matching Android XML Exact Layout) ─────── */
.exo-player-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 2000;
    display: none;
}

.exo-player-container.active { display: block; }

#exo-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Controller Overlay (custom_controller_layout.xml) */
#custom_controlss {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 32px;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
}

#custom_controlss.hidden {
    opacity: 0;
    pointer-events: none;
}

#custom_controlss.locked .exo-middle-controls,
#custom_controlss.locked .exo-bottom-panel,
#custom_controlss.locked .exo-top-right-settings {
    display: none !important;
}

/* Top Section (JudulUtama & Setting) */
.exo-top-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

.judulUtama {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 60%;
}

#playerTitleLogo {
    height: 40px;
    object-fit: contain;
    margin-bottom: 4px;
}

#playerTitle {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #CCCCCC;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

#playerEpsTitle {
    font-size: 0.95rem;
    color: #AAAAAA;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.exo-top-right-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exo-btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #FFFFFF;
    width: 44px;
    height: 44px;
    border-radius: var(--md-shape-corner-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.exo-btn-icon:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.08); }
.exo-btn-icon:active { transform: scale(0.95); }

/* Center Controls (btn_bw, btn_play_pause, btn_ff) */
.exo-middle-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.exo-btn-center {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    width: 64px;
    height: 64px;
    border-radius: var(--md-shape-corner-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.exo-btn-center .material-symbols-outlined { font-size: 2rem; }

.exo-btn-center.play-pause {
    width: 84px;
    height: 84px;
    background: var(--jellyfin-gradient);
    border: none;
    box-shadow: 0 0 24px rgba(0, 164, 220, 0.5);
}

.exo-btn-center.play-pause .material-symbols-outlined { font-size: 3rem; }

.exo-btn-center:hover { transform: scale(1.1); }
.exo-btn-center:active { transform: scale(0.92); }

/* Lock Button */
.exo-lock-wrapper {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
}

/* Bottom Strip */
.exo-bottom-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.exo-bottom-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#player_timer {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Seek Bar Style */
.exo-seek-bar {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: height 0.2s;
}

.exo-seek-bar:hover { height: 10px; }

.exo-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    box-shadow: 0 0 6px rgba(0,0,0,0.6);
    cursor: pointer;
}

/* Double tap gesture ripple */
.exo-gesture-ripple {
    position: absolute;
    top: 0;
    width: 40%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #FFF;
    font-weight: 700;
    pointer-events: none;
    animation: rippleFade 0.6s ease-out forwards;
    z-index: 2010;
}

.exo-gesture-ripple.left { left: 0; border-radius: 0 100% 100% 0 / 0 50% 50% 0; }
.exo-gesture-ripple.right { right: 0; border-radius: 100% 0 0 100% / 50% 0 0 50%; }

@keyframes rippleFade {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.1); }
}

/* Speed / Settings dialog popup */
.exo-dialog-menu {
    position: absolute;
    top: 80px;
    right: 32px;
    min-width: 280px;
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--glass-border);
    border-radius: var(--md-shape-corner-large);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2020;
    box-shadow: var(--md-elevation-4);
    animation: fadeIn 0.2s ease;
}

.exo-dialog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.exo-dialog-back {
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
}
.exo-dialog-back:hover { background: var(--md-sys-color-surface-container-high); }

.exo-dialog-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

.exo-dialog-menu h3 { font-size: 1rem; color: var(--md-sys-color-on-surface); margin-bottom: 4px; }

.exo-menu-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface);
    padding: 10px 12px;
    border-radius: var(--md-shape-corner-medium);
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.exo-menu-entry:hover { background: var(--md-sys-color-surface-container-high); }
.exo-menu-entry-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.exo-menu-entry-left .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
}
.exo-menu-entry-info {
    display: flex;
    flex-direction: column;
}
.exo-menu-entry-title {
    font-weight: 600;
    font-size: 0.92rem;
}
.exo-menu-entry-desc {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 2px;
}
.exo-menu-entry-value {
    font-size: 0.85rem;
    color: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.exo-menu-item {
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    padding: 10px 16px;
    border-radius: var(--md-shape-corner-medium);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s ease;
}
.exo-menu-item:hover { background: var(--md-sys-color-surface-container-high); color: #FFF; }
.exo-menu-item.active { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font-weight: 700; }

/* Watermark Brand Logo (Ported from Android nfgpluslogo) */
.exo-watermark {
    position: absolute;
    bottom: 48px;
    right: 24px;
    color: #CCCCCC;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
    z-index: 2004;
}

/* QR Code Overlay (Ported from Android qr_overlay_container) */
.exo-qr-overlay {
    position: absolute;
    bottom: 48px;
    left: 24px;
    width: 140px;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 2025;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #000000;
    animation: fadeIn 0.3s ease;
}
.exo-qr-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.exo-qr-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #000000;
}
.exo-qr-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
}
.exo-qr-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}
.exo-qr-close span {
    font-size: 18px;
}
.exo-qr-link {
    display: block;
    width: 110px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    background: #FFF;
}
.exo-qr-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.exo-qr-hint {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    margin-top: 6px;
    text-align: center;
}

/* Trakteer Live Donation Overlay (Ported from Android trakteer_overlay_container) */
.exo-trakteer-overlay {
    position: absolute;
    top: 24px;
    right: 24px;
    max-width: 360px;
    background: rgba(20, 20, 24, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    z-index: 2030;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: slideInRight 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
.exo-trakteer-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #FFD700;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.exo-trakteer-badge span.material-symbols-outlined {
    font-size: 16px;
}
.exo-trakteer-name {
    color: #FFD700;
    font-size: 1.05rem;
    font-weight: 700;
}
.exo-trakteer-message {
    color: #FFFFFF;
    font-size: 0.95rem;
    line-height: 1.4;
    font-style: italic;
}

@media (max-width: 768px) {
    .exo-watermark {
        bottom: 38px;
        right: 16px;
        font-size: 1.05rem;
    }
    .exo-qr-overlay {
        bottom: 38px;
        left: 16px;
        width: 120px;
        padding: 8px;
    }
    .exo-qr-link {
        width: 95px;
        height: 95px;
    }
    .exo-trakteer-overlay {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
    .exo-dialog-menu {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        min-width: 100%;
        max-width: 100%;
        border-radius: var(--md-shape-corner-large) var(--md-shape-corner-large) 0 0;
        max-height: 70vh;
    }
}

.exo-toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 34, 0.9);
    border: 1px solid var(--glass-border);
    color: #FFF;
    padding: 10px 20px;
    border-radius: var(--md-shape-corner-full);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2050;
}

/* Subtitle Renderer Overlay (High Visibility M3 Style) */
.exo-subtitle-overlay {
    position: absolute;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 85%;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.72);
    color: #FFFFFF;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    line-height: 1.4;
    pointer-events: none;
    z-index: 2010;
    display: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    transition: bottom var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

@media (max-width: 768px) {
    .exo-subtitle-overlay {
        font-size: 1.05rem;
        bottom: 74px;
        max-width: 90%;
        padding: 4px 10px;
    }
}

video::cue {
    visibility: hidden !important;
    opacity: 0 !important;
    background: transparent !important;
    color: transparent !important;
}

/* Buffering Loader */
.exo-buffering {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2005;
}

.exo-buffering .spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Splash Loading Screen ────────────────────────────────────────────────── */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--md-sys-color-background);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s ease;
}

.splash-logo { width: 90px; height: 90px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.splash-title { font-size: 2rem; font-weight: 700; background: var(--jellyfin-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.splash-progress-container {
    width: 280px;
    height: 6px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-shape-corner-full);
    overflow: hidden;
}

.splash-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--jellyfin-gradient);
    border-radius: var(--md-shape-corner-full);
    transition: width 0.2s ease;
}

.splash-status-text {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* ── Mobile Responsive Overrides ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .m3-nav-rail { display: none; }
    .m3-bottom-nav { display: flex; }
    .main-viewport { margin-left: 0; padding-bottom: 80px; }

    .top-header { left: 0; padding: 0 16px; height: 64px; }
    .hero-banner { height: 60vh; min-height: 420px; padding: 0 20px 32px 20px; }
    .hero-title { font-size: 2rem; }
    .hero-overview { -webkit-line-clamp: 2; font-size: 0.9rem; }
    .rows-container { padding: 0 20px; gap: 24px; }
    .m3-media-card { flex: 0 0 135px; }
    .search-view { padding: 80px 20px 48px 20px; }
    .search-results-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }

    /* Player Mobile Portrait Adjustments */
    #custom_controlss { padding: 16px; }
    .judulUtama { max-width: 80%; }
    #playerTitle { font-size: 1.1rem; }
    #playerEpsTitle { font-size: 0.85rem; }
    .exo-middle-controls { gap: 20px; }
    .exo-btn-center { width: 52px; height: 52px; }
    .exo-btn-center.play-pause { width: 68px; height: 68px; }
    .exo-lock-wrapper { left: 16px; }
    .detail-hero { height: 240px; }
}
