/* ============================================================
   CUSTOM VIDEO PLAYER
   ============================================================ */
.custom-video-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  outline: 1px solid var(--t-faint);
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
}
.custom-video-container video {
  width: 100%;
  display: block;
}
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  display: flex;
  align-items: center;
  padding: var(--space-4);
  gap: var(--space-4);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.custom-video-container:hover .video-controls,
.custom-video-container:focus-within .video-controls,
.custom-video-container.is-paused .video-controls {
  opacity: 1;
}
.video-controls button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity var(--t-fast);
}
.video-controls button:hover {
  opacity: 1;
}
.video-controls button svg {
  width: 24px;
  height: 24px;
}
.v-progress-bar {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  touch-action: none;          /* consente lo scrub orizzontale senza scrollare la pagina */
}
/* area di tocco estesa in verticale: più facile da agganciare col dito */
.v-progress-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -11px;
  bottom: -11px;
}
.v-progress-filled {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  position: relative;
  pointer-events: none;
}
/* pallino (handle) all'estremità della parte riempita */
.v-progress-filled::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px rgba(179, 120, 212, 0.85);
  transform: translateY(-50%) scale(0);
  transition: transform var(--t-fast) var(--ease);
}
.custom-video-container:hover .v-progress-filled::after,
.v-progress-bar.is-scrubbing .v-progress-filled::after {
  transform: translateY(-50%) scale(1);
}
.v-time {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  color: #fff;
  user-select: none;
  white-space: nowrap;
}

/* ---- Miniatura di anteprima sulla progress bar (hover desktop / tocco mobile) ---- */
.v-thumb {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  width: 120px;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 6;
  transition: opacity var(--t-fast) var(--ease);
}
.v-thumb.is-visible {
  opacity: 1;
  visibility: visible;
}
.v-thumb video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
  border: 1px solid rgba(179, 120, 212, 0.55);   /* mini contorno viola */
  box-shadow: 0 12px 34px -10px rgba(0, 0, 0, 0.85);
}
.v-thumb-time {
  display: block;
  margin-top: 6px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.04em;
}

/* ---- Player su schermi piccoli ---- */
@media (max-width: 600px) {
  .video-controls {
    padding: var(--space-2);
    gap: var(--space-2);
  }
  .video-controls button svg { width: 22px; height: 22px; }
  .v-time { font-size: 0.7rem; }
  .v-thumb { width: 96px; }
}
@media (max-width: 380px) {
  .video-controls { gap: var(--space-1); }
  .v-time { font-size: 0.62rem; letter-spacing: 0; }
}
