/* =========================================================================
 * Shared custom video player — used on the watch page AND the admin preview.
 * Self-sufficient var() fallbacks so it works under app.css or admin.css.
 * ========================================================================= */
.player { position: relative; width: 100%; background: #000; border-radius: var(--radius, 12px);
  overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.35)); }
.player-video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* Aspect-ratio fallback for older mobile Safari: without it the poster sizes
   the <video> to its own intrinsic height, so the player suddenly balloons and
   the layout jumps. Force a 16:9 box via padding + absolutely-fill the video. */
@supports not (aspect-ratio: 16 / 9) {
  .player { aspect-ratio: auto; height: 0; padding-top: 56.25%; }
  .player-video { position: absolute; inset: 0; }
}
.player-bigplay { position: absolute; inset: 0; margin: auto; width: 78px; height: 78px;
  border-radius: 50%; border: 0; cursor: pointer; font-size: 26px; color: #fff;
  background: rgba(255,36,54,.9); display: grid; place-items: center; }
.player.playing .player-bigplay { display: none; }

/* Brand watermark — shown during playback only (the poster already carries a
   baked-in logo, so we hide the live overlay until the poster is gone). */
.player-watermark { position: absolute; top: 10px; right: 12px; z-index: 3; pointer-events: none;
  opacity: 0; transition: opacity .2s; }
.player-watermark img { height: 26px; width: auto; display: block;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.player.playing .player-watermark { opacity: .6; }

.player-controls { position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); opacity: 0; transition: .2s; }
.player:hover .player-controls, .player.playing .player-controls { opacity: 1; }
.pc-btn { background: none; border: 0; color: #fff; cursor: pointer; font-size: 15px; padding: 4px; }
.pc-time { color: #fff; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc-progress { flex: 1; height: 6px; background: rgba(255,255,255,.25); border-radius: 3px; cursor: pointer; }
.pc-progress-fill { height: 100%; width: 0; background: var(--primary, #ff2436); border-radius: 3px; }
.pc-volume { display: flex; align-items: center; gap: 4px; }
.pc-volume input { width: 70px; accent-color: var(--primary, #ff2436); }
.pc-speed { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 6px; padding: 2px 4px; }

/* Subtitle CC menu */
.pc-cc { position: relative; }
.cc-list { position: absolute; bottom: 130%; right: 0; list-style: none; margin: 0; padding: 6px;
  background: rgba(20,20,28,.97); border: 1px solid var(--border, #262633); border-radius: 8px;
  min-width: 160px; box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.35)); z-index: 5; }
.cc-list button { display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text, #ece9f1); padding: .5em .6em; border-radius: 6px; cursor: pointer; font-size: 14px; }
.cc-list button:hover { background: var(--bg-3, #1c1c28); }
.cc-list button[aria-current] { color: var(--primary-2, #ff5568); font-weight: 700; }

/* Player language menu (switches whole site locale — front only) */
.pc-lang { position: relative; }
.lang-list { position: absolute; bottom: 130%; right: 0; list-style: none; margin: 0; padding: 6px;
  background: rgba(20,20,28,.97); border: 1px solid var(--border, #262633); border-radius: 8px;
  min-width: 190px; box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.35)); z-index: 5; }
.lang-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--text, #ece9f1); padding: .5em .6em; border-radius: 6px; cursor: pointer; font-size: 14px;
  text-decoration: none; }
.lang-list a:hover { background: var(--bg-3, #1c1c28); }
.lang-list a[aria-current] { color: var(--primary-2, #ff5568); font-weight: 700; }
.cc-badge { font-size: 10px; font-weight: 800; letter-spacing: .5px; padding: 1px 5px; border-radius: 4px;
  background: var(--primary, #ff2436); color: #fff; }

/* Cue styling — JS lifts the line to ~82% so it clears the control bar. */
video::cue { background: rgba(0,0,0,.72); color: #fff; font-size: .95em;
  text-shadow: 0 1px 2px rgba(0,0,0,.9); line-height: 1.35; }
