/* ── Tutorial player ────────────────────────────────────────
   views/tutorial-player.js: a real <video> inside the movie player's modal
   (landing-movie.css supplies the overlay, frame, controls and caption
   look). This file adds what a video needs: the picture filling the stage,
   a scrubbable timeline with a buffered bar and knob, the title strip, and
   the card offered at the end. The progress colour is the brand blue. */

.tp-stage { background: #000; }
.tp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* Paused: dim the picture only, so the end card stays crisp. */
.tp-frame.is-paused .tp-stage { opacity: 1; }
.tp-frame.is-paused .tp-video { opacity: 0.62; transition: opacity 0.2s var(--ease); }
.tp-frame:has(.tp-end:not([hidden])) .mv-veil { display: none; }

.tp-title {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  padding: 14px 56px 30px 18px;
  background: linear-gradient(rgba(0, 0, 0, 0.62), transparent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
/* Only while paused: playing, the video's own step chip owns that corner. */
.tp-frame.is-paused .tp-title { opacity: 1; }
.tp-frame:has(.tp-end:not([hidden])) .tp-title { opacity: 0; }

/* A thicker hit area around the 4px bar; it grows a little on hover. */
.tp-timeline {
  position: relative;
  overflow: visible;
  height: 4px;
  margin: 8px 0 2px;
  cursor: pointer;
  touch-action: none;
  transition: height 0.15s var(--ease);
}
.tp-timeline::before { content: ""; position: absolute; inset: -9px 0; }
.tp-timeline:hover, .tp-frame.is-scrubbing .tp-timeline { height: 6px; }
.tp-timeline .mv-timeline-fill { position: absolute; left: 0; top: 0; background: #4361ee; }
.tp-buffered { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: inherit; background: rgba(255, 255, 255, 0.32); }
.tp-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transform: scale(0);
  transition: transform 0.15s var(--ease);
}
.tp-timeline:hover .tp-knob, .tp-timeline:focus-visible .tp-knob, .tp-frame.is-scrubbing .tp-knob { transform: scale(1); }
.tp-timeline:focus-visible { outline: 2px solid #8ea2ff; outline-offset: 4px; }
.tp-frame.is-scrubbing .mv-controls { opacity: 1; pointer-events: auto; }

.tp-cc[aria-pressed="false"] .mv-cc { opacity: 0.55; }
.tp-cc[aria-pressed="true"] .mv-cc { background: #fff; color: #000; border-color: #fff; }
.tp-caption { bottom: 74px; }

/* End of a video: watch again, or go straight to the next one. */
.tp-end {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(5, 6, 7, 0.93);
  color: #fff;
  text-align: center;
  cursor: default;
}
.tp-end[hidden] { display: none; }
.tp-end-kicker { font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #8ea2ff; }
.tp-end-title { font-family: var(--font-geist); font-size: clamp(20px, 3vw, 30px); font-weight: 600; letter-spacing: -0.03em; max-width: 640px; }
.tp-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.tp-end-btn { gap: 8px; }
.tp-end-btn svg { width: 15px; height: 15px; }
.tp-end .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); }
.tp-end .btn--primary { background: #4361ee; color: #fff; border-color: #4361ee; }

@media (max-width: 640px) {
  /* The movie stage stands tall on phones; a video keeps its 16:9. */
  .tp-stage { aspect-ratio: 16 / 9; height: auto; }
  .tp-title { font-size: 13px; padding: 10px 48px 22px 12px; }
  .tp-caption { bottom: 52px; font-size: 12.5px; }
  .tp-end { gap: 6px; padding: 12px; }
  .tp-end-kicker { font-size: 11px; }
  .tp-end-actions { margin-top: 4px; }
}
