/* =====================================================================
   NEW PLAYER UI  (series episode, single video, trailer, isfeature)
   - Figma: bottom action bar (Save | All Episodes | Share)
   - All Episodes sirf series me, rotate icon Daily Pulse / isfeature me nahi
   - Share: mobile -> bottom drawer, desktop -> center popup
   - Live event player par apply NAHI hota (JS me gate hai)
   - Sab device pe same design: mobile, tablet, desktop, iPhone, iPad, Mac
   - Saare styles ".video-js.spui-active" ke andar scoped hain, isliye
     live player (jahan spui-active nahi lagta) par koi asar nahi padta
   ===================================================================== */

.video-js.spui-active {
    --spui-accent: #F07C1B;
    --spui-accent-dark: #DC6900;
    --spui-blue: #116DB6;
    --spui-text-dark: #202936;
    --spui-muted: #64748B;
    background: #000 !important;
    font-family: "Lato", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- video.js ke default controls chhupao ---------- */
.video-js.spui-active .vjs-control-bar,
.video-js.spui-active .vjs-big-play-button,
.video-js.spui-active .vjs-feature-close,
.video-js.spui-active .vjs-cta-link,
.video-js.spui-active .vjs-dock-text,
.video-js.spui-active .vjs-title-bar {
    display: none !important;
}

.video-js.spui-active .vjs-tech {
    z-index: 0;
}

.video-js.spui-active .vjs-loading-spinner {
    z-index: 7;
    pointer-events: none;
}

.video-js.spui-active .vjs-error-display,
.video-js.spui-active .vjs-modal-dialog {
    z-index: 8;
}

/* feedback card (purana flow) hamesha upar rahe, sirf panel/share open ho tab chhupe */
html body .video-js.spui-active.spui-overlay-open > .vjs-feedback-wrapper {
    display: none !important;
}

/* ---------- Feedback card ("Was this video insightful?") ----------
   Device ke NEECHE LEFT side: left se 10px, max-width 300px.
   - transform NAHI use karte (left + width se position), taaki feedbackForm.css ka
     "transform: translateX(-5%) !important" ya koi aur page CSS card ko khiska na de.
   - Selector "html body ... >" isliye ki koi aur rule specificity me na jeete.
   Controls dikh rahe hon to seekbar / cross / Save-Share bar ke upar,
   controls chhupe hon to sirf Save / All Episodes / Share bar ke upar. */
html body .video-js.spui-active > .vjs-feedback-wrapper {
    position: absolute !important;
    top: auto !important;
    left: calc(10px + env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 20px) !important;   /* chhoti screen par dono side 10px */
    max-width: 300px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-end !important;
    cursor: default !important;
    z-index: 40 !important;
    transition: bottom .2s ease;
}

html body .video-js.spui-active > .vjs-feedback-wrapper .feedback-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: spui-fb-up .25s ease-out;
}

@keyframes spui-fb-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* portrait / desktop: cross (neeche center) hamesha dikhta hai -> card hamesha uske upar */
html body .video-js.spui-active:not(.spui-rotated) > .vjs-feedback-wrapper {
    /* bottom: 110px !important; */
    bottom: 11px !important;
}

/* mobile landscape: cross right side me hai -> sirf seekbar + action bar ke upar */
html body .video-js.spui-active.spui-el-mobile.spui-el-land:not(.spui-rotated) > .vjs-feedback-wrapper {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
}

html body .video-js.spui-active.spui-ctrl-show.spui-el-mobile.spui-el-land:not(.spui-rotated) > .vjs-feedback-wrapper {
    bottom: 84px !important;
}

html body .video-js.spui-active.spui-el-mobile.spui-el-land:not(.spui-rotated) > .vjs-feedback-wrapper .feedback-card {
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
}

/* rotate icon se landscape (CSS rotate): card ko bhi UI ke saath ghumao,
   aur ghumaye hue frame ke NEECHE LEFT (left se 10px) le jao */
