/* ==========================================================================
   VidStream — Netflix-Exact Design System
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --nf-black: #141414;
    --nf-dark: #181818;
    --nf-surface: #1a1a1a;
    --nf-elevated: #232323;
    --nf-card: #2f2f2f;
    --nf-red: #e50914;
    --nf-red-hover: #f6121d;
    --nf-white: #e5e5e5;
    --nf-gray: #808080;
    --nf-gray-light: #b3b3b3;
    --nf-gray-dark: #333;
    --nf-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --nf-radius: 4px;
    --nf-radius-lg: 6px;
    --nf-transition: 0.2s ease;
    --nf-shadow: 0 3px 10px rgba(0,0,0,.75);
    --nf-shadow-lg: 0 8px 40px rgba(0,0,0,.9);
    --nf-header-h: 68px;
    --nf-row-padding: 4%;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--nf-font);
    background: var(--nf-black);
    color: var(--nf-white);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.4;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ---------- Loading Screen ---------- */
.nf-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: var(--nf-black);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.nf-loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.nf-loading-logo {
    height: 120px;
    animation: nfPulse 1.5s infinite alternate ease-in-out;
}

@media (max-width: 768px) {
    .nf-loading-logo { height: 80px; }
}

@keyframes nfPulse {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.1); opacity: 1; }
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }

/* ==========================================================================
   Header / Navbar
   ========================================================================== */
.nf-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nf-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--nf-row-padding);
    background: linear-gradient(180deg, rgba(0,0,0,.75) 10%, rgba(0,0,0,.3) 50%, transparent);
    transition: background 0.45s ease;
}

.nf-header.scrolled {
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.nf-header__left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

.nf-header__center {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.nf-logo {
    height: 45px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nf-logo:hover {
    transform: scale(1.05);
}

@media (min-width: 1100px) {
    .nf-logo { height: 55px; }
}

.nf-nav {
    display: none;
    gap: 18px;
}

@media (min-width: 885px) {
    .nf-nav { display: flex; }
}

.nf-nav__link {
    font-size: 14px;
    font-weight: 500;
    color: var(--nf-gray-light);
    transition: all var(--nf-transition);
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 20px;
}

.nf-nav__link:hover,
.nf-nav__link.active {
    color: #fff;
}

.nf-nav__link.active {
    background: rgba(255,255,255,.15);
    color: #fff;
}

.nf-header__right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

/* Header icon button (QR, etc.) */
.nf-header__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.nf-header__icon-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .nf-header__icon-btn {
        display: none;
    }
}

/* Standalone search icon in new design */
.nf-search-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #fff;
    margin-right: 10px;
}

/* Search bar */
.nf-search {
    display: flex;
    align-items: center;
    position: relative;
}

.nf-search__icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #fff;
    z-index: 2;
    transition: transform var(--nf-transition);
}

.nf-search__input {
    width: 0;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-family: var(--nf-font);
    outline: none;
    transition: all 0.3s ease;
}

.nf-search.open .nf-search__input {
    width: 250px;
    padding: 7px 12px 7px 36px;
    border-color: #fff;
    background: rgba(0,0,0,.85);
}

.nf-search.open .nf-search__icon {
    position: absolute;
    left: 8px;
}

@media (max-width: 884px) {
    .nf-search { display: none; }
}

/* Notification bell */
.nf-notif-btn {
    position: relative;
    color: #fff;
}

.nf-notif-btn svg { width: 24px; height: 24px; }

/* Profile avatar */
.nf-profile {
    position: relative;
    flex-shrink: 0;
}

.nf-profile__avatar {
    width: 32px;
    height: 32px;
    max-width: none;
    flex: none;
    border-radius: var(--nf-radius);
    cursor: pointer;
    transition: outline var(--nf-transition);
}

.nf-profile__caret {
    width: 16px; height: 16px;
    margin-left: -2px;
    transition: transform var(--nf-transition);
    color: #fff;
}

.nf-profile:hover .nf-profile__caret {
    transform: rotate(180deg);
}

/* Profile dropdown */
.nf-profile__dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: rgba(20,20,20,.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--nf-radius);
    padding: 10px 0;
    display: none;
    z-index: 200;
    box-shadow: var(--nf-shadow-lg);
    animation: nfDropdownIn 0.25s ease;
    left: 0;
    right: auto;
}

@media (max-width: 768px) {
    .nf-profile__dropdown {
        position: fixed;
        top: var(--nf-header-h);
        left: var(--nf-row-padding);
        right: auto;
        width: 200px;
    }
}

@keyframes nfDropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.nf-profile:hover .nf-profile__dropdown,
.nf-profile:focus-within .nf-profile__dropdown {
    display: block;
}

.nf-profile__dropdown::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 20px;
    border: 7px solid transparent;
    border-bottom-color: rgba(255,255,255,.9);
}

.nf-profile__dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--nf-gray-light);
    transition: background var(--nf-transition);
    cursor: pointer;
}

.nf-profile__dropdown-item:hover {
    text-decoration: underline;
}

.nf-profile__dropdown-item img {
    width: 32px; height: 32px; border-radius: var(--nf-radius);
}

.nf-profile__dropdown-divider {
    border-top: 1px solid rgba(255,255,255,.15);
    margin: 6px 0;
}

/* Mobile menu button */
.nf-mobile-menu-btn {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 14px;
    gap: 4px;
}

@media (min-width: 885px) {
    .nf-mobile-menu-btn { display: none; }
}

.nf-mobile-nav {
    display: none;
    position: fixed;
    top: var(--nf-header-h);
    left: 0;
    right: 0;
    background: rgba(0,0,0,.93);
    border-bottom: 1px solid rgba(255,255,255,.1);
    z-index: 99;
    padding: 15px var(--nf-row-padding);
}

.nf-mobile-nav.active {
    display: block;
}

.nf-mobile-nav a {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    color: var(--nf-gray-light);
}

.nf-mobile-nav a:hover,
.nf-mobile-nav a.active { color: #fff; }

/* Mobile header/nav polish ------------------------------------------------- */
@media (max-width: 884px) {
    .nf-header {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--nf-header-h) + env(safe-area-inset-top));
        background: linear-gradient(180deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 65%, transparent);
    }
    .nf-header.scrolled {
        background: rgba(20, 20, 20, 0.96);
    }
    .nf-mobile-menu-btn {
        min-height: 44px;
        padding: 0 10px;
        border-radius: var(--nf-radius);
    }
    .nf-mobile-nav {
        top: calc(var(--nf-header-h) + env(safe-area-inset-top));
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        background: rgba(0,0,0,.96);
        animation: nfMobileNavIn 0.25s ease;
    }
    .nf-mobile-nav a {
        padding: 13px 0;
        font-size: 16px;
        font-weight: 500;
    }
    @keyframes nfMobileNavIn {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ==========================================================================
   Section Switching
   ========================================================================== */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: nfFadeIn 0.3s ease;
}

@keyframes nfFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   Your Next Watch (Replaces Billboard)
   ========================================================================== */
.nf-next-watch {
    padding: 0 var(--nf-row-padding);
    padding-top: calc(var(--nf-header-h) + 32px);
    margin-bottom: 30px;
    position: relative;
    z-index: 5;
}

.nf-next-watch__carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Hide scrollbar */
}
.nf-next-watch__carousel::-webkit-scrollbar { display: none; }

