/*
 * FilmKio-like skin for Video.js on /play.
 * Black bars around the picture: usually letterbox/pillarbox (video aspect != frame) — same as native <video> with object-fit: contain.
 * Extra black bands from layout: fixed by full-bleed frame + overlay head (no separate topbar).
 * Subtitles: style .vjs-text-track-cue only — not every div under .vjs-text-track-display (that caused a full-player black overlay).
 */
body.play_online {
  background: #000;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif;
}

.tamasha-videojs-shell {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  background: #000;
  color: #fff;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif;
}

.tamasha-player-stage {
  background: #000;
}

.tamasha-player-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

/* Overlay header — mirrors FilmKio .head_controller */
.tamasha-player-head {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  pointer-events: none;
}

.tamasha-player-head-inner {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px 0 0;
  pointer-events: auto;
}

.tamasha-player-back {
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  color: #fff;
  text-decoration: none;
}

.tamasha-player-back-icon {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.tamasha-player-title {
  flex: 1;
  min-width: 0;
  margin-top: 5px;
  padding: 0 12px 0 80px;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tamasha-filmkio-skin .video-js {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif;
}

.tamasha-filmkio-skin .video-js .vjs-tech {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Big play area — soft vignette like FilmKio .main_play_button_holder */
.tamasha-filmkio-skin .vjs-big-play-button {
  z-index: 12;
  border: 0;
  border-radius: 50%;
  width: 88px;
  height: 88px;
  line-height: 88px;
  margin-top: -44px;
  margin-left: -44px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.tamasha-filmkio-skin .vjs-big-play-button .vjs-icon-placeholder::before {
  font-size: 2.8em;
}

/* Foot bar — FilmKio .foot_controller spacing */
/* Default Video.js bar hidden — custom FilmKio-like foot replaces it */
.tamasha-filmkio-skin .vjs-control-bar {
  display: none !important;
}

.tamasha-fk-symbols-hidden {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.tamasha-fk-foot {
  /* Isolate from page RTL so flex order matches FilmKio (LTR control strip). */
  direction: ltr;
  unicode-bidi: isolate;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 24;
  padding: 6px 10px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 40%, rgba(0, 0, 0, 0.92) 100%);
  pointer-events: auto;
  box-sizing: border-box;
}

.tamasha-fk-time_row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.tamasha-fk-progress_wrap {
  position: relative;
  flex: 1;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.tamasha-fk-progress_wrap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 5px;
  background: hsla(0, 0%, 100%, 0.22);
}

.tamasha-fk-buffer {
  position: absolute;
  left: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 5px;
  background: rgba(233, 131, 8, 0.38);
  width: 0%;
  pointer-events: none;
  z-index: 1;
}

.tamasha-fk-played {
  position: absolute;
  left: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 5px;
  background: #d79608;
  width: 0%;
  pointer-events: none;
  z-index: 2;
}

.tamasha-fk-scrub {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #f5ad11;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  left: 0%;
  z-index: 3;
  pointer-events: none;
}

.tamasha-fk-hover_time {
  position: absolute;
  bottom: 100%;
  margin-bottom: 6px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(11, 14, 15, 0.92);
  color: #fff;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 4;
}

.tamasha-fk-button_bar {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  min-height: 70px;
}

.tamasha-fk-left_btns,
.tamasha-fk-right_btns {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

.tamasha-fk-spacer {
  flex: 1;
  min-width: 8px;
}

.tamasha-fk-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  overflow: visible;
}

.tamasha-fk-btn:hover {
  background: hsla(0, 0%, 100%, 0.06);
}

.tamasha-fk-icon {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.tamasha-fk-settings .tamasha-fk-icon {
  width: 32px;
  height: 32px;
}

.tamasha-fk-hover_panel {
  position: absolute;
  bottom: calc(100% - 6px);
  right: 0;
  left: auto;
  transform: none;
  min-width: 0;
  width: max-content;
  max-width: min(300px, calc(100vw - 20px));
  max-height: min(55vh, calc(100dvh - 120px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 12px;
  border-radius: 8px;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  background: rgba(11, 14, 15, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 40;
  box-sizing: border-box;
  word-wrap: break-word;
}

.tamasha-fk-hover_panel.is-open {
  display: block;
}

.tamasha-fk-settings_panel,
.tamasha-fk-subs_panel {
  direction: rtl;
  text-align: right;
}

.tamasha-fk-vol_panel {
  bottom: 72px;
  min-width: 56px;
  padding: 14px 10px 18px;
}

.tamasha-fk-vol_track {
  position: relative;
  width: 8px;
  height: 120px;
  margin: 0 auto;
  border-radius: 6px;
  background: hsla(0, 0%, 100%, 0.18);
  cursor: pointer;
}

.tamasha-fk-vol_fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70%;
  border-radius: 6px;
  background: linear-gradient(180deg, #f5ad11, #d79608);
  pointer-events: none;
}

.tamasha-fk-vol_knob {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.tamasha-fk-panel_row {
  margin-top: 10px;
}

.tamasha-fk-panel_row:first-child {
  margin-top: 0;
}

.tamasha-fk-panel_title {
  font-size: 0.95rem;
  font-weight: 600;
  color: hsla(0, 0%, 100%, 0.88);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.08);
}

.tamasha-fk-panel_opts {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.tamasha-fk-panel_opts--wrap {
  justify-content: flex-start;
}

.tamasha-fk-opt {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid hsla(0, 0%, 100%, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.tamasha-fk-opt.is-active,
.tamasha-fk-opt:hover {
  border-color: rgba(245, 173, 17, 0.45);
  color: #f5ad11;
  background: rgba(245, 173, 17, 0.1);
}

.tamasha-fk-quality_host {
  position: relative;
  display: flex;
  align-items: center;
}

.tamasha-fk-quality_wrap {
  position: relative;
}

.tamasha-fk-quality_trigger {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.tamasha-fk-quality_wrap.is-open .tamasha-fk-quality_trigger {
  border-color: hsla(0, 0%, 100%, 0.35);
}

.tamasha-fk-quality_label {
  opacity: 0.85;
  font-size: 0.9rem;
  font-weight: 500;
}

.tamasha-fk-quality_value {
  color: #f5ad11;
  font-size: 1.05rem;
}

.tamasha-fk-quality_dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 150px;
  max-width: min(300px, calc(100vw - 20px));
  max-height: 55vh;
  overflow-y: auto;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: 6px;
  background: rgba(11, 14, 15, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.tamasha-fk-quality_dropdown[hidden] {
  display: none !important;
}

.tamasha-fk-quality_item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border: 0;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.06);
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.tamasha-fk-quality_item:last-child {
  border-bottom: 0;
}

.tamasha-fk-quality_item.is-active,
.tamasha-fk-quality_item:hover {
  background: rgba(245, 173, 17, 0.12);
  color: #f5ad11;
}

.tamasha-filmkio-skin .vjs-progress-holder {
  height: 5px;
  border-radius: 5px;
  margin: 0;
}

.tamasha-filmkio-skin .vjs-play-progress {
  background-color: #d79608;
  border-radius: 5px;
}

.tamasha-filmkio-skin .vjs-load-progress div {
  background: rgba(233, 131, 8, 0.45);
  border-radius: 5px;
}

.tamasha-filmkio-skin .vjs-slider {
  background-color: hsla(0, 0%, 100%, 0.2);
  border-radius: 5px;
}

.tamasha-filmkio-skin .vjs-time-control {
  font-size: 1.05rem;
  font-weight: 600;
  padding-left: 0.6em;
  padding-right: 0.6em;
}

.tamasha-filmkio-skin .vjs-button > .vjs-icon-placeholder::before {
  font-size: 1.85em;
  line-height: 1.65;
}

/* Do not style every div under .vjs-text-track-display — wrappers are full-size and would paint the whole player black. */
.tamasha-filmkio-skin .vjs-text-track-display {
  background: transparent !important;
}

.tamasha-filmkio-skin .vjs-text-track-cue {
  font-size: var(--tamasha-subtitle-size, 28.96px) !important;
  color: var(--tamasha-subtitle-color, #fff) !important;
  background: var(--tamasha-subtitle-bg, rgba(0, 0, 0, 0.5)) !important;
  font-family: "iranyekan", "YekanBakh", system-ui, sans-serif !important;
  line-height: 1.5 !important;
}

.tamasha-filmkio-skin .vjs-text-track-cue > div {
  background: transparent !important;
  color: inherit !important;
  font-size: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
}

.tamasha-series-nav {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 96px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: auto;
}

.tamasha-series-btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid hsla(0, 0%, 100%, 0.12);
  border-radius: 6px;
  background: rgba(11, 14, 15, 0.88);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tamasha-series-now {
  height: 38px;
  line-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid hsla(0, 0%, 100%, 0.08);
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Auto-hide control bar */
.tamasha-fk-foot {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tamasha-fk-foot.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.tamasha-fk-audio_panel {
  direction: rtl;
  text-align: right;
  min-width: 180px;
}

/* Mobile / touch */
@media (max-width: 640px) {
  .tamasha-fk-foot {
    padding: 4px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .tamasha-fk-btn {
    width: 52px;
    height: 52px;
  }

  .tamasha-fk-icon {
    width: 28px;
    height: 28px;
  }

  .tamasha-fk-button_bar {
    min-height: 54px;
  }

  .tamasha-fk-time_row {
    font-size: 0.9rem;
    gap: 6px;
  }

  .tamasha-fk-quality_trigger {
    min-width: 90px;
    min-height: 40px;
    padding: 6px 8px;
    font-size: 0.85rem;
  }

  .tamasha-fk-hover_panel {
    max-width: calc(100vw - 16px);
  }

  .tamasha-fk-vol_panel {
    bottom: 56px;
  }

  .tamasha-player-back {
    width: 56px;
    height: 56px;
  }

  .tamasha-player-back-icon {
    width: 28px;
    height: 28px;
  }

  .tamasha-player-title {
    font-size: 1.1rem;
    padding: 0 8px 0 48px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .tamasha-fk-btn:active {
    background: hsla(0, 0%, 100%, 0.12);
  }

  .tamasha-fk-vol_panel {
    display: none;
  }

  .tamasha-fk-volume:focus-within .tamasha-fk-vol_panel,
  .tamasha-fk-vol_panel.is-open {
    display: block;
  }
}

/* Double-tap seek feedback (YouTube-style) */
.tamasha-seek-hints {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

.tamasha-seek-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.85);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tamasha-seek-hint--back {
  left: 12%;
}

.tamasha-seek-hint--fwd {
  right: 12%;
}

.tamasha-seek-hint.is-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.tamasha-seek-hint__ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.tamasha-seek-hint__ring i {
  font-size: 1.25rem;
  opacity: 0.9;
}

@media (max-width: 640px) {
  .tamasha-seek-hint__ring {
    width: 76px;
    height: 76px;
    font-size: 0.72rem;
  }

  .tamasha-seek-hint--back {
    left: 8%;
  }

  .tamasha-seek-hint--fwd {
    right: 8%;
  }
}