html body .video-js.spui-active.spui-rotated > .vjs-feedback-wrapper {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    width: min(300px, calc(var(--spui-rw, 100vh) - 20px)) !important;
    max-width: 300px !important;
    transform: translate(-50%, -50%) rotate(var(--spui-rdeg, 90deg))
               translate(calc(var(--spui-rw, 100vh) / -2 + 50% + 10px), calc(var(--spui-rh, 100vw) / 2 - 50% - 54px)) !important;
}

html body .video-js.spui-active.spui-rotated.spui-ctrl-show > .vjs-feedback-wrapper {
    transform: translate(-50%, -50%) rotate(var(--spui-rdeg, 90deg))
               translate(calc(var(--spui-rw, 100vh) / -2 + 50% + 10px), calc(var(--spui-rh, 100vw) / 2 - 50% - 84px)) !important;
}

html body .video-js.spui-active.spui-rotated > .vjs-feedback-wrapper .feedback-card {
    max-height: calc(var(--spui-rh, 100vw) - 110px);
}

/* iOS: 16px se chhota font -> input focus par zoom */
@media (pointer: coarse) {
    html body .video-js.spui-active > .vjs-feedback-wrapper .feedbackForm-textarea { font-size: 16px !important; }
}

/* ---------- Full-window mode (iPhone + fallback) ---------- */
html.spui-lock,
html.spui-lock body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.video-js.spui-active.spui-fullwindow {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    z-index: 2147483000 !important;
    transform: none !important;
}

.video-js.spui-active.spui-fullwindow .vjs-tech,
.video-js.spui-active.vjs-fullscreen .vjs-tech {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* ---------- Root overlay ---------- */
.spui-root {
    position: absolute;
    inset: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 5;
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    box-sizing: border-box;
}

.spui-root *,
.spui-root *::before,
.spui-root *::after {
    box-sizing: border-box;
}

.spui-root button {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.spui-root button:focus-visible {
    outline: 2px solid var(--spui-accent);
    outline-offset: 2px;
}

.spui-root svg {
    display: block;
    pointer-events: none;
}

.spui-hit {
    position: absolute;
    inset: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
}

.spui-root.spui-idle {
    cursor: none;
}

.spui-scrim {
    position: absolute;
    inset: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 22%),
        linear-gradient(to top, rgba(0,0,0,.70) 0%, rgba(0,0,0,0) 28%),
        rgba(0,0,0,.18);
    opacity: 0;
    transition: opacity .25s ease;
}

.spui-layer {
    position: absolute;
    inset: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2;
    pointer-events: none;
}

.spui-root.spui-show .spui-scrim {
    opacity: 1;
}

/* Auto-hide hone wale controls: top bar, center buttons, rotate,
   seekbar + time. (Layer khud ab hide nahi hoti, warna andar ka sab chhup jata) */
.spui-layer > .spui-top,
.spui-layer > .spui-center,
.spui-layer > .spui-rotate,
.spui-bottom > .spui-progress,
.spui-bottom > .spui-time {
    opacity: 0;
    pointer-events: none !important;
    transition: opacity .25s ease;
}

.spui-root.spui-show .spui-layer > .spui-top,
.spui-root.spui-show .spui-layer > .spui-center,
.spui-root.spui-show .spui-layer > .spui-rotate,
.spui-root.spui-show .spui-bottom > .spui-progress,
.spui-root.spui-show .spui-bottom > .spui-time {
    opacity: 1;
    pointer-events: auto !important;
}

/* Cross + Save / All Episodes / Share -> KABHI hide nahi (controls chhupe hon tab bhi) */
.spui-layer > .spui-cross,
.spui-bottom > .spui-actions {
    opacity: 1;
    pointer-events: auto !important;
}

/* controls chhupe hon tab bhi action bar padhne layak rahe */
.spui-bottom::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 100%);
    transition: opacity .25s ease;
}

.spui-root.spui-show .spui-bottom::before { opacity: 0; } /* tab scrim already hai */

/* ---------- Top bar ---------- */
.spui-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}

