/* =============================================================
   Daricheh Cinema Player — immersive dark-blue VOD controls
   ============================================================= */

.watch-page {
  padding-bottom: 3rem;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(700px 360px at 10% 40%, rgba(244, 63, 94, 0.08), transparent 50%),
    transparent;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.player [hidden] { display: none !important; }

.player-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0.85rem 1rem 0;
}

.player {
  --pl-accent: #6366f1;
  --pl-accent-2: #818cf8;
  --pl-play: #f43f5e;
  --pl-glass: rgba(8, 14, 28, 0.72);
  --pl-line: rgba(99, 102, 241, 0.28);
  --pl-ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #020617;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.16),
    0 28px 70px rgba(0, 0, 0, 0.55);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: #eef3ff;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  isolation: isolate;
}

.player::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.35);
}

.player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

.ph {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
  flex-shrink: 0;
}
.ph-lg { width: 36px; height: 36px; }
.ph-spin { animation: player-spin 0.8s linear infinite; }
@keyframes player-spin { to { transform: rotate(360deg); } }

/* Top chrome */
.player-top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.35) 70%, transparent 100%);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms var(--pl-ease), transform 200ms var(--pl-ease);
  pointer-events: none;
  direction: rtl;
}
.player.is-active .player-top,
.player.is-paused .player-top {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.player-back {
  width: 42px;
  height: 42px;
  border: 1px solid var(--pl-line);
  border-radius: 999px;
  background: var(--pl-glass);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
  cursor: pointer;
  flex-shrink: 0;
}
.player-back:hover {
  background: var(--pl-accent);
  border-color: transparent;
}
.player-top-copy {
  min-width: 0;
  flex: 1;
}
.player-top-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7dd3fc;
}
.player-top-title {
  margin: 0.1rem 0 0;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}

.player-shade {
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  background:
    linear-gradient(transparent 0%, rgba(2, 6, 23, 0.55) 40%, rgba(2, 6, 23, 0.94) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms var(--pl-ease);
  z-index: 2;
}
.player.is-active .player-shade,
.player.is-paused .player-shade { opacity: 1; }

.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle at center, rgba(2, 6, 23, 0.35), transparent 60%);
}
.player-loading .ph { color: var(--pl-accent-2); }

.big-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--pl-play), #e11d48);
  color: white;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 10px rgba(244, 63, 94, 0.16),
    0 16px 40px rgba(244, 63, 94, 0.35);
  z-index: 3;
  cursor: pointer;
  transition: transform 180ms var(--pl-ease), box-shadow 180ms var(--pl-ease);
}
.big-play:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 14px rgba(244, 63, 94, 0.2),
    0 20px 48px rgba(244, 63, 94, 0.42);
}
.big-play:focus-visible {
  outline: 2px solid var(--pl-accent-2);
  outline-offset: 4px;
}
.player.is-playing .big-play,
.player.is-loading .big-play { display: none; }

.skip-flash {
  position: absolute;
  top: 50%;
  left: 8%;
  transform: translateY(-50%) scale(0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 78px;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  background: rgba(8, 14, 28, 0.72);
  border: 1px solid var(--pl-line);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 4;
  animation: skip-pop 520ms var(--pl-ease);
}
.skip-flash.is-fwd {
  left: auto;
  right: 8%;
}
@keyframes skip-pop {
  from { opacity: 0; transform: translateY(-50%) scale(0.8); }
  40% { opacity: 1; transform: translateY(-50%) scale(1); }
  to { opacity: 0; transform: translateY(-50%) scale(1.05); }
}

.player-bar {
  position: absolute;
  inset: auto 0 0;
  padding: 0 0.85rem 0.85rem;
  z-index: 6;
  direction: ltr;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms var(--pl-ease), transform 200ms var(--pl-ease);
  pointer-events: none;
}
.player.is-active .player-bar,
.player.is-paused .player-bar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.seek {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  margin-bottom: 0.15rem;
}
.seek-track {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  transition: height 140ms var(--pl-ease);
}
.seek:hover .seek-track,
.seek.is-scrubbing .seek-track { height: 7px; }
.seek-buffer,
.seek-played {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
}
.seek-buffer { background: rgba(255, 255, 255, 0.32); }
.seek-played {
  background: linear-gradient(90deg, var(--pl-play), var(--pl-accent));
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
}
.seek-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pl-accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%) scale(0.55);
  opacity: 0.85;
  pointer-events: none;
  transition: transform 140ms var(--pl-ease), opacity 140ms var(--pl-ease);
}
.player.is-active .seek-thumb,
.seek:hover .seek-thumb,
.seek.is-scrubbing .seek-thumb {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 48px;
  padding: 0.15rem 0.2rem;
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.45);
  border: 1px solid rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(14px) saturate(1.15);
}
.bar-left,
.bar-right {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
}

.ctrl {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f8fafc;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  transition: background 140ms var(--pl-ease), color 140ms var(--pl-ease), transform 140ms var(--pl-ease);
}
.ctrl:hover {
  background: rgba(99, 102, 241, 0.16);
  color: #fff;
}
.ctrl:active { transform: scale(0.94); }
.ctrl:focus-visible {
  outline: 2px solid var(--pl-accent-2);
  outline-offset: 2px;
}
.ctrl.is-on {
  color: var(--pl-accent-2);
  background: rgba(99, 102, 241, 0.18);
}
.ctrl.is-disabled,
.ctrl:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
#playBtn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
}
#playBtn:hover {
  background: var(--pl-play);
  color: #fff;
}
#playBtn .i-pause { display: none !important; }
.player.is-playing #playBtn .i-play { display: none !important; }
.player.is-playing #playBtn .i-pause { display: block !important; }