.nf-next-watch__card {
    flex: 0 0 160px;
    height: 240px;
    position: relative;
    border-radius: var(--nf-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    scroll-snap-align: start;
    background: var(--nf-elevated);
}

@media (min-width: 800px) {
    .nf-next-watch__card { flex: 0 0 200px; height: 300px; }
}

.nf-next-watch__card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

/* The Expanded Active Card */
.nf-next-watch__card.active {
    flex: 0 0 70%;
    max-width: 800px;
    cursor: default;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
@media (max-width: 799px) {
    .nf-next-watch__card.active { flex: 0 0 85%; }
}

.nf-next-watch__active-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    background: linear-gradient(0deg, rgba(20,20,20,0.9) 0%, rgba(20,20,20,0) 50%);
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
    pointer-events: none;
}
.nf-next-watch__card.active .nf-next-watch__active-info {
    opacity: 1;
    pointer-events: auto;
}

.nf-next-watch__title-text {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 800;
    margin-bottom: 12px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.nf-next-watch__badges {
    display: flex;
    gap: 8px;
    align-items: center;
}
.nf-next-watch__badge {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(5px);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nf-next-watch__badge--red {
    background: var(--nf-red);
}

.nf-next-watch__meta {
    margin-top: 20px;
    max-width: 800px;
    padding: 0 5px;
}
.nf-next-watch__tags {
    color: var(--nf-gray-light);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nf-next-watch__desc {
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile: tighten the Next Watch hero so the expanded card and its meta fit a phone */
@media (max-width: 799px) {
    .nf-next-watch {
        padding-top: calc(var(--nf-header-h) + 16px);
        margin-bottom: 18px;
    }
    .nf-next-watch__carousel {
        gap: 8px;
        scroll-snap-type: x proximity;
    }
    .nf-next-watch__card {
        height: 220px;
    }
    .nf-next-watch__title-text {
        font-size: clamp(16px, 4.5vw, 24px);
        margin-bottom: 8px;
    }
    .nf-next-watch__badges {
        gap: 5px;
    }
    .nf-next-watch__badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    .nf-next-watch__active-info {
        padding: 12px;
    }
    .nf-next-watch__meta {
        margin-top: 12px;
    }
    .nf-next-watch__desc {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.nf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: var(--nf-radius);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    transition: all var(--nf-transition);
}

@media (max-width: 768px) {
    .nf-btn { padding: 6px 16px; font-size: 14px; }
}

.nf-btn svg { width: 24px; height: 24px; }

.nf-btn--play {
    background: #fff;
    color: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nf-btn--play:hover { 
    background: rgba(255,255,255,.75); 
    transform: scale(1.02);
}

.nf-btn--info {
    background: rgba(109,109,110,.7);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.nf-btn--info:hover { 
    background: rgba(109,109,110,.4); 
    transform: scale(1.02);
}



/* ==========================================================================
   Content Rows
   ========================================================================== */
.nf-row {
    position: relative;
    margin-bottom: 2vw;
    padding: 0;
}

.nf-row__header {
    display: flex;
    align-items: baseline;
    padding: 0 var(--nf-row-padding);
    margin-bottom: 4px;
}

.nf-row__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--nf-white);
    transition: color var(--nf-transition);
}

@media (min-width: 1100px) {
    .nf-row__title { font-size: 20px; }
}

.nf-row__explore {
    font-size: 12px;
    color: #54b9c5;
    margin-left: 8px;
    opacity: 0;
    transition: opacity var(--nf-transition), transform var(--nf-transition);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.nf-row__explore svg {
    transition: transform 0.3s ease;
}

.nf-row:hover .nf-row__explore {
    opacity: 1;
}

.nf-row__explore:hover svg {
    transform: translateX(3px);
}

/* Mobile: hide hover-only "Explore All", tighten row spacing, and add touch snap */
@media (max-width: 768px) {
    .nf-row__explore {
        display: none;
    }
    .nf-row {
        margin-bottom: 5vw;
    }
    .nf-row__title {
        font-size: 15px;
    }
    .nf-slider__track {
        scroll-snap-stop: always;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}
@media (max-width: 480px) {
    .nf-row__title {
        font-size: 14px;
    }
    .nf-row__header {
        padding: 0 4%;
    }
    #homeRows {
        margin-top: 20px !important;
    }
}

/* Slider container */
.nf-slider {
    position: relative;
    overflow: visible;
}

.nf-slider__track {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px var(--nf-row-padding);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    align-items: stretch;
}

.nf-slider__track::-webkit-scrollbar { display: none; }

/* Scroll arrows */
.nf-slider__arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20,20,20,.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    border: none;
}

.nf-row:hover .nf-slider__arrow {
    opacity: 1;
}

.nf-slider__arrow:hover {
    background: rgba(20,20,20,.85);
    transform: scale(1.05);
}

.nf-slider__arrow--left { left: 0; border-radius: 0 var(--nf-radius) var(--nf-radius) 0; }
.nf-slider__arrow--right { right: 0; border-radius: var(--nf-radius) 0 0 var(--nf-radius); }

.nf-slider__arrow svg { width: 36px; height: 36px; }

/* ==========================================================================
   Movie Card (Accordion Style)
   ========================================================================== */
.nf-card {
    flex: 0 0 calc((100% - 30px) / 6);
    height: 260px;
    scroll-snap-align: start;
    position: relative;
    cursor: pointer;
    border-radius: var(--nf-radius);
    overflow: hidden;
    transition: flex 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    background: var(--nf-elevated);
}

@media (max-width: 1399px) { .nf-card { flex: 0 0 calc((100% - 24px) / 5); height: 230px; } }
@media (max-width: 1099px) { .nf-card { flex: 0 0 calc((100% - 18px) / 4); height: 200px; } }
@media (max-width: 799px) { .nf-card { flex: 0 0 calc((100% - 12px) / 3); height: 160px; } }
@media (max-width: 499px) { .nf-card { flex: 0 0 calc((100% - 6px) / 2); height: 140px; } }

.nf-slider__track:hover .nf-card {
    flex: 0 0 calc(10% - 6px); /* Shrink others */
    transition-delay: 0.4s;
}

@media (min-width: 800px) {
    .nf-slider__track .nf-card:hover {
        flex: 0 0 calc(35% - 6px); /* Expand hovered */
        transition-delay: 0.4s;
    }
}

/* Touch devices (and narrow screens): disable the accordion hover shrink/expand
   and hover preview overlay so rows stay as plain scrolling cards on mobile. */
@media (max-width: 799px) {
    .nf-slider__track:hover .nf-card,
    .nf-slider__track .nf-card:hover {
        flex: 0 0 calc((100% - 12px) / 3);
        transition-delay: 0s;
    }
    .nf-card:hover .nf-card__img,
    .nf-card:hover .nf-card__preview {
        opacity: 1;
        transition-delay: 0s;
    }
    .nf-card__preview {
        display: none;
    }
}
@media (max-width: 499px) {
    .nf-slider__track:hover .nf-card,
    .nf-slider__track .nf-card:hover {
        flex: 0 0 calc((100% - 6px) / 2);
    }
}

.nf-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: opacity 0.4s ease;
}

.nf-card:hover .nf-card__img {
    opacity: 0;
    transition-delay: 0.4s;
}

/* ---------- Hover Preview Card ---------- */
.nf-card__preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(20,20,20,1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.nf-card:hover .nf-card__preview {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.4s;
}

.nf-continue-card {
    flex: 0 0 210px;
    height: 120px;
    scroll-snap-align: start;
}

@media (min-width: 1100px) { .nf-continue-card { flex: 0 0 240px; height: 135px; } }

.nf-continue-card__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(255,255,255,.35);
    pointer-events: none;
}

.nf-continue-card__progress-fill {
    height: 100%;
    background: var(--nf-red);
}

.nf-continue-card__ep {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.72);
    border-left: 3px solid var(--nf-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 3px 7px;
    border-radius: 3px;
    pointer-events: none;
}

.nf-continue-card__resume {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 3px;
    pointer-events: none;
}

.nf-continue-card:hover .nf-continue-card__progress,
.nf-continue-card:hover .nf-continue-card__ep,
.nf-continue-card:hover .nf-continue-card__resume {
    opacity: 0;
}

.nf-card__preview-img {
    width: 100%;
    height: 55%;
    object-fit: cover;
    display: block;
}

.nf-card__preview-body {
    padding: 8px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to bottom, rgba(20,20,20,0) 0%, rgba(20,20,20,1) 30%);
    margin-top: -30px;
    position: relative;
    z-index: 2;
}

.nf-card__preview-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.nf-card__preview-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.4);
    background: rgba(42,42,42,.6);
    color: #fff;
    transition: all 0.25s ease;
}

.nf-card__preview-btn:hover {
    border-color: #fff;
    background: rgba(255,255,255,.15);
    transform: scale(1.1);
}

.nf-card__preview-btn--play {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nf-card__preview-btn--play:hover {
    background: rgba(255,255,255,.85);
}

.nf-card__preview-btn--remove {
    border-color: var(--nf-red);
    background: var(--nf-red);
    color: #fff;
}

.nf-card__preview-btn--remove:hover {
    border-color: var(--nf-red-hover);
    background: var(--nf-red-hover);
}

.nf-card__preview-btn--expand {
    margin-left: auto;
}

.nf-card__preview-btn svg { width: 20px; height: 20px; }

.nf-card__preview-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.nf-match {
    color: #46d369;
    font-weight: 700;
}

.nf-maturity {
    padding: 1px 5px;
    border: 1px solid rgba(255,255,255,.4);
    font-size: 11px;
    font-weight: 600;
}

.nf-badge {
    padding: 1px 4px;
    border: 1px solid rgba(255,255,255,.4);
    font-size: 10px;
    font-weight: 700;
}

.nf-new-badge {
    background: var(--nf-red);
    color: #fff;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 2px;
    text-transform: uppercase;
}

.nf-card__preview-genres {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 11px;
    color: var(--nf-gray-light);
}

.nf-card__preview-genres span.dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--nf-gray);
    display: inline-block;
}

/* Top 10 Row — Netflix signature large rank numbers */
.nf-top10-card {
    flex: 0 0 calc((100% - 30px) / 6);
    height: 260px;
    scroll-snap-align: start;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: stretch;
    overflow: visible;
    background: transparent;
}

@media (max-width: 1399px) { .nf-top10-card { flex: 0 0 calc((100% - 24px) / 5); height: 230px; } }
@media (max-width: 1099px) { .nf-top10-card { flex: 0 0 calc((100% - 18px) / 4); height: 200px; } }
@media (max-width: 799px) { .nf-top10-card { flex: 0 0 calc((100% - 12px) / 3); height: 160px; } }
@media (max-width: 499px) { .nf-top10-card { flex: 0 0 calc((100% - 6px) / 2); height: 140px; } }

.nf-top10-card__rank {
    position: relative;
    flex: 0 0 45%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: clamp(100px, 14vw, 200px);
    font-weight: 900;
    line-height: 0.8;
    color: transparent;
    -webkit-text-stroke: 3px rgba(255,255,255,.3);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    user-select: none;
    pointer-events: none;
    padding-bottom: 5px;
}

.nf-top10-card__poster {
    flex: 1;
    position: relative;
    border-radius: var(--nf-radius);
    overflow: hidden;
    margin-left: -15px;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(.25,1,.5,1), box-shadow 0.3s ease;
}

.nf-top10-card:hover .nf-top10-card__poster {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0,0,0,.6);
}