.spui-back {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.spui-back svg { width: 22px; height: 22px; }

.spui-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.spui-top-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spui-mute {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.spui-mute svg { width: 20px; height: 20px; }

.spui-speed-wrap {
    position: relative;
}

.spui-speed-btn {
    height: 30px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 9px !important;
    /* border: 1px solid rgba(255,255,255,.75) !important; */
    /* border-radius: 16px; */
    border-radius: 8px;
    background: #4C4C4C73 !important;
    backdrop-filter: blur(16px);
    border: 1px solid #FFFFFF1F !important;
    box-shadow: 0px 4px 20px 0px #00000059 !important;

backdrop-filter: blur(16px) !important;
    /* background: rgba(0,0,0,.35) !important; */
    font-size: 13px;
    font-weight: 600;
}

.spui-speed-btn svg { width: 16px; height: 16px; }
.spui-speed-btn .spui-chev { width: 12px; height: 12px; transition: transform .2s; }
.spui-speed-wrap.spui-open .spui-chev { transform: rotate(180deg); }

.spui-speed-menu {
    position: absolute;
    top: 38px;
    right: 0;
    /* min-width: 136px; */
    min-width: 140px;
    padding: 6px;
    background: #fff;
    color: var(--spui-text-dark);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.35);
    display: none;
    z-index: 30;
    max-height: 70vh;
    overflow-y: auto;
}

.spui-speed-wrap.spui-open .spui-speed-menu { display: block; }

.spui-speed-item {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 34px;
    padding: 0 10px !important;
    border-radius: 6px;
    font-size: 13px;
    color: var(--spui-text-dark) !important;
    text-align: left;
}

.spui-speed-item:hover { background: #F1F5F9 !important; }

.spui-speed-item.spui-selected {
    /* background: #E3F2FD !important; */
    background: #E9E9E9 !important;
    /* color: var(--spui-blue) !important; */
    font-weight: 700;
}

.spui-speed-item svg { width: 14px; height: 14px; visibility: hidden; }
.spui-speed-item.spui-selected svg { visibility: visible; }

/* ---------- Center controls ---------- */
.spui-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: clamp(12px, 4.5vw, 40px);
}

.spui-cbtn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform .12s ease, opacity .2s ease, background-color .2s;
}

.spui-cbtn:active { transform: scale(.92); }
.spui-cbtn svg { width: 35px; height: 35px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }

.spui-cbtn.spui-prev svg,
.spui-cbtn.spui-next svg { width: 26px; height: 26px; }

.spui-cbtn.spui-play {
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,.45) !important;
    /* border: 1px solid rgba(255,255,255,.25) !important; */
    border: 1.09px solid #FFFFFFCC !important;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.spui-cbtn.spui-play svg { width: 34px; height: 34px; }

.spui-cbtn[disabled],
.spui-cbtn.spui-disabled {
    opacity: .3;
    pointer-events: none;
}

.spui-cbtn.spui-hidden { display: none; }

.video-js.spui-active.vjs-waiting .spui-cbtn.spui-play,
.video-js.spui-active.vjs-seeking .spui-cbtn.spui-play {
    visibility: hidden;
}

/* ---------- Landscape / Portrait (rotate) button ----------
   Figma: top-right, speed button ke neeche (portrait + landscape dono) */
.spui-rotate {
    position: absolute;
    top: 58px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: transform .12s ease;
}

.spui-rotate:active { transform: scale(.9); }
.spui-rotate svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

/* ---------- Cross (close player) ----------
   Default (mobile portrait + DESKTOP): neeche seekbar ki line ke theek upar, center me
   Sirf mobile / tablet LANDSCAPE mode (phone ghumaya ya rotate icon se): right side beech me
   (.spui-mobile = mobile view, .spui-touch = asli mobile/tablet, .spui-land = landscape)
   Desktop par .spui-touch / .spui-mobile nahi lagte -> cross hamesha neeche center */
.spui-cross {
    position: absolute;
    left: calc(50% - 18px);   /* exact center (margin ".spui-root button" se reset ho jata hai) */
    bottom: 66px;             /* seekbar track se ~5px upar */
    z-index: 3;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform .12s ease;
}

.spui-cross:active { transform: scale(.9); }
.spui-cross svg { width: 32px; height: 32px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }

/* jab cross neeche center me hai (portrait ya desktop) -> toast / up next uske upar */
.video-js.spui-active .spui-root:not(.spui-land) .spui-toast,
.video-js.spui-active .spui-root:not(.spui-land) .spui-upnext,
.video-js.spui-active .spui-root:not(.spui-touch) .spui-toast,
.video-js.spui-active .spui-root:not(.spui-touch) .spui-upnext,
.video-js.spui-active .spui-root:not(.spui-mobile) .spui-toast,
.video-js.spui-active .spui-root:not(.spui-mobile) .spui-upnext { bottom: 128px; }

.spui-root.spui-mobile.spui-touch.spui-land .spui-cross {
    left: auto;
    right: 18px;
    bottom: auto;
    top: calc(50% - 18px);
}

.spui-fwd, .spui-rew{
        background: rgba(0, 0, 0, .45) !important;
    width: 50px !important;
    height: 50px !important;
    border: 1px solid rgba(255, 255, 255, .25) !important;
-webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
/* desktop (non-touch) par orientation nahi hota, aur Daily Pulse / isfeature me icon nahi */
.video-js.spui-active .spui-root:not(.spui-touch) .spui-rotate,
.video-js.spui-active .spui-root.spui-no-rotate .spui-rotate {
    display: none !important;
}

/* ---------- Bottom: progress + time + action bar ---------- */
.spui-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 12px;
    padding: 0 14px 6px;
}

/* Save (left) | All Episodes (center) | Share (right)
   Grid: teen barabar column -> All Episodes hamesha exact center me,
   chahe Save / Saved / Share ki width alag ho. Single video me All Episodes
   chhupta hai, tab bhi Save left aur Share right me hi rehte hain. */
.spui-actions {
    flex: 0 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 8px;
    min-height: 40px;   /* pehle jitni hi -> seekbar / cross ki position same */
}

/* har button ek pill: halka grey + blur background (Figma) */
.spui-act {
    min-width: 0;
    height: 34px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    /* border-radius: 17px; */
    background: #4C4C4C73 !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s, transform .12s;
}

/* ".spui-root button { padding: 0 }" ko harane ke liye zyada specific */
.video-js.spui-active .spui-root .spui-act {
    /* padding: 0 14px 0 10px !important; */
    padding: 0 7px 0 10px !important;
}

.spui-act:hover { background: rgba(76,76,76,.6) !important; }
.spui-act:active { transform: scale(.96); }

.spui-act.spui-save { grid-column: 1; justify-self: start; }
.spui-act.spui-episodes-btn { grid-column: 2; justify-self: center; }
.spui-act.spui-share-btn { grid-column: 3; justify-self: end; }

.spui-act .spui-ico {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s;
}

.spui-act svg { width: 20px; height: 20px; }
.spui-act[disabled] { opacity: .5; }

.spui-progress {
    position: relative;
    flex: 1 1 auto;
    height: 30px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.spui-track {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,.30);
    transition: height .15s;
}

.spui-progress:hover .spui-track,
.spui-progress.spui-dragging .spui-track { height: 6px; }

.spui-buffer,
.spui-played {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: 4px;
}

.spui-buffer { background: rgba(255,255,255,.45); }
.spui-played { background: var(--spui-accent); }

.spui-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    background: var(--spui-accent);
    box-shadow: 0 0 0 3px rgba(240,124,27,.25), 0 1px 3px rgba(0,0,0,.4);
    transition: transform .12s;
}

.spui-progress.spui-dragging .spui-thumb { transform: scale(1.3); }

.spui-tip {
    position: absolute;
    bottom: 28px;
    left: 0;
    transform: translateX(-50%);
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(0,0,0,.8);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    display: none;
    pointer-events: none;
}

.spui-progress.spui-dragging .spui-tip { display: block; }