.vol-wrap .i-vol-low,
.vol-wrap .i-vol-mute { display: none !important; }
.vol-wrap[data-vol="low"] .i-vol-high,
.vol-wrap[data-vol="mute"] .i-vol-high { display: none !important; }
.vol-wrap[data-vol="low"] .i-vol-low { display: block !important; }
.vol-wrap[data-vol="mute"] .i-vol-mute { display: block !important; }

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  position: relative;
  padding-inline-end: 0.25rem;
}
.vol {
  --vol: 100%;
  width: 90px;
  height: 24px;
  margin: 0 4px 0 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.vol:focus { outline: none; }
.vol::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--pl-accent) var(--vol),
    rgba(255, 255, 255, 0.22) var(--vol)
  );
}
.vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.vol::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
.vol::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--pl-accent);
}
.vol::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.time {
  margin-inline-start: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  font-weight: 600;
  color: #dbe7ff;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.time-sep { opacity: 0.45; }

.ctrl-menu { position: relative; }
.menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  min-width: 148px;
  padding: 0.4rem;
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.96);
  border: 1px solid var(--pl-line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  z-index: 8;
}
.menu button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: start;
  padding: 0 0.7rem;
  cursor: pointer;
}
.menu button:hover,
.menu button.is-on {
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
}

.paywall {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 4;
  background:
    linear-gradient(160deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.92)),
    center / cover no-repeat;
}
.paywall-card {
  width: min(460px, calc(100% - 2rem));
  background: rgba(10, 18, 36, 0.92);
  border: 1px solid var(--pl-line);
  border-radius: 20px;
  padding: 1.6rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}
.paywall-card h2 {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  font-weight: 900;
}
.paywall-card p {
  margin: 0 0 1.1rem;
  color: #9fb0d0;
}

.player-error {
  position: absolute;
  inset-inline: 1rem;
  bottom: 5.5rem;
  background: rgba(8, 14, 28, 0.9);
  color: #93c5fd;
  border: 1px solid var(--pl-line);
  padding: 0.7rem 1rem;
  border-radius: 12px;
  z-index: 7;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

/* Watch meta below player */
.watch-meta {
  margin-top: 1.35rem;
  padding-bottom: 0.5rem;
}
.watch-meta-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}
@media (min-width: 900px) {
  .watch-meta-grid {
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 1.5rem;
  }
}
.watch-poster-side {
  display: none;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
@media (min-width: 900px) {
  .watch-poster-side { display: block; }
}
.watch-poster-side img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}
.watch-meta h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.watch-meta .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}
.watch-meta .hero-meta span,
.watch-meta .content-tags .tag {
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: rgba(15, 30, 60, 0.55);
  border: 1px solid rgba(99, 102, 241, 0.22);
  font-size: 0.82rem;
  font-weight: 600;
  color: #dbe7ff;
}
.watch-desc {
  color: #b6c4e0;
  line-height: 1.75;
  max-width: 52rem;
}

.player:fullscreen,
.player:-webkit-full-screen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0 !important;
  box-shadow: none;
}
.player:fullscreen .player-bar,
.player:-webkit-full-screen .player-bar {
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
}
.player:fullscreen .player-top,
.player:-webkit-full-screen .player-top {
  padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
}
/* In fullscreen, controls only show via .is-active — never sticky on :hover */
.player:fullscreen:not(.is-active) .player-bar,
.player:fullscreen:not(.is-active) .player-top,
.player:fullscreen:not(.is-active) .player-shade,
.player:-webkit-full-screen:not(.is-active) .player-bar,
.player:-webkit-full-screen:not(.is-active) .player-top,
.player:-webkit-full-screen:not(.is-active) .player-shade {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: none;
}
.player:fullscreen:not(.is-active),
.player:-webkit-full-screen:not(.is-active) {
  cursor: none;
}

@media (hover: hover) and (pointer: fine) {
  .player:hover:not(:fullscreen):not(:-webkit-full-screen) .player-shade,
  .player:hover:not(:fullscreen):not(:-webkit-full-screen) .player-bar,
  .player:hover:not(:fullscreen):not(:-webkit-full-screen) .player-top {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

@media (max-width: 768px) {
  .player-shell {
    width: 100%;
    padding: 0;
  }
  .player {
    border-radius: 0 !important;
    box-shadow: none;
    width: 100%;
  }
  .player-top {
    padding: 0.65rem 0.75rem;
  }
  .player-back {
    width: 38px;
    height: 38px;
  }
  .player-bar {
    padding: 0 0.5rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  }
  .bar-row {
    min-height: 44px;
    padding: 0.1rem;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }
  .seek { height: 28px; }
  .seek-track { height: 4px; }
  .ctrl-skip { display: none; }
  .vol { width: 64px; min-width: 64px; }
  .time { font-size: 0.72rem; padding: 0.2rem 0.4rem; }
  .big-play { width: 64px; height: 64px; }
  .watch-page { padding-bottom: 1.5rem; }
  .watch-meta {
    margin-top: 1rem;
    padding-inline: 1rem;
  }
  .watch-meta h1 { font-size: 1.25rem; }
}

@media (max-width: 420px) {
  .time-sep,
  #timeDur { display: none; }
  .vol { display: none; }
  .vol-wrap.is-open .vol { display: block; width: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  .big-play,
  .player-bar,
  .player-top,
  .player-shade,
  .seek-thumb,
  .skip-flash,
  .ph-spin {
    animation: none !important;
    transition: none !important;
  }
}