.nf-top10-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nf-top10-card__badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--nf-red);
    color: #fff;
    font-size: 7px;
    font-weight: 900;
    padding: 2px 4px;
    border-radius: 2px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.nf-top10-card__badge span:last-child {
    font-size: 12px;
}

/* Category grid */
.nf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    padding: 0 var(--nf-row-padding);
}

@media (max-width: 600px) {
    .nf-grid { grid-template-columns: repeat(2, 1fr); }
}

.nf-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--nf-gray);
}

.nf-empty h2 {
    font-size: 20px;
    color: var(--nf-white);
    margin-bottom: 8px;
}

/* Grid card overrides — cards in grid should fill cells, not use flex-basis */
.nf-grid .nf-card {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
}

.nf-grid .nf-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.nf-grid .nf-card__preview {
    position: absolute;
    inset: 0;
}

/* Disable accordion shrink/expand in grids */
.nf-grid:hover .nf-card {
    flex: none;
}

.nf-grid .nf-card:hover {
    flex: none;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 8px 30px rgba(0,0,0,0.7);
    transition: transform 0.3s cubic-bezier(.25,1,.5,1), box-shadow 0.3s ease;
}

/* ==========================================================================
   Detail Modal (More Info)
   ========================================================================== */
.nf-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 150;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2vh;
    overflow-y: auto;
    transition: opacity 0.3s ease;
}

.nf-detail-overlay.active { display: flex; }

.nf-detail {
    width: 95%;
    max-width: 850px;
    background: rgba(20,20,20,.98);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 5vh;
    position: relative;
    box-shadow: 0 20px 80px rgba(0,0,0,0.8);
    animation: nfModalSlideUp 0.4s cubic-bezier(.25,.1,.25,1);
}

@keyframes nfModalSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.nf-detail__hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.nf-detail__hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nf-detail__hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(transparent, var(--nf-dark));
}

.nf-detail__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(20,20,20,.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 18px;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}

.nf-detail__close:hover {
    background: rgba(255,255,255,.15);
    transform: rotate(90deg) scale(1.1);
}

.nf-detail__hero-info {
    position: absolute;
    bottom: 20px;
    left: 24px;
    right: 24px;
    z-index: 5;
}

.nf-detail__hero-title {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 900;
    margin-bottom: 10px;
}

.nf-detail__hero-buttons {
    display: flex;
    gap: 8px;
}

.nf-detail__body {
    padding: 20px 24px 30px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

@media (max-width: 600px) {
    .nf-detail__body { grid-template-columns: 1fr; }
}

.nf-detail__meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.nf-detail__overview {
    font-size: 14px;
    line-height: 1.6;
    color: var(--nf-white);
}

.nf-detail__sidebar-item {
    font-size: 13px;
    color: var(--nf-gray);
    margin-bottom: 10px;
}

.nf-detail__sidebar-item span {
    color: var(--nf-white);
}

/* Episodes tab in detail */
.nf-detail__episodes {
    padding: 0 24px 30px;
}

.nf-detail__episodes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.nf-detail__episodes-header h3 {
    font-size: 22px;
    font-weight: 700;
}

.nf-detail__season-select {
    padding: 8px 12px;
    background: var(--nf-dark);
    color: #fff;
    border: 1px solid var(--nf-gray-dark);
    border-radius: var(--nf-radius);
    font-size: 14px;
    font-family: var(--nf-font);
    cursor: pointer;
}

.nf-detail__ep-item,
.nf-detail__ep-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 8px;
    margin-bottom: 4px;
}

.nf-detail__ep-item:hover,
.nf-detail__ep-card:hover { 
    background: rgba(255,255,255,.06); 
    transform: translateX(4px);
    border-color: transparent;
}

.nf-detail__ep-num {
    font-size: 22px;
    font-weight: 500;
    color: var(--nf-gray);
    min-width: 32px;
    text-align: center;
    padding-top: 8px;
}

.nf-detail__ep-thumb {
    width: 130px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
    border-radius: var(--nf-radius);
    object-fit: cover;
    background: var(--nf-elevated);
}

.nf-detail__ep-info {
    flex: 1;
    min-width: 0;
}

.nf-detail__ep-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.nf-detail__ep-runtime {
    color: var(--nf-gray);
    font-weight: 400;
}

.nf-detail__ep-desc {
    font-size: 13px;
    color: var(--nf-gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* More Like This */
.nf-detail__more {
    padding: 0 24px 30px;
}

.nf-detail__more h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

.nf-detail__more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 600px) {
    .nf-detail__more-grid { grid-template-columns: repeat(2, 1fr); }
}

.nf-detail__more-card {
    background: rgba(24,24,24,.8);
    border-radius: var(--nf-radius-lg);
    border: 1px solid rgba(255,255,255,.05);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.nf-detail__more-card:hover { 
    background: rgba(255,255,255,.05); 
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,.15);
}

.nf-detail__more-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.nf-detail__more-card-body {
    padding: 10px;
}

.nf-detail__more-card-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.nf-detail__more-card-desc {
    font-size: 11px;
    color: var(--nf-gray);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Search Section
   ========================================================================== */
.nf-search-section {
    padding-top: calc(var(--nf-header-h) + 20px);
    padding-left: var(--nf-row-padding);
    padding-right: var(--nf-row-padding);
    min-height: 80vh;
}

.nf-search-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
}

.nf-search-bar {
    position: relative;
    max-width: 600px;
    margin-bottom: 30px;
}

.nf-search-bar__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nf-gray);
    width: 20px; height: 20px;
}