.spui-time {
    flex: 0 0 auto;
    min-width: 46px;
    font-size: 12px !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* ---------- Up next ---------- */
.spui-upnext {
    position: absolute;
    left: 14px;
    bottom: 84px;
    z-index: 3;
    max-width: min(330px, calc(100% - 28px));
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 12px;
    border-radius: 8px;
    background: rgba(226,230,236,.94);
    color: var(--spui-text-dark);
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    cursor: pointer;
}

.spui-upnext.spui-visible { display: flex; }

.spui-upnext-txt { min-width: 0; }

.spui-upnext-label {
    font-size: 11px;
    color: #475569;
    font-weight: 600;
}

.spui-upnext-title {
    font-size: 13px;
    font-weight: 700;
    color: #3A3FB0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spui-upnext-close {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #475569 !important;
}

.spui-upnext-close svg { width: 12px; height: 12px; }

/* ---------- Toast ---------- */
.spui-toast {
    position: absolute;
    left: 14px;
    /* bottom: 84px; */
    bottom: 50px !important;
    z-index: 25;
    max-width: calc(100% - 28px);
    padding: 9px 14px;
    border-radius: 6px;
    background: #E3F2FD;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}

.spui-toast.spui-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Dim backdrop (share / episodes) ---------- */
.spui-dim {
    position: absolute;
    inset: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 15;
    background: rgba(0,0,0,.5);
    display: none;
}

.spui-root.spui-share-open .spui-dim,
.spui-root.spui-panel-open .spui-dim { display: block; animation: spui-fade .2s ease; }

@keyframes spui-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Share ----------
   Desktop view: center popup | Mobile view (.spui-mobile): bottom se upar drawer */
.spui-share {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    width: min(380px, calc(100% - 28px));
    max-height: calc(100% - 28px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translate(-50%, -46%) scale(.96);
    padding: 16px;
    border-radius: 12px;
    background: #fff;
    color: var(--spui-text-dark);
    box-shadow: 0 16px 40px rgba(0,0,0,.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}

.spui-root.spui-share-open .spui-share {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

/* drawer handle (sirf mobile me dikhega) */
.spui-sheet-handle {
    display: none;
    width: 40px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 4px;
    background: #CBD5E1;
}

/* .spui-root.spui-mobile .spui-share { */
    .spui-root.spui-mobile:not(.spui-land) .spui-share {
    top: auto;
    left: 50%;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    max-height: 80%;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,.35);
    opacity: 1;
    transform: translate(-50%, 105%);
    transition: transform .3s cubic-bezier(.22,.61,.36,1), visibility 0s linear .3s;
}

/* .spui-root.spui-mobile.spui-share-open .spui-share { */
    .spui-root.spui-mobile.spui-share-open:not(.spui-land) .spui-share {
    transform: translate(-50%, 0);
    transition: transform .3s cubic-bezier(.22,.61,.36,1), visibility 0s;
}

/* .spui-root.spui-mobile .spui-share .spui-sheet-handle { display: block; } */
.spui-root.spui-mobile:not(.spui-land) .spui-share .spui-sheet-handle { display: block; }

.spui-share-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E2E8F0;
}

.spui-share-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--spui-text-dark);
}

.spui-share-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--spui-muted);
}

.spui-share-close {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #484C52 !important;
}

.spui-share-close svg { width: 14px; height: 14px; }

.spui-share-btns {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    padding: 14px 0 10px;
}

.spui-share-opt {
    flex: 1 1 0;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--spui-text-dark) !important;
    text-decoration: none !important;
    text-align: center;
    line-height: 1.25;
}

.spui-share-opt img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border: 1.09px solid #DCDBE3;
    border-radius: 8px;
    padding: 3px;
}

.spui-share-opt:hover { color: var(--spui-blue) !important; }

.spui-share-note {
    font-size: 11px;
    font-style: italic;
    color: #334155;
    margin: 0;
}

.spui-share-loading {
    padding: 22px 0;
    text-align: center;
    font-size: 13px;
    color: var(--spui-muted);
}

/* ---------- All Episodes (syllabus) panel ----------
   Portrait: bottom sheet | Landscape: right side card (Figma) */
.spui-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    max-height: 72%;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--spui-text-dark);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,.35);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(105%);
    transition: transform .3s cubic-bezier(.22,.61,.36,1);
    visibility: hidden;
}

.spui-panel .spui-sheet-handle { 
    /* display: block; */
     margin: 10px auto 2px;
}

