/* Homepage video player (js/sfy-video.js). Colours and surfaces come from the site tokens (--pro-*),
   so light and dark theme both work. Captions use the extension's default look (white text on a dark pill,
   weight 700) in the site fonts. */

.sfy-vp { width: min(960px, 100%); margin: 0 auto; display: grid; gap: 14px; }
.sfy-vp [hidden] { display: none !important; }

/* Frame: 16:9, rounded corners, the video and the caption layer sit inside it */
.sfy-vp-stage { position: relative; aspect-ratio: 16 / 9; border-radius: .5rem; overflow: hidden; background: #07060a; border: 1px solid var(--pro-line2, rgba(255,255,255,.14)); container-type: inline-size; }
.sfy-vp-video, .sfy-vp-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sfy-vp-video { opacity: 0; cursor: pointer; transition: opacity .3s ease; border-radius: .5rem; }
.sfy-vp-stage.is-ready .sfy-vp-video { opacity: 1; }
.sfy-vp-stage.is-ready .sfy-vp-fallback { display: none; }

/* Caption: drawn by the page (the browser's own cue box cannot take a rounded pill) */
.sfy-vp-cap { position: absolute; inset-inline: 0; bottom: 6%; max-height: 46%; overflow: hidden; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .25em; padding: 0 4%; pointer-events: none; }
.sfy-vp-cap-line { max-width: 94%; padding: .14em .6em; border-radius: .9em; background: rgba(8, 10, 14, .78); color: #fff; font-family: Vazirmatn, system-ui, sans-serif; font-weight: 700; font-size: 14px; font-size: clamp(12px, 3.4cqi, 22px); line-height: 1.4; text-align: center; text-shadow: 0 2px 7px #000; white-space: pre-line; unicode-bidi: plaintext; }

/* Transport: play, seek, time */
.sfy-vp-bar { display: flex; align-items: center; gap: 12px; }
.sfy-vp-play { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: 0; background: var(--pro-text, #f8f8fa); color: var(--pro-bg, #07070a); font-size: 14px; cursor: pointer; display: grid; place-items: center; }
.sfy-vp-seek { flex: 1 1 auto; min-width: 0; height: 4px; accent-color: var(--pro-purple, #9b78ff); cursor: pointer; }
.sfy-vp-time { flex: 0 0 auto; min-width: 84px; text-align: end; font-size: 13px; color: var(--pro-muted, #a5a5b0); font-variant-numeric: tabular-nums; direction: ltr; }

/* Dub and subtitle sections: two cards side by side on wide screens, stacked on phones */
.sfy-vp-panel { display: grid; gap: 12px; }
@media (min-width: 760px) { .sfy-vp-panel { grid-template-columns: 1fr 1fr; } }
.sfy-vp-sec { display: grid; gap: 14px; align-content: start; padding: 16px; border: 1px solid var(--pro-line, rgba(255,255,255,.09)); border-radius: 14px; background: var(--pro-surface, #101015); }
.sfy-vp-sec, .sfy-vp-sec-head, .sfy-vp-sec-txt { text-align: start; }
.sfy-vp-sec-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.sfy-vp-sec-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--pro-surface2, #15151c); color: var(--pro-purple, #9b78ff); }
.sfy-vp-sec-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sfy-vp-sec-txt { min-width: 0; flex: 1 1 auto; }
.sfy-vp-sec-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--pro-text, #f8f8fa); }
.sfy-vp-sec-hint { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--pro-muted, #a5a5b0); }

/* On / off switch for subtitles */
.sfy-vp-switch { margin-inline-start: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 8px; border: 1px solid var(--pro-line2, rgba(255,255,255,.14)); border-radius: 999px; background: transparent; color: var(--pro-text, #f8f8fa); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sfy-vp-switch-track { position: relative; width: 36px; height: 22px; border-radius: 999px; background: var(--pro-surface2, #15151c); transition: background .2s ease; }
.sfy-vp-switch-knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--pro-muted, #a5a5b0); transition: inset-inline-start .2s ease, background .2s ease; }
.sfy-vp-switch[aria-pressed="true"] .sfy-vp-switch-track { background: var(--pro-purple, #9b78ff); }
.sfy-vp-switch[aria-pressed="true"] .sfy-vp-switch-knob { background: #fff; inset-inline-start: calc(100% - 19px); }

/* Language choices: one segmented control per section */
.sfy-vp-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--pro-surface2, #15151c); border: 1px solid var(--pro-line, rgba(255,255,255,.09)); }
.sfy-vp-seg button { flex: 1 1 auto; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--pro-muted, #a5a5b0); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .18s ease, color .18s ease; }
.sfy-vp-seg button:hover { color: var(--pro-text, #f8f8fa); }
.sfy-vp-seg button[aria-pressed="true"] { background: var(--pro-text, #f8f8fa); color: var(--pro-bg, #07070a); }

.sfy-vp button:focus-visible, .sfy-vp input:focus-visible { outline: 2px solid var(--pro-purple, #9b78ff); outline-offset: 2px; }

@media (max-width: 620px) {
  .sfy-vp-time { display: none; }
  .sfy-vp-sec { padding: 14px; }
  /* On phones the switch gets its own full-width row, so the hint keeps its line length */
  .sfy-vp-sec-head .sfy-vp-switch { flex: 1 1 100%; margin-inline-start: 0; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .sfy-vp-video, .sfy-vp-switch-track, .sfy-vp-switch-knob, .sfy-vp-seg button { transition: none; }
}