.nf-search-bar__input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: rgba(20,20,20,.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-family: var(--nf-font);
    outline: none;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.nf-search-bar__input:focus {
    border-color: var(--nf-red);
    background: rgba(20,20,20,.9);
    box-shadow: 0 0 0 4px rgba(229,9,20,.15);
}

/* Genre chips (search by genre) */
.nf-genre-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
    max-width: 700px;
}

.nf-genre-chip {
    padding: 7px 15px;
    background: rgba(20,20,20,.6);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: #e5e5e5;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--nf-font);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

.nf-genre-chip:hover {
    border-color: var(--nf-red);
    color: #fff;
}

.nf-genre-chip.active {
    background: var(--nf-red);
    border-color: var(--nf-red);
    color: #fff;
    box-shadow: 0 2px 12px rgba(229,9,20,.35);
}

/* Category section pages */
.nf-category-page {
    padding-top: calc(var(--nf-header-h) + 20px);
    padding-left: var(--nf-row-padding);
    padding-right: var(--nf-row-padding);
    min-height: 80vh;
}

.nf-category-page h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Skeleton Loading Cards */
@keyframes nfShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.nf-skeleton {
    background: linear-gradient(90deg, var(--nf-elevated) 25%, var(--nf-card) 50%, var(--nf-elevated) 75%);
    background-size: 200% 100%;
    animation: nfShimmer 1.5s ease infinite;
    border-radius: var(--nf-radius);
}

.nf-skeleton-card {
    flex: 0 0 calc((100% - 30px) / 6);
    height: 260px;
    scroll-snap-align: start;
    border-radius: var(--nf-radius);
}

@media (max-width: 1399px) { .nf-skeleton-card { flex: 0 0 calc((100% - 24px) / 5); height: 230px; } }
@media (max-width: 1099px) { .nf-skeleton-card { flex: 0 0 calc((100% - 18px) / 4); height: 200px; } }
@media (max-width: 799px) { .nf-skeleton-card { flex: 0 0 calc((100% - 12px) / 3); height: 160px; } }
@media (max-width: 499px) { .nf-skeleton-card { flex: 0 0 calc((100% - 6px) / 2); height: 140px; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.nf-footer {
    padding: 30px var(--nf-row-padding) 50px;
    color: var(--nf-gray);
    margin-top: 40px;
}

.nf-footer__social {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.nf-footer__social a {
    color: var(--nf-gray);
    transition: opacity var(--nf-transition);
}

.nf-footer__social a:hover { opacity: .75; }
.nf-footer__social svg { width: 24px; height: 24px; }

.nf-footer__links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .nf-footer__links { grid-template-columns: repeat(2, 1fr); }
}

.nf-footer__links a {
    font-size: 13px;
    color: var(--nf-gray);
    transition: color var(--nf-transition);
}

.nf-footer__links a:hover { color: var(--nf-gray-light); text-decoration: underline; }

.nf-footer__service-code {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--nf-gray);
    font-size: 13px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: color var(--nf-transition);
}

.nf-footer__service-code:hover { color: var(--nf-gray-light); }

.nf-footer__copy {
    font-size: 12px;
}

/* ==========================================================================
   NOTIFICATION TOAST
   ========================================================================== */
.nf-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20,20,20,.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #fff;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    border: 1px solid rgba(255,255,255,.1);
    border-left: 3px solid var(--nf-red);
    z-index: 300;
    opacity: 0;
    transition: all 0.4s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}

.nf-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   VIDEO PLAYER — NETFLIX PREMIUM FULLSCREEN OVERLAY
   ========================================================================== */
.nf-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: #000;
    display: none;
    overflow: hidden;
    user-select: none;
    font-family: 'Netflix Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.nf-player.active {
    display: block;
    animation: nfPlayerFadeIn 0.35s ease;
}

@keyframes nfPlayerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Video element */
.nf-player__video-wrap {
    position: absolute;
    inset: 0;
}

.nf-player__video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: filter 0.3s ease;
}

/* Hide DPlayer built-in controls */
.dplayer-controller-mask,
.dplayer-controller {
    display: none !important;
}

/* Loading overlay */
.nf-player__loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.92);
    transition: opacity 0.4s cubic-bezier(.4,0,.2,1);
}

.nf-player__loading.hidden { opacity: 0; pointer-events: none; }

.nf-player__loading-logo {
    height: 70px;
    animation: nfPulse 1.5s infinite alternate ease-in-out;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .nf-player__loading-logo { height: 50px; }
}

.nf-player__loading-text {
    font-size: 15px;
    color: var(--nf-gray-light);
    letter-spacing: 0.3px;
    font-weight: 500;
}

/* Error overlay */
.nf-player__error {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.95);
    text-align: center;
    padding: 24px;
}

.nf-player__error.active {
    display: flex;
    animation: nfErrorIn 0.35s ease;
}

@keyframes nfErrorIn {
    from { opacity: 0; transform: scale(.96); }
    to { opacity: 1; transform: scale(1); }
}

.nf-player__error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(229,9,20,.12);
    border: 2px solid rgba(229,9,20,.25);
    color: var(--nf-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 12px rgba(229,9,20,.2));
}

.nf-player__error h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.nf-player__error p {
    font-size: 15px;
    color: rgba(255,255,255,.55);
    max-width: 420px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.nf-player__error-btn {
    padding: 12px 32px;
    background: var(--nf-red);
    color: #fff;
    border-radius: var(--nf-radius);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(229,9,20,.3);
}

.nf-player__error-btn:hover {
    background: var(--nf-red-hover);
    box-shadow: 0 6px 28px rgba(229,9,20,.45);
    transform: translateY(-1px);
}

/* ---------- Center Play/Pause Feedback ---------- */
.nf-player__center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: none;
}

.nf-player__center-icon.animate {
    animation: nfCenterPop 0.55s cubic-bezier(.22,.68,0,1.1) forwards;
}

@keyframes nfCenterPop {
    0% { transform: translate(-50%,-50%) scale(0); opacity: 1; }
    40% { transform: translate(-50%,-50%) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(1.25); opacity: 0; }
}

.nf-player__center-icon svg {
    width: 40px;
    height: 40px;
    fill: #fff;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
}

/* ---------- Double-Tap Seek Ripple ---------- */
.nf-player__seek-ripple {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 38%;
    z-index: 14;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
}

.nf-player__seek-ripple--left {
    left: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,.06) 0%, transparent 70%);
}

.nf-player__seek-ripple--right {
    right: 0;
    background: radial-gradient(circle at 70% 50%, rgba(255,255,255,.06) 0%, transparent 70%);
}

.nf-player__seek-ripple.animate {
    animation: nfSeekRipple 0.65s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes nfSeekRipple {
    0% { opacity: 0; }
    25% { opacity: 1; }
    100% { opacity: 0; }
}

.nf-player__seek-ripple__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.nf-player__seek-ripple__inner svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
}

/* ---------- Controls Container ---------- */
.nf-player__controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: block;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(.4,0,.2,1);
    box-sizing: border-box;
}

.nf-player__controls.hidden {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(.4,0,.2,1);
}

/* ---------- Top Bar ---------- */
.nf-player__top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px 60px;
    background: linear-gradient(180deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,.15) 60%, transparent 100%);
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.nf-player__back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.nf-player__back-btn:hover {
    background: rgba(255,255,255,.12);
    transform: scale(1.08);
}

