/* ═══════════════════════════════════════════════════
   video-player.css — Shared video player styles
   Used by: chat, admin panel
   Prefix: .vp-*
   ═══════════════════════════════════════════════════ */

/* ── Player container ─────────────────────────────── */
.vp-player {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  max-width: 300px;
  line-height: 0;
  outline: none;
}
.vp-player:focus-visible {
  box-shadow: 0 0 0 2px var(--accent, #e50914);
}

/* ── Video element ────────────────────────────────── */
.vp-video {
  width: 100%;
  max-height: 400px;
  display: block;
  object-fit: contain;
  background: #000;
}

/* ── Loading spinner ──────────────────────────────── */
.vp-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .4);
  z-index: 3;
}
.vp-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vpSpin .8s linear infinite;
}
@keyframes vpSpin {
  to { transform: rotate(360deg); }
}

/* ── Play overlay (big button — initial state) ────── */
.vp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .3);
  cursor: pointer;
  z-index: 2;
  transition: background .2s ease;
}
.vp-overlay:hover {
  background: rgba(0, 0, 0, .45);
}
.vp-play-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.vp-play-circle svg {
  margin-left: 3px; /* visual centering for triangle */
}
.vp-overlay:hover .vp-play-circle {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
}

/* ── Controls bar ─────────────────────────────────── */
.vp-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  z-index: 4;
  transition: opacity .3s ease;
}
.vp-controls.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Control buttons ──────────────────────────────── */
.vp-ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
  flex-shrink: 0;
}
.vp-ctrl-btn:hover {
  background: rgba(255, 255, 255, .15);
}

/* ── Progress bar ─────────────────────────────────── */
.vp-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, .25);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height .15s ease;
}
.vp-progress:hover {
  height: 6px;
}
.vp-progress-fill {
  height: 100%;
  background: var(--accent, #e50914);
  border-radius: 2px;
  width: 0%;
  transition: width .1s linear;
  pointer-events: none;
}

/* ── Time display ─────────────────────────────────── */
.vp-time {
  font-size: 10px;
  color: rgba(255, 255, 255, .85);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  min-width: 60px;
  text-align: center;
}

/* ── Speed button ─────────────────────────────────── */
.vp-speed-btn {
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: rgba(255, 255, 255, .7);
  min-width: 24px;
  text-align: center;
}
.vp-speed-btn:hover {
  color: #fff;
}

/* ── Compact mode (admin panels) ──────────────────── */
.vp-compact {
  max-width: 240px;
  border-radius: 8px;
}
.vp-compact .vp-video {
  max-height: 200px;
}
.vp-compact .vp-play-circle {
  width: 40px;
  height: 40px;
}
.vp-compact .vp-play-circle svg {
  width: 18px;
  height: 18px;
}
.vp-compact .vp-controls {
  padding: 5px 6px;
  gap: 4px;
}
.vp-compact .vp-time {
  font-size: 9px;
  min-width: 50px;
}

/* ── Fullscreen overrides ─────────────────────────── */
.vp-player:fullscreen,
.vp-player:-webkit-full-screen {
  max-width: none;
  border-radius: 0;
  background: #000;
}
.vp-player:fullscreen .vp-video,
.vp-player:-webkit-full-screen .vp-video {
  max-height: 100vh;
  width: 100%;
  height: 100%;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 520px) {
  .vp-player {
    max-width: 260px;
  }
  .vp-play-circle {
    width: 48px;
    height: 48px;
  }
  .vp-controls {
    padding: 6px 8px;
  }
}
