/* ─── Custom video player (.pv-player) ──────────────────────────────────────── */

.pv-player {
  position: relative;
  background: #000;
  overflow: hidden;
  width: 100%;
}

.pv-player-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ─── Buffering spinner ─────────────────────────────────────────────────────── */
.pv-player-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.pv-player.is-buffering .pv-player-spinner { opacity: 1; }

.pv-player-spinner::after {
  content: '';
  width: 36px; height: 36px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.75);
  border-radius: 50%;
  animation: pv-spin 0.75s linear infinite;
}
@keyframes pv-spin { to { transform: rotate(360deg); } }

/* ─── Controls bar ──────────────────────────────────────────────────────────── */
.pv-player-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  user-select: none;
}

.pv-player:hover .pv-player-controls,
.pv-player:focus-within .pv-player-controls,
.pv-player.is-paused .pv-player-controls {
  opacity: 1;
}

/* ─── Icon buttons ──────────────────────────────────────────────────────────── */
.pv-player-controls button {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  line-height: 0;
}
.pv-player-controls button:hover { color: #fff; }
.pv-player-controls button svg { width: 16px; height: 16px; fill: currentColor; }

/* ─── Progress track ────────────────────────────────────────────────────────── */
.pv-player-progress {
  flex: 1;
  position: relative;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
}

.pv-player-buf,
.pv-player-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 2px;
  pointer-events: none;
  width: 0%;
  transition: width 0.1s linear;
}
.pv-player-buf  { background: rgba(255,255,255,0.35); }
.pv-player-fill { background: rgba(255,255,255,0.9); }

/* Seek range — sits on top, transparent track */
.pv-player-seek {
  position: absolute;
  inset: -6px 0;
  height: calc(100% + 12px);
  width: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
/* Expand hit area when hovering the progress bar */
.pv-player-progress:hover { height: 5px; }
.pv-player-progress:hover .pv-player-seek { inset: -8px 0; }

/* ─── Time display ──────────────────────────────────────────────────────────── */
.pv-player-time {
  flex-shrink: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  min-width: 54px;
  text-align: center;
}

/* ─── Volume wrap ───────────────────────────────────────────────────────────── */
.pv-player-vol-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pv-player-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 52px;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.pv-player-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  cursor: pointer;
}
.pv-player-vol::-moz-range-thumb {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  border: none;
}

/* ─── Fullscreen overrides ──────────────────────────────────────────────────── */
.pv-player:fullscreen       { background: #000; }
.pv-player:fullscreen .pv-player-video { object-fit: contain; height: 100vh; }