.nf-player__back-btn svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
}

.nf-player__top-info {
    flex: 1;
    margin: 0 20px;
    display: none;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.nf-player.iframe-mode .nf-player__top-info {
    display: flex;
}
.nf-player__top-title { font-size: 18px; font-weight: 700; line-height: 1.2; }
.nf-player__top-ep { font-size: 14px; color: var(--nf-gray-light); margin-top: 2px; }

.nf-player__top-server-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(20,20,20,0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: var(--nf-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.nf-player__top-server-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }
.nf-player.iframe-mode .nf-player__top-server-btn { display: flex; }

/* ---------- Bottom Area ---------- */
.nf-player__bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 120px 20px 16px;
    background: linear-gradient(0deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 35%, rgba(0,0,0,.08) 65%, transparent 100%);
    pointer-events: auto;
}

/* Title info */
.nf-player__info {
    max-width: 550px;
    margin-bottom: 14px;
    transition: opacity 0.4s ease;
}

.nf-player__show-title {
    font-size: clamp(22px, 3.2vw, 36px);
    font-weight: 900;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
    line-height: 1.15;
}

.nf-player__meta-text {
    font-size: 13px;
    color: rgba(255,255,255,.55);
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.nf-player__ep-title {
    font-size: 16px;
    font-weight: 700;
    margin-top: 3px;
    color: rgba(255,255,255,.9);
}

.nf-player__overview {
    font-size: 13px;
    color: rgba(255,255,255,.45);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* ---------- Timeline / Seek Bar ---------- */
.nf-player__timeline {
    position: relative;
    width: 100%;
    height: 28px;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    padding: 0 2px;
    margin-bottom: 6px;
}

.nf-player__timeline-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,.18);
    position: relative;
    border-radius: 3px;
    overflow: visible;
    transition: height 0.15s cubic-bezier(.4,0,.2,1);
}

.nf-player__timeline:hover .nf-player__timeline-bar {
    height: 8px;
}

.nf-player__timeline-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255,255,255,.25);
    border-radius: 3px;
    width: 0;
    pointer-events: none;
    transition: width 0.3s ease;
}

.nf-player__timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--nf-red);
    border-radius: 3px;
    width: 0;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(229,9,20,.3);
}

.nf-player__timeline:hover .nf-player__timeline-progress {
    box-shadow: 0 0 10px rgba(229,9,20,.5);
}

.nf-player__timeline-thumb {
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 15px;
    height: 15px;
    background: var(--nf-red);
    border: 2px solid #fff;
    border-radius: 50%;
    transition: transform 0.15s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 8px rgba(229,9,20,.4), 0 2px 4px rgba(0,0,0,.3);
}

.nf-player__timeline:hover .nf-player__timeline-thumb {
    transform: translateY(-50%) scale(1);
}

.nf-player__timeline-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    background: rgba(20,20,20,.95);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    display: none;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
    letter-spacing: 0.5px;
}

.nf-player__timeline:hover .nf-player__timeline-tooltip {
    display: block;
}

/* ---------- Bottom Controls Row ---------- */
.nf-player__controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.nf-player__controls-left,
.nf-player__controls-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ---------- Control Button Base ---------- */
.nf-player__ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #fff;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
    position: relative;
}

.nf-player__ctrl-btn:hover {
    transform: scale(1.18);
    background: rgba(255,255,255,.08);
}

.nf-player__ctrl-btn:active {
    transform: scale(0.95);
}

.nf-player__ctrl-btn svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

.nf-player__ctrl-btn--small svg {
    width: 24px;
    height: 24px;
}

/* ---------- Volume Group ---------- */
.nf-player__volume-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.nf-player__volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(.4,0,.2,1), margin 0.25s cubic-bezier(.4,0,.2,1);
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,.25);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin-left: 0;
}

.nf-player__volume-group:hover .nf-player__volume-slider {
    width: 90px;
    margin-left: 6px;
}

.nf-player__volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    transition: transform 0.15s ease;
}

.nf-player__volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.nf-player__volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ---------- Time Display ---------- */
.nf-player__time {
    font-size: 14px;
    color: rgba(255,255,255,.85);
    font-weight: 500;
    padding: 0 10px;
    white-space: nowrap;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Text Buttons (Next / Episodes) ---------- */
.nf-player__text-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    border-radius: var(--nf-radius);
    transition: all 0.2s ease;
}

.nf-player__text-btn:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.nf-player__text-btn svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

/* ---------- Skip Intro ---------- */
.nf-player__skip-btn {
    position: absolute;
    bottom: 120px;
    right: 20px;
    z-index: 25;
    padding: 10px 28px;
    background: rgba(20,20,20,.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,.65);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    border-radius: 0;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    pointer-events: auto;
    display: none;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.nf-player__skip-btn > span {
    position: relative;
    z-index: 1;
}

/* Gray countdown fill sweeping left -> right (Netflix-style 10s timer) */
.nf-player__skip-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: rgba(255,255,255,.22);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

.nf-player__skip-btn:hover {
    background: rgba(255,255,255,.2);
    border-color: #fff;
    transform: scale(1.02);
}

.nf-player__skip-btn--ad {
    bottom: 176px;
    background: rgba(20,20,20,.72);
    border-color: rgba(255, 170, 0, .8);
    color: #ffc86b;
}

.nf-player__skip-btn--ad:hover {
    background: rgba(255,170,0,.22);
    border-color: #ffb02e;
}


.nf-player__skip-btn.active {
    display: block;
    animation: nfSkipIn 0.4s cubic-bezier(.4,0,.2,1);
}

.nf-player__skip-btn.active::before {
    animation: nfSkipFill 10s linear forwards;
}

.nf-player__skip-btn.fade-out {
    animation: nfSkipOut 0.4s ease forwards !important;
}

.nf-player__skip-btn.fade-out::before {
    animation: none;
}

/* Skip buttons follow the media controls: hidden while the UI is idle,
   visible again the moment controls are shown. */
.nf-player.hide-cursor .nf-player__skip-btn.active {
    display: none;
}

@keyframes nfSkipIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes nfSkipFill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes nfSkipOut {
    to { opacity: 0; transform: translateX(20px); }
}

/* ---------- Next Episode Card ---------- */
.nf-player__next-card {
    position: absolute;
    bottom: 120px;
    right: 20px;
    z-index: 25;
    width: 300px;
    background: rgba(24,24,24,.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06);
    pointer-events: auto;
    display: none;
}

.nf-player__next-card.active {
    display: block;
    animation: nfNextCardIn 0.45s cubic-bezier(.4,0,.2,1);
}

@keyframes nfNextCardIn {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.nf-player__next-card-header {
    padding: 12px 16px;
    font-size: 12px;
    color: rgba(255,255,255,.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nf-player__next-card-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 6px;
}

.nf-player__next-card-body:hover {
    background: rgba(255,255,255,.05);
}

.nf-player__next-card-thumb {
    width: 88px;
    aspect-ratio: 16/9;
    border-radius: 5px;
    object-fit: cover;
    background: var(--nf-elevated);
    flex-shrink: 0;
}

.nf-player__next-card-info {
    flex: 1;
    min-width: 0;
}

.nf-player__next-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-player__next-card-meta {
    font-size: 12px;
    color: rgba(255,255,255,.45);
}

.nf-player__next-card-progress {
    height: 3px;
    background: rgba(255,255,255,.1);
}

.nf-player__next-card-progress-fill {
    height: 100%;
    background: var(--nf-red);
    transition: width 1s linear;
    box-shadow: 0 0 6px rgba(229,9,20,.4);
}

/* ---------- Settings Drawer ---------- */
.nf-player__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 92vw;
    background: rgba(16,16,16,.94);
    backdrop-filter: blur(28px) saturate(1.2);
    -webkit-backdrop-filter: blur(28px) saturate(1.2);
    border-left: 1px solid rgba(255,255,255,.06);
    z-index: 30;
    display: none;
    flex-direction: column;
    pointer-events: auto;
    overflow: hidden;
    box-shadow: -8px 0 40px rgba(0,0,0,.4);
}

.nf-player__drawer.active {
    display: flex;
    animation: nfDrawerSlideIn 0.3s cubic-bezier(.4,0,.2,1);
}

@keyframes nfDrawerSlideIn {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.nf-player__drawer-header {
    display: flex;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.nf-player__settings-back {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 12px;
    outline: none;
}

.nf-player__settings-back:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.nf-player__drawer-header h3 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.2px;
    flex: 1;
}

.nf-player__drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.5);
    transition: all 0.2s ease;
    font-size: 16px;
    outline: none;
    border: none;
    background: transparent;
}

.nf-player__drawer-close:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    transform: rotate(90deg);
}

/* ---------- Settings Menu List ---------- */
.nf-player__settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    outline: none;
}

.nf-player__settings-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.nf-player__settings-item:focus {
    border-color: var(--nf-red);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.15);
}

.nf-player__settings-item-label {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.nf-player__settings-item-value-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nf-player__settings-item-value {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-player__settings-item-chevron {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1;
    transition: transform 0.2s ease;
}

.nf-player__settings-item:hover .nf-player__settings-item-chevron {
    color: #ffffff;
    transform: translateX(2px);
}

.nf-player__tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

.nf-player__tab-panel {
    display: none;
}

.nf-player__tab-panel.active {
    display: block;
    animation: nfPanelIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes nfPanelIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Server Card ---------- */
.nf-player__server-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    margin-bottom: 8px;
}

.nf-player__server-card:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
    transform: translateX(-2px);
}

.nf-player__server-card.active {
    background: linear-gradient(135deg, rgba(229,9,20,.14) 0%, rgba(229,9,20,.04) 100%);
    border-color: rgba(229,9,20,.5);
    box-shadow: 0 2px 16px rgba(229,9,20,.15), inset 0 0 0 1px rgba(229,9,20,.1);
}

.nf-player__server-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nf-player__server-flag {
    font-size: 22px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

.nf-player__server-name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.7);
}

.nf-player__server-card.active .nf-player__server-name {
    color: #fff;
    font-weight: 700;
}

.nf-player__server-desc {
    font-size: 11px;
    color: rgba(255,255,255,.35);
    margin-top: 1px;
}

.nf-player__server-langs {
    font-size: 10.5px;
    color: rgba(255,255,255,.55);
    margin-top: 4px;
    letter-spacing: .2px;
}

.nf-player__server-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--nf-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(229,9,20,.3);
    animation: nfCheckPop 0.3s cubic-bezier(.4,0,.2,1);
}

@keyframes nfCheckPop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ---------- Speed Options ---------- */
.nf-player__speed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.nf-player__speed-btn {
    padding: 12px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: rgba(255,255,255,.6);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

.nf-player__speed-btn:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: #fff;
}

.nf-player__speed-btn.active {
    background: var(--nf-red);
    border-color: var(--nf-red);
    color: #fff;
    box-shadow: 0 3px 14px rgba(229,9,20,.35);
    transform: scale(1.02);
}

/* ---------- Quality / Subtitle Option ---------- */
.nf-player__option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.05);
    background: rgba(255,255,255,.03);
    cursor: pointer;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

.nf-player__option-item:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.85);
}

.nf-player__option-item.active {
    background: rgba(229,9,20,.1);
    border-color: rgba(229,9,20,.4);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(229,9,20,.08);
}

/* ---------- Brightness / Contrast / Audio Boost Sliders ---------- */
.nf-player__adjust-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 8px 0;
}

.nf-player__adjust-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    min-width: 85px;
}

.nf-player__adjust-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,.15);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nf-player__adjust-slider:hover {
    background: rgba(255,255,255,.22);
}

.nf-player__adjust-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0,0,0,.3);
    transition: transform 0.15s ease;
}

.nf-player__adjust-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.nf-player__adjust-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 6px rgba(0,0,0,.3);
}

.nf-player__adjust-value {
    font-size: 13px;
    color: rgba(255,255,255,.45);
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- Episodes Drawer ---------- */
.nf-player__episodes-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 92vw;
    background: rgba(16,16,16,.94);
    backdrop-filter: blur(28px) saturate(1.2);
    -webkit-backdrop-filter: blur(28px) saturate(1.2);
    border-left: 1px solid rgba(255,255,255,.06);
    z-index: 30;
    display: none;
    flex-direction: column;
    pointer-events: auto;
    box-shadow: -8px 0 40px rgba(0,0,0,.4);
}

.nf-player__episodes-drawer.active {
    display: flex;
    animation: nfDrawerSlideIn 0.3s cubic-bezier(.4,0,.2,1);
}

.nf-player__episodes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.nf-player__episodes-header h3 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

/* ---------- Custom Season Selector Dropdown ---------- */
.nf-player__custom-select {
    position: relative;
    margin: 16px 22px;
    width: calc(100% - 44px);
    z-index: 35;
}

.nf-player__custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--nf-font);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nf-player__custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.nf-player__custom-select-trigger:focus {
    border-color: var(--nf-red);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25), 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nf-player__custom-select-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.nf-player__custom-select.active .nf-player__custom-select-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.nf-player__custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(20, 20, 20, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.2s;
    pointer-events: none;
    padding: 6px;
}

.nf-player__custom-select.active .nf-player__custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.nf-player__custom-select-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nf-player__custom-select-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding-left: 18px;
}

.nf-player__custom-select-option.selected {
    background: rgba(229, 9, 20, 0.15);
    color: var(--nf-red);
    font-weight: 700;
}

.nf-player__episodes-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 22px 22px;
}

/* ---------- Continuous cross-season episode sections ---------- */
.nf-player__ep-section {
    margin-bottom: 10px;
}

.nf-player__ep-season-chip {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
    padding: 8px 2px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    background: linear-gradient(to right, rgba(16, 16, 16, 0.95), rgba(16, 16, 16, 0.85));
}

.nf-player__ep-season-chip::before {
    content: '';
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--nf-red);
}


/* ---------- Modernized Episode Cards ---------- */
.nf-player__ep-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(15px);
    animation: nfEpFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: calc(var(--index, 0) * 0.05s);
}

@keyframes nfEpFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nf-player__ep-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.nf-player__ep-card.active {
    background: rgba(229, 9, 20, 0.12);
    border-color: rgba(229, 9, 20, 0.25);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.15);
}

.nf-player__ep-card-num {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    min-width: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s ease;
}

.nf-player__ep-card.active .nf-player__ep-card-num {
    color: var(--nf-red);
}

/* Image Thumb Wrap and Play Button Overlay */
.nf-player__ep-card-thumb-wrap {
    position: relative;
    width: 106px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.nf-player__ep-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.nf-player__ep-card-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nf-player__ep-card:hover .nf-player__ep-card-thumb {
    transform: scale(1.08);
}

.nf-player__ep-card:hover .nf-player__ep-card-play-overlay {
    opacity: 1;
}

.nf-player__ep-card.active .nf-player__ep-card-play-overlay {
    opacity: 1;
    background: rgba(229, 9, 20, 0.3);
}

.nf-player__ep-card-info {
    flex: 1;
    min-width: 0;
}

.nf-player__ep-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--nf-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-player__ep-card-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* ---------- PiP Indicator ---------- */
.nf-player__pip-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    background: rgba(0,0,0,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 22px 36px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    z-index: 25;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* ---------- Hide Cursor on Idle ---------- */
.hide-cursor,
.hide-cursor * {
    cursor: none !important;
}

/* ---------- Speed Indicator Toast ---------- */
.nf-player__speed-indicator {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    transform: translateX(-50%) translateY(-8px);
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    letter-spacing: 0.5px;
}

.nf-player__speed-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Volume Indicator ---------- */
.nf-player__volume-indicator {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.nf-player__volume-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nf-player__volume-bar {
    width: 110px;
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 3px;
    overflow: hidden;
}

.nf-player__volume-bar-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.15s ease;
}

/* ---------- Brightness Indicator (mobile swipe) ---------- */
.nf-player__brightness-indicator {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.nf-player__brightness-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nf-player__brightness-indicator span {
    font-size: 13px;
    font-weight: 700;
    min-width: 34px;
    letter-spacing: 0.5px;
}

.nf-player__brightness-bar {
    width: 110px;
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 3px;
    overflow: hidden;
}

.nf-player__brightness-bar-fill {
    height: 100%;
    background: #f5c518;
    border-radius: 3px;
    transition: width 0.15s ease;
}

/* ---------- Lock Overlay (SDK-style tap to unlock) ---------- */
.nf-player__lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    color: #fff;
    z-index: 40;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.nf-player__lock-overlay svg {
    width: 40px;
    height: 40px;
}

.nf-player__lock-overlay.active {
    display: flex;
}

.nf-player__lock-overlay.pulse {
    animation: nfLockPulse 0.5s ease;
}

@keyframes nfLockPulse {
    0%   { transform: translate(-50%, -50%) scale(1); }
    50%  { transform: translate(-50%, -50%) scale(1.15); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Mobile-Only Control Buttons ---------- */
.nf-player__mobile-lock-btn,
.nf-player__mobile-speed-btn {
    display: none !important;
}

.nf-player__mobile-speed-btn {
    position: relative;
}

.nf-player__mobile-speed-btn span {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--nf-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 6px;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

/* ---------- Mobile Responsive Player ---------- */
@media (max-width: 768px) {
    .nf-player__top {
        padding: 12px 12px 40px;
    }

    .nf-player__mobile-lock-btn,
    .nf-player__mobile-speed-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .nf-player__lock-overlay {
        width: 72px;
        height: 72px;
    }


    .nf-player__bottom {
        padding: 80px 12px 10px;
    }

    .nf-player__info {
        margin-bottom: 8px;
    }

    .nf-player__show-title {
        font-size: 18px;
    }

    .nf-player__meta-text {
        font-size: 11px;
    }

    .nf-player__ep-title {
        font-size: 13px;
    }

    .nf-player__overview {
        display: none;
    }

    .nf-player__ctrl-btn {
        padding: 8px;
    }

    .nf-player__ctrl-btn svg {
        width: 26px;
        height: 26px;
    }

    .nf-player__ctrl-btn--small svg {
        width: 20px;
        height: 20px;
    }

    .nf-player__text-btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .nf-player__text-btn svg {
        width: 20px;
        height: 20px;
    }

    .nf-player__time {
        font-size: 12px;
        padding: 0 6px;
    }

    .nf-player__skip-btn {
        bottom: 90px;
        right: 12px;
        padding: 8px 20px;
        font-size: 14px;
    }

    .nf-player__skip-btn--ad {
        bottom: 140px;
    }


    .nf-player__next-card {
        bottom: 90px;
        right: 12px;
        width: 250px;
    }

    .nf-player__drawer,
    .nf-player__episodes-drawer {
        width: 100%;
        max-width: 100vw;
        border-left: none;
        /* Bottom sheet on phone */
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        max-height: 85vh;
        border-top: 1px solid rgba(255,255,255,.08);
        border-radius: 18px 18px 0 0;
        animation: nfDrawerSheetUp 0.35s cubic-bezier(.4,0,.2,1);
    }
    @keyframes nfDrawerSheetUp {
        from { transform: translateY(40px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }

    .nf-player__speed-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .nf-player__speed-btn {
        padding: 10px 4px;
        font-size: 13px;
    }

    .nf-player__back-btn {
        width: 44px;
        height: 44px;
        padding: 10px;
        margin-left: -10px;
    }

    .nf-player__back-btn svg {
        width: 28px;
        height: 28px;
    }

    .nf-player__center-icon {
        width: 72px;
        height: 72px;
    }

    .nf-player__center-icon svg {
        width: 34px;
        height: 34px;
    }

    /* Mobile bottom control bar redesign: larger touch targets */
    .nf-player__controls-row {
        gap: 4px;
        align-items: center;
    }

    .nf-player__ctrl-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    .nf-player__ctrl-btn--small {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }

    /* Emphasized primary play/pause button */
    .nf-player__ctrl-btn#playPauseBtn {
        min-width: 56px;
        min-height: 56px;
        background: rgba(255,255,255,.12);
        border: 1px solid rgba(255,255,255,.25);
        margin-right: 4px;
    }

    .nf-player__ctrl-btn#playPauseBtn svg {
        width: 34px;
        height: 34px;
    }

    .nf-player__controls-left,
    .nf-player__controls-right {
        gap: 2px;
    }

    .nf-player__text-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .nf-player__volume-group:hover .nf-player__volume-slider {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .nf-player__controls-row {
        gap: 0;
        justify-content: space-between;
    }

    .nf-player__controls-left,
    .nf-player__controls-right {
        gap: 0;
    }

    .nf-player__text-btn span {
        display: none;
    }

    .nf-player__text-btn {
        padding: 8px;
    }
    
    .nf-player__time {
        display: none; /* Hide on very small screens to save space */
    }
    
    .nf-player__volume-group {
        display: none; /* Mobile volume is controlled by physical buttons or gestures */
    }
    
    .nf-player__bottom {
        padding: 60px 8px 8px;
    }
}

/* ---------- Mobile Search Bar ---------- */
.nf-mobile-search {
    display: none; /* hidden on desktop */
    align-items: center;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 16px 2% 8px;
    padding: 8px 12px;
    position: relative;
    z-index: 10;
}

.nf-mobile-search__icon {
    width: 20px;
    height: 20px;
    color: rgba(0, 0, 0, 0.6);
    margin-right: 10px;
}

.nf-mobile-search__input {
    background: transparent;
    border: none;
    color: #111;
    font-size: 16px;
    width: 100%;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
}

.nf-mobile-search__input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .nf-mobile-search {
        display: flex;
    }
}

/* ---------- Remote Banner ---------- */
.nf-remote-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nf-red);
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 700;
    z-index: 99999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.nf-remote-banner.active {
    display: block;
}
/* TV Navigation Focus Styles */
.focusable:focus, .nf-nav-link:focus, .nf-btn:focus, .nf-notif-btn:focus, .nf-player__server-card:focus, .nf-player__btn:focus, .nf-slider__item:focus {
    outline: 4px solid #fff;
    outline-offset: -2px;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    transition: all 0.2s ease;
    z-index: 100;
}
.nf-player__tab:focus {
    outline: 3px solid #fff;
}

/* Iframe Mode Styles */
.nf-player.iframe-mode .nf-player__bottom,
.nf-player.iframe-mode .nf-player__center-icon {
    display: none !important;
}
.nf-player.iframe-mode .nf-player__controls {
    pointer-events: none;
}
.nf-player.iframe-mode .nf-player__controls > * {
    pointer-events: auto;
}
/* Edge detectors to wake up UI when hovering edges of iframe */
.nf-player.iframe-mode .nf-player__edge {
    position: absolute;
    z-index: 100;
    pointer-events: auto;
}
.nf-player.iframe-mode .nf-player__edge.top { top: 0; left: 0; right: 0; height: 30px; }
.nf-player.iframe-mode .nf-player__edge.bottom { bottom: 0; left: 0; right: 0; height: 30px; }
.nf-player.iframe-mode .nf-player__edge.left { top: 0; bottom: 0; left: 0; width: 30px; }
.nf-player.iframe-mode .nf-player__edge.right { top: 0; bottom: 0; right: 0; width: 30px; }

/* Server Section Titles in Settings Drawer */
.nf-player__server-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin: 16px 4px 10px;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    font-family: inherit;
}

/* ==========================================================================
   NETFLIX PROFILE SELECTION & MANAGEMENT
   ========================================================================== */
.nf-profile-selection-screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #141414;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    color: #fff;
    animation: nfFadeIn 0.35s ease;
}

.nf-profile-selection-container {
    text-align: center;
    max-width: 800px;
    width: 90%;
}

.nf-profile-selection-container h1 {
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 500;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

.nf-profile-list {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2vw;
    margin-bottom: 48px;
}

.nf-profile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: clamp(100px, 12vw, 150px);
    position: relative;
}

.nf-profile-avatar-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 3.5px solid transparent;
    transition: border-color 0.25s ease, transform 0.25s ease;
    background: #2b2b2b;
}

.nf-profile-item:hover .nf-profile-avatar-wrap {
    border-color: #fff;
    transform: scale(1.06);
}

.nf-profile-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nf-profile-item span {
    margin-top: 15px;
    font-size: clamp(14px, 1.6vw, 18px);
    color: var(--nf-gray-light);
    transition: color 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nf-profile-item:hover span {
    color: #fff;
}

/* Edit Overlay Pencil */
.nf-profile-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 4px;
}

.nf-profile-item.manage-mode .nf-profile-edit-overlay {
    opacity: 1;
}

.nf-profile-edit-overlay svg {
    width: 32px;
    height: 32px;
    fill: #fff;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Wobble animation for manage mode */
@keyframes nfProfileWobble {
    0% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
    100% { transform: rotate(-1deg); }
}

.nf-profile-item.manage-mode .nf-profile-avatar-wrap {
    animation: nfProfileWobble 0.25s infinite alternate ease-in-out;
}

/* Add profile button */
.nf-profile-item--add .nf-profile-avatar-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nf-profile-item--add .nf-profile-avatar-wrap svg {
    width: 40%;
    height: 40%;
    fill: var(--nf-gray);
    transition: fill 0.25s ease;
}

.nf-profile-item--add:hover .nf-profile-avatar-wrap {
    background: #fff;
}
.nf-profile-item--add:hover .nf-profile-avatar-wrap svg {
    fill: #000;
}

.nf-profile-manage-btn {
    background: transparent;
    border: 1px solid var(--nf-gray);
    color: var(--nf-gray);
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    cursor: pointer;
}

.nf-profile-manage-btn:hover,
.nf-profile-manage-btn.active {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* Edit / Add Profile Modals */
.nf-profile-edit-modal,
.nf-profile-avatar-picker {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
}

.nf-profile-edit-container,
.nf-profile-avatar-picker-container {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 40px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    animation: nfDrawerSlideIn 0.3s cubic-bezier(.4,0,.2,1);
}

.nf-profile-edit-container h2,
.nf-profile-avatar-picker-container h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.nf-profile-edit-body {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    align-items: center;
}

.nf-profile-edit-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.nf-profile-edit-avatar-section img {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    object-fit: cover;
}

.nf-profile-edit-avatar-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
}

.nf-profile-edit-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nf-profile-edit-info-section input[type="text"] {
    background: #444;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 4px;
    outline: none;
}

.nf-profile-edit-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nf-profile-edit-checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--nf-red);
}

.nf-profile-edit-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

/* Avatar Picker Grid */
.nf-profile-avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 6px;
}