.spui-root.spui-panel-open .spui-panel {
    transform: translate(0, 0);
    visibility: visible;
}

.spui-root.spui-land .spui-panel {
    left: auto;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(380px, 48%);
    max-height: none;
    border-radius: 12px;
    padding-bottom: 0;
    box-shadow: -10px 0 30px rgba(0,0,0,.35);
    transform: translateX(110%);
}

.spui-root.spui-land.spui-panel-open .spui-panel { transform: translateX(0); }

.spui-root.spui-land .spui-panel .spui-sheet-handle { display: none; }

.spui-panel-head {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 12px 16px;
    background: #F1F3F6;
    border-bottom: 1px solid #E2E8F0;
    border-radius: 16px 16px 0 0;
}

.spui-root.spui-land .spui-panel-head { border-radius: 12px 12px 0 0; }

.spui-panel-headline {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding-left: 30px; /* close button ke barabar -> title center me */
}

.spui-panel-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--spui-text-dark);
    white-space: nowrap;
}

.spui-panel-close {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #484C52 !important;
}

.spui-panel-close svg { width: 15px; height: 15px; }

/* ---- Filter dropdown: Latest / Oldest / Most Viewed ---- */
.spui-sort { position: relative; }

.spui-sort-btn {
    display: inline-flex !important;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    height: 28px;
    font-size: 16px !important;
    font-weight: 600;
    color: var(--spui-blue) !important;
    white-space: nowrap;
}

.spui-sort-val {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.spui-sort-btn .spui-chev { width: 16px; height: 16px; transition: transform .2s; }
.spui-sort-btn .spui-chev path { stroke: var(--spui-blue); }
.spui-sort.spui-open .spui-chev { transform: rotate(180deg); }

.spui-sort-menu {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 140px;
    padding: 6px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,.22);
    display: none;
    z-index: 5;
}

.spui-sort.spui-open .spui-sort-menu { display: block; }

.video-js.spui-active .spui-root .spui-sort-item {
    display: block !important;
    width: 100%;
    height: 32px;
    padding: 0 10px !important;
    border-radius: 5px;
    text-align: left;
    font-size: 14px;
    color: #94A3B8 !important;
    white-space: nowrap;
}

.video-js.spui-active .spui-root .spui-sort-item:hover { background: #F8FAFC !important; color: var(--spui-text-dark) !important; }

.video-js.spui-active .spui-root .spui-sort-item.spui-selected {
    background: #EEF0F3 !important;
    color: var(--spui-text-dark) !important;
    font-weight: 600;
}

.spui-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 6px 0 14px;
}

.spui-item {
    width: 100%;
    display: flex !important;
    align-items: flex-start;
    padding: 14px 16px !important;
    text-align: left;
    border-left: 3px solid transparent !important;
    border-bottom: 1px solid #EEF2F6 !important;
    transition: background-color .15s;
}

