/* =====================================================================
   FilmParty — Series watch picker (انتخاب فصل و قسمت برای تماشای آنلاین)
   Fully self-contained + namespaced (.fp-swp*). Matches the site's cold-glass
   theme and the pink "تماشای آنلاین" accent. No shared selectors, no JS deps
   beyond series-watch-picker.js.
   ===================================================================== */

.fp-swp {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    direction: rtl;
}
.fp-swp[hidden] { display: none; }

.fp-swp__backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: rgba(4, 6, 12, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.26s ease;
}
.fp-swp.is-open .fp-swp__backdrop { opacity: 1; }

.fp-swp__panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 86vh;
    max-height: 86dvh;
    display: flex;
    flex-direction: column;
    padding: 10px 16px calc(18px + var(--fp-safe-area-bottom, 0px));
    border-radius: 26px 26px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
    background:
        radial-gradient(120% 80% at 90% -10%, rgba(255, 98, 139, 0.10), transparent 55%),
        linear-gradient(180deg, rgba(20, 16, 22, 0.96), rgba(10, 11, 16, 0.98));
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(102%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    color: #f8fafc;
    font-family: inherit;
}
.fp-swp.is-open .fp-swp__panel { transform: translateY(0); }

.fp-swp__handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    margin: 2px auto 12px;
    flex-shrink: 0;
}

/* ---- header ---- */
.fp-swp__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.fp-swp__head-media { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fp-swp__poster {
    width: 46px;
    height: 69px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.fp-swp__head-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fp-swp__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 150, 178, 0.95);
    text-transform: none;
}
.fp-swp__title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fp-swp__sub { font-size: 12px; color: var(--text-soft, #b6c2d1); }
.fp-swp__close {
    margin-inline-start: auto;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}
.fp-swp__close:hover { background: rgba(255, 255, 255, 0.12); transform: rotate(90deg); }
.fp-swp__close svg { width: 16px; height: 16px; }

/* ---- season tabs ---- */
.fp-swp__seasons {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 2px 4px;
    flex-shrink: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.fp-swp__seasons::-webkit-scrollbar { display: none; }
.fp-swp__season-tab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 7px 14px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft, #b6c2d1);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}
.fp-swp__season-tab small { font-size: 10.5px; font-weight: 600; opacity: 0.7; }
.fp-swp__season-tab:hover { background: rgba(255, 255, 255, 0.08); color: #f8fafc; }
.fp-swp__season-tab.is-active {
    border-color: rgba(255, 98, 139, 0.85);
    background: linear-gradient(135deg, rgba(255, 98, 139, 0.22), rgba(255, 59, 107, 0.08));
    color: rgba(255, 235, 242, 0.98);
    box-shadow: inset 0 0 0 1px rgba(255, 160, 188, 0.35), 0 0 10px rgba(255, 98, 139, 0.32);
}

/* ---- episode list ---- */
.fp-swp__body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
    padding-inline-end: 2px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.fp-swp__episodes { display: none; flex-direction: column; gap: 8px; }
.fp-swp__episodes.is-active { display: flex; }

.fp-swp__ep {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.035);
    color: #f3f5ff;
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.fp-swp__ep:hover {
    transform: translateX(-3px);
    border-color: rgba(255, 98, 139, 0.6);
    background: linear-gradient(135deg, rgba(255, 98, 139, 0.12), rgba(255, 255, 255, 0.04));
}
.fp-swp__ep:focus-visible {
    outline: 2px solid rgba(255, 130, 165, 0.9);
    outline-offset: 2px;
}
.fp-swp__ep-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 800;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.fp-swp__ep-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fp-swp__ep-title {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fp-swp__ep-state { font-size: 11.5px; color: rgba(120, 230, 170, 0.92); }
.fp-swp__ep-play {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 98, 139, 0.5);
    background: linear-gradient(135deg, rgba(255, 98, 139, 0.2), rgba(255, 59, 107, 0.06));
    color: rgba(255, 232, 240, 0.98);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.fp-swp__ep:hover .fp-swp__ep-play {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(255, 98, 139, 0.6);
}
.fp-swp__ep-play svg { width: 16px; height: 16px; fill: currentColor; margin-inline-start: 2px; }

/* not-ready episode */
.fp-swp__ep.is-soon {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}
.fp-swp__ep.is-soon .fp-swp__ep-state { color: var(--text-soft, #b6c2d1); }
.fp-swp__ep-soon-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-soft, #b6c2d1);
}

/* ---- desktop: centered dialog instead of bottom sheet ---- */
@media (min-width: 720px) {
    .fp-swp { align-items: center; padding: 24px; }
    .fp-swp__panel {
        max-width: 600px;
        max-height: 82vh;
        border-radius: 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding: 20px 22px 22px;
        transform: translateY(16px) scale(0.98);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    }
    .fp-swp.is-open .fp-swp__panel { transform: translateY(0) scale(1); opacity: 1; }
    .fp-swp__handle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .fp-swp__panel,
    .fp-swp__backdrop,
    .fp-swp__ep,
    .fp-swp__close { transition: none; }
}