.nf-profile-avatar-option {
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.nf-profile-avatar-option:hover {
    border-color: #fff;
    transform: scale(1.05);
}

.nf-profile-avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Profile selection & management on mobile ---------- */
@media (max-width: 600px) {
    .nf-profile-selection-screen {
        overflow-y: auto;
        align-items: flex-start;
        justify-content: center;
        padding: 48px 0 48px;
    }
    .nf-profile-selection-container {
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
    }
    .nf-profile-selection-container h1 {
        font-size: 28px;
        margin-bottom: 24px;
    }
    .nf-profile-list {
        gap: 8px 6px;
        margin-bottom: 32px;
    }
    .nf-profile-item {
        width: clamp(72px, 26vw, 120px);
    }
    .nf-profile-item span {
        margin-top: 10px;
        font-size: 13px;
    }
    .nf-profile-edit-container,
    .nf-profile-avatar-picker-container {
        width: 96%;
        max-height: 92vh;
        overflow-y: auto;
        padding: 20px 16px;
    }
    .nf-profile-edit-body {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .nf-profile-edit-info-section {
        width: 100%;
        align-items: center;
    }
    .nf-profile-edit-info-section input[type="text"] {
        width: 100%;
        max-width: 320px;
        text-align: center;
    }
    .nf-profile-edit-footer {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nf-profile-avatar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

/* ---------- Settings Modal ---------- */
.nf-settings-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
}

.nf-settings-modal__container {
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    width: min(720px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: nfDrawerSlideIn 0.3s cubic-bezier(.4, 0, .2, 1);
}

.nf-settings-modal__container--sm {
    max-width: 420px;
    padding: 32px;
    align-items: center;
    text-align: center;
}

.nf-settings-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nf-settings-modal__header h2 {
    font-size: 24px;
    font-weight: 600;
}

.nf-settings-modal__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nf-settings-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nf-settings-modal__body {
    overflow-y: auto;
    padding: 8px 24px 24px;
    flex: 1;
}

.nf-settings-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
}

.nf-settings-profile {
    color: #aaa;
    font-size: 13px;
    margin: 14px 0 4px;
}

.nf-settings-section {
    margin-top: 20px;
}

.nf-settings-section__title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.nf-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nf-settings-row--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.nf-settings-row__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nf-settings-row__label span {
    font-size: 14px;
    font-weight: 500;
}

.nf-settings-row__label small {
    color: #aaa;
    font-size: 12px;
}

.nf-settings-select {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    min-width: 170px;
    flex-shrink: 0;
}

.nf-settings-value {
    color: #aaa;
    font-size: 13px;
    align-self: flex-end;
}

.nf-sync-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nf-sync-code {
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #e50914;
    background: rgba(229, 9, 20, 0.12);
    border: 1px dashed rgba(229, 9, 20, 0.45);
    border-radius: 6px;
    padding: 8px 14px;
    min-width: 120px;
    text-align: center;
}

.nf-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.nf-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.nf-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #3a3a3a;
    border-radius: 26px;
    transition: .2s;
}

.nf-switch__slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
}

.nf-switch input:checked + .nf-switch__slider {
    background: var(--nf-red, #e50914);
}

.nf-switch input:checked + .nf-switch__slider::before {
    transform: translateX(20px);
}

.nf-swatch-row {
    display: flex;
    gap: 10px;
}

.nf-swatch-row button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.nf-swatch-row button.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.nf-settings-subhead {
    font-size: 14px;
    font-weight: 600;
    color: #e5e5e5;
    margin: 16px 0 8px;
}

.nf-settings-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.nf-settings-history__item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #222;
    border-radius: 4px;
    padding: 8px 10px;
}

.nf-settings-history__item img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 2px;
}

.nf-settings-history__item-info {
    flex: 1;
    min-width: 0;
}

.nf-settings-history__item-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-settings-history__item-meta {
    font-size: 11px;
    color: #aaa;
}

.nf-settings-history__item-remove {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.nf-settings-history__item-remove:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nf-settings-history__empty {
    color: #aaa;
    font-size: 13px;
    padding: 8px 0;
}

.nf-btn--danger {
    background: #b9090b;
    color: #fff;
}

.nf-settings-pin {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0 4px;
}

.nf-settings-pin input,
.nf-settings-modal__pin-input {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 6px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.nf-settings-modal__pin-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.nf-settings-modal__pin-sub {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
}

.nf-settings-modal__pin-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

@media (max-width: 768px) {
    .nf-settings-modal__body {
        padding: 8px 14px 20px;
    }
    .nf-settings-row {
        flex-wrap: wrap;
        padding: 12px 0;
    }
    .nf-settings-select {
        min-width: 0;
        width: 100%;
    }
    .nf-settings-modal__container {
        max-height: 94vh;
    }
    .nf-settings-modal__container--sm {
        width: 92vw;
        padding: 24px 18px;
    }
}