.spui-item:hover { background: #F8FAFC !important; }

.spui-item.spui-current {
    background: #FFF4EA !important;
    border-left-color: var(--spui-accent) !important;
}

.spui-item-body {
    flex: 1 1 auto;
    min-width: 0;
}

.spui-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* [EP 1 · (clock) 1hr] */
.spui-ep-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #EEF0F3;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.spui-ep-chip i { font-style: normal; font-weight: 700; padding: 0 1px; }
.spui-ep-chip svg { width: 14px; height: 14px; }

.spui-item-title {
    margin-top: 7px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--spui-text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spui-item-prog {
    margin-top: 8px;
    height: 3px;
    border-radius: 3px;
    background: #E2E8F0;
    overflow: hidden;
}

.spui-item-prog span {
    display: block;
    height: 100%;
    background: var(--spui-accent);
}

.spui-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.spui-tag-now { background: var(--spui-accent); color: #fff; }
.spui-tag-lock { background: rgba(255,171,6,.18); color: #B77900; }
.spui-tag svg { width: 11px; height: 11px; }
.spui-tag-live { background: #E11D48; color: #fff; }
.spui-tag-soon { background: #E2E8F0; color: #475569; }

.spui-item.spui-dim-item .spui-item-title { color: #94A3B8; }

/* ---------- Landscape / compact tweaks (same design, sizes adjust) ---------- */
.spui-root.spui-compact .spui-top { padding: 8px 12px; }
.spui-root.spui-compact .spui-title { font-size: 14px; }
.spui-root.spui-compact .spui-cbtn.spui-play { width: 75px; height: 75px; }
.spui-root.spui-compact .spui-cbtn.spui-play svg { width: 32px; height: 32px; }
.spui-root.spui-compact .spui-bottom { padding-bottom: 4px; }
.spui-root.spui-compact .spui-act { font-size: 12px; }
.spui-root.spui-compact .spui-rotate { top: 50px; right: 12px; }
.spui-root.spui-compact .spui-cross { bottom: 64px; }
.spui-root.spui-compact.spui-mobile.spui-touch.spui-land .spui-cross { bottom: auto; right: 14px; }
.spui-root.spui-compact .spui-upnext,
.spui-root.spui-compact .spui-toast { bottom: 78px; }

/* landscape: bottom wale cards bahut chaude na hon */
.spui-root.spui-land .spui-upnext,
.spui-root.spui-land .spui-toast { max-width: min(360px, calc(100% - 90px)); }

.spui-root.spui-wide .spui-cbtn { width: 52px; height: 52px; }
.spui-root.spui-wide .spui-cbtn svg { width: 34px; height: 34px; }
.spui-root.spui-wide .spui-cbtn.spui-play { width: 85px; height: 84px; }
.spui-root.spui-wide .spui-cbtn.spui-play svg { width: 36px; height: 36px; }
.spui-root.spui-wide .spui-title { font-size: 17px; }
.spui-root.spui-wide .spui-top { padding: 16px 22px; }
.spui-root.spui-wide .spui-bottom { padding: 0 22px 10px; }
.spui-root.spui-wide .spui-act { font-size: 14px; }
.spui-root.spui-wide .spui-rotate { top: 70px; right: 22px; }
.spui-root.spui-wide .spui-cross { bottom: 70px; }
.spui-root.spui-wide.spui-mobile.spui-touch.spui-land .spui-cross { bottom: auto; right: 26px; }
.spui-root.spui-wide .spui-upnext,
.spui-root.spui-wide .spui-toast { left: 22px; bottom: 92px; }

/* ---------- CSS rotate (iPhone / desktop emulator / lock fail) ----------
   Player element ko NAHI ghumate (browser fullscreen me uspar
   transform:none !important laga deta hai). Uske andar video + controls
   ko ghumate hain. Size / angle JS se CSS variables me aate hain. */
.video-js.spui-active.spui-rotated .vjs-tech,
.video-js.spui-active.spui-rotated .vjs-poster,
.video-js.spui-active.spui-rotated .spui-root {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: var(--spui-rw, 100vh) !important;
    height: var(--spui-rh, 100vw) !important;
    max-width: none !important;
    max-height: none !important;
    -webkit-transform: translate(-50%, -50%) rotate(var(--spui-rdeg, 90deg)) !important;
    transform: translate(-50%, -50%) rotate(var(--spui-rdeg, 90deg)) !important;
    -webkit-transform-origin: 50% 50% !important;
    transform-origin: 50% 50% !important;
}

/* rotate hone par safe-area ki side badal jaati hai */
.spui-root.spui-rotated-root {
    padding: env(safe-area-inset-left, 0px) env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px);
}

@media (prefers-reduced-motion: reduce) {
    .spui-root *,
    .spui-panel,
    .spui-share,
    .spui-scrim,
    .spui-layer { transition: none !important; animation: none !important; }
}

/* ---------- video.js ke ".video-js button {display:inline-block}" ko override ---------- */
.video-js.spui-active .spui-root .spui-back,
.video-js.spui-active .spui-root .spui-mute,
.video-js.spui-active .spui-root .spui-rotate,
.video-js.spui-active .spui-root .spui-cross,
.video-js.spui-active .spui-root .spui-cbtn,
.video-js.spui-active .spui-root .spui-panel-close,
.video-js.spui-active .spui-root .spui-share-close,
.video-js.spui-active .spui-root .spui-upnext-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.video-js.spui-active .spui-root .spui-speed-btn {
    display: inline-flex !important;
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
    width: auto;
}

.video-js.spui-active .spui-root .spui-share-opt {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}

.video-js.spui-active .spui-root .spui-item,
.video-js.spui-active .spui-root .spui-act,
.video-js.spui-active .spui-root .spui-speed-item {
    display: flex !important;
    flex-direction: row;
    /* flex-direction: row-reverse; */
}

.video-js.spui-active .spui-root .spui-time {
    display: block !important;
}

.video-js.spui-active .spui-root .spui-cbtn.spui-hidden {
    display: none !important;
}

.video-js.spui-active .spui-root .spui-act.spui-hidden {
    display: none !important;
}

/* ---------- Trailer ----------
   Trailer me Save / All Episodes / Share (poora action bar) nahi dikhta.
   Cross, seekbar, play controls, rotate pehle jaise. */
.video-js.spui-active .spui-root.spui-trailer .spui-actions,
.video-js.spui-active .spui-root.spui-trailer .spui-share,
.video-js.spui-active .spui-root.spui-trailer .spui-panel {
    display: none !important;
}

/* action bar nahi hai -> uske liye neeche ka gradient bhi nahi */
.spui-root.spui-trailer .spui-bottom::before { display: none; }

/* action bar ki jagah khaali -> seekbar, cross, toast thoda neeche */
.spui-root.spui-trailer .spui-bottom { padding-bottom: 10px; }
.spui-root.spui-trailer .spui-cross { bottom: 36px; }
.video-js.spui-active .spui-root.spui-trailer .spui-toast,
.video-js.spui-active .spui-root.spui-trailer .spui-upnext { bottom: 84px; }

/* ---------- Single video / Trailer / Feature (isfeature) mode ----------
   All Episodes / Up Next sirf series episode me dikhte hain.
   Save left aur Share right me hi rahenge (beech ki jagah khaali) */
.video-js.spui-active .spui-root.spui-single .spui-episodes-btn,
.video-js.spui-active .spui-root.spui-single .spui-upnext,
.video-js.spui-active .spui-root.spui-single .spui-panel {
    display: none !important;
}

/* Mute / Unmute icon hide */
.video-js.spui-active .spui-root .spui-top-right .spui-mute {
    display: none !important;
}


@media screen and (max-width: 991px) {
    .spui-root.spui-mobile .spui-share {
        max-width: 100%;
    }
    .spui-share-head{
        border:none;
    }
}

/* ---------- Locked episode: Unlock popup (player ke andar) ----------
   Mobile portrait: neeche se drawer (All Episodes drawer ke UPAR)
   Desktop / landscape: center popup
   z-index: panel / share = 20  ->  unlock dim 21, unlock card 22 */
.spui-unlock-dim {
    position: absolute;
    inset: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 21;
    background: rgba(0,0,0,.45);
    display: none;
}

.spui-root.spui-unlock-open .spui-unlock-dim { display: block; animation: spui-fade .2s ease; }

.spui-unlock {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 22;
    width: min(330px, calc(100% - 28px));
    max-height: calc(100% - 28px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
    padding: 32px 16px 16px;
    border-radius: 16px;
    background: #fff;
    color: var(--spui-text-dark);
    text-align: center;
    box-shadow: 0 16px 40px rgba(0,0,0,.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -46%) scale(.96);
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}

.spui-root.spui-unlock-open .spui-unlock {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

/* mobile portrait: bottom drawer */
/* */



.video-js.spui-active .spui-root .spui-unlock-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #484C52 !important;
}

.spui-unlock-close svg { width: 13px; height: 13px; }

.spui-unlock-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--spui-text-dark);
}

.spui-unlock-text {
    font-size: 14px;
    line-height: 1.45;
    color: #475569;
    max-width: 300px;
}

.video-js.spui-active .spui-root .spui-unlock-btn {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: 8px;
    background: var(--spui-accent);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
}

.video-js.spui-active .spui-root .spui-unlock-btn:hover { background: var(--spui-accent-dark); }