/* =====================================================================
   css/video-player.css — Competitor-Grade Video Player (v38)
   X / YouTube / TikTok cinema styling across Feed, Galleries & Lightbox
   ===================================================================== */

.vp-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 460px;
  background: #070b14;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vp-player.is-composer {
  aspect-ratio: 16 / 10;
  max-height: 280px;
}

.vp-player.is-lightbox {
  width: min(92vw, 960px);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(72dvh, 620px);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .65);
}

.vp-video,
.vp-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vp-player.is-lightbox .vp-video,
.vp-player.is-lightbox .vp-canvas {
  object-fit: contain;
  background: #050811;
}

.vp-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .52) 0%, transparent 28%),
    linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .25) 26%, transparent 52%);
  transition: opacity 220ms ease;
}

.vp-top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.vp-top-l,
.vp-top-r {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.vp-badge-hd,
.vp-badge-dur {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 9999px;
  background: rgba(8, 12, 22, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.vp-badge-hd {
  background: color-mix(in srgb, var(--primary, #6366f1) 82%, rgba(0, 0, 0, .4));
  border-color: rgba(255, 255, 255, .24);
}

.vp-top-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, .66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #ffffff;
  transition: background-color 140ms ease, transform 120ms ease;
}

.vp-top-btn:hover {
  background: rgba(8, 12, 22, .88);
  transform: scale(1.06);
}

.vp-top-btn:active {
  transform: scale(.92);
}

.vp-top-btn svg {
  width: 15px;
  height: 15px;
}

/* Center Play / Pause Cinema Orb */
.vp-center-orb {
  position: absolute;
  z-index: 5;
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 24, .68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, .32);
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1), opacity 200ms ease, background-color 150ms ease;
}

.vp-center-orb:hover {
  background: var(--primary, #6366f1);
  border-color: rgba(255, 255, 255, .5);
  transform: scale(1.07);
}

.vp-center-orb svg {
  width: 24px;
  height: 24px;
}

.vp-player.is-playing .vp-center-orb {
  opacity: 0;
  transform: scale(.86);
  pointer-events: none;
}

.vp-player.is-playing:hover .vp-center-orb {
  opacity: .92;
  transform: scale(1);
  pointer-events: auto;
}

/* Double-tap +/-10s feedback pill */
.vp-skip-fx {
  position: absolute;
  top: 50%;
  z-index: 8;
  transform: translateY(-50%) scale(.9);
  padding: 7px 14px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.vp-skip-fx.is-left { left: 16%; }
.vp-skip-fx.is-right { right: 16%; }
.vp-skip-fx.is-show {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Timed Captions (CC) Overlay */
.vp-captions {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 58px;
  z-index: 6;
  margin: 0 auto;
  width: fit-content;
  max-width: 90%;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(5, 8, 16, .78);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

/* Bottom Glassmorphic Cinema Controls */
.vp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  padding: 6px 12px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vp-scrub-wrap {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.vp-scrub-tip {
  position: absolute;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .86);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.vp-scrub-wrap:hover .vp-scrub-tip {
  opacity: 1;
}

.vp-scrub-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .26);
  transition: height 130ms ease;
}

.vp-scrub-wrap:hover .vp-scrub-track {
  height: 6px;
}

.vp-scrub-buf {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 68%;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .32);
}

.vp-scrub-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--primary, #6366f1), #ec4899);
}

.vp-scrub-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  transform: translate(-50%, -50%) scale(.85);
  transition: transform 130ms ease;
}

.vp-scrub-wrap:hover .vp-scrub-thumb {
  transform: translate(-50%, -50%) scale(1.15);
}

.vp-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vp-ctrl-l,
.vp-ctrl-r {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vp-ctrl-btn {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .92);
  transition: background-color 130ms ease, color 130ms ease, transform 110ms ease;
}

.vp-ctrl-btn:hover {
  background: rgba(255, 255, 255, .16);
  color: #ffffff;
}

.vp-ctrl-btn.is-on {
  color: #38bdf8;
  background: rgba(56, 189, 248, .18);
}

.vp-ctrl-btn svg {
  width: 16px;
  height: 16px;
}

.vp-ctrl-pill {
  height: 24px;
  padding: 0 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .14);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: background-color 130ms ease;
}

.vp-ctrl-pill:hover {
  background: rgba(255, 255, 255, .26);
}

.vp-time-txt {
  margin-left: 3px;
  color: rgba(255, 255, 255, .92);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Video tile badge inside multi-item Bento / Grid / Collage / Lightbox Thumbs */
.vp-tile-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 0, 0, .28), rgba(0, 0, 0, .06));
}

.vp-tile-orb {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: rgba(8, 12, 22, .72);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, .36);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
}

.vp-tile-orb svg {
  width: 19px;
  height: 19px;
  margin-left: 2px;
}

.vp-tile-dur {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(8, 12, 22, .78);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.lb-thumb-vbadge {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
  color: #ffffff;
  pointer-events: none;
}

.lb-thumb-vbadge svg {
  width: 15px;
  height: 15px;
}

/* Floating Mini Picture-in-Picture Corner Player */
.vp-pip-float {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 84;
  width: 248px;
  border-radius: 16px;
  overflow: hidden;
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  animation: ovPopAnchor 200ms cubic-bezier(.22, 1, .36, 1);
}

body.mobile-sim .vp-pip-float {
  position: absolute;
  right: 10px;
  bottom: 72px;
  width: 196px;
}

.vp-pip-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.vp-pip-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vp-pip-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .72), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vp-pip-title {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 0;
}

.vp-pip-btn {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vp-pip-btn svg {
  width: 12px;
  height: 12px;
}

.vp-pip-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, .25);
}

.vp-pip-bar span {
  display: block;
  height: 100%;
  background: var(--primary, #6366f1);
}

/* Composer video picker tiles */
.cmp-vid-tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #0b1020;
  text-align: left;
  cursor: pointer;
  transition: transform 130ms ease, border-color 140ms ease;
}

.cmp-vid-tile:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.cmp-vid-tile img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.cmp-vid-meta {
  padding: 6px 8px;
  background: var(--card);
}

.cmp-vid-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmp-vid-sub {
  font-size: 10.5px;
  color: var(--muted-foreground);
}

@media (max-width: 480px) {
  .vp-hide-xs {
    display: none;
  }
  .vp-center-orb {
    width: 50px;
    height: 50px;
  }
  .vp-captions {
    font-size: 11.5px;
    bottom: 54px;
  }
}
