/* ============================================================================
   Player video propriu — inlocuieste iframe-ul YouTube de pe tutoriale.html.
   Fara biblioteci externe. Se incarca doar pe paginile care au nevoie de el.
   Traieste pe fundal negru (in modal), deci paleta e alb pe intuneric, cu
   tomato doar pentru progres.
   ========================================================================== */

.vp {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  font-family: inherit;
  --vp-accent: #D94A2B;
}
.vp video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* ---- butonul mare de start, cat timp e pe pauza ---- */
.vp-big {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 76px; height: 76px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #1A1814;
  cursor: pointer;
  transition: transform 200ms, background 200ms, opacity 180ms;
}
.vp-big svg { width: 28px; height: 28px; margin-left: 4px; }
.vp-big:hover { background: #fff; transform: scale(1.07); }
.vp.is-playing .vp-big { opacity: 0; pointer-events: none; transform: scale(0.8); }

/* ---- rotita de asteptare ---- */
.vp-spin {
  position: absolute;
  inset: 0; margin: auto;
  width: 42px; height: 42px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vpSpin 720ms linear infinite;
  pointer-events: none;
}
@keyframes vpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vp-spin { animation-duration: 2s; } }

/* ---- mesaj de eroare: daca fisierul nu se incarca, se spune, nu se tace ---- */
.vp-eroare {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: rgba(0,0,0,0.86);
  font-size: 14.5px;
  line-height: 1.6;
}
.vp-eroare a { color: #fff; text-decoration: underline; }

/* ---- bara de comenzi ---- */
.vp-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 14px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 55%, transparent 100%);
  opacity: 1;
  transition: opacity 260ms;
}
/* Se ascunde doar cat timp ruleaza si mouse-ul sta pe loc. Pe pauza, la hover
   sau cand focusul e pe un buton, ramane vizibila — altfel nu se poate naviga
   de la tastatura. */
.vp.is-playing.is-idle .vp-bar { opacity: 0; pointer-events: none; }
.vp.is-playing.is-idle { cursor: none; }
.vp-bar:focus-within { opacity: 1 !important; pointer-events: auto !important; }

/* ---- bara de progres ---- */
.vp-scrub {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.vp-scrub::before {
  content: '';
  position: absolute; left: 0; right: 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  transition: height 140ms;
}
.vp-incarcat, .vp-redat {
  position: absolute; left: 0;
  height: 4px;
  border-radius: 999px;
  transition: height 140ms;
  pointer-events: none;
}
.vp-incarcat { background: rgba(255,255,255,0.32); }
.vp-redat    { background: var(--vp-accent); }
.vp-buton-scrub {
  position: absolute;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%) scale(0);
  transition: transform 140ms;
  pointer-events: none;
}
.vp-scrub:hover::before,
.vp-scrub:hover .vp-incarcat,
.vp-scrub:hover .vp-redat,
.vp-scrub:focus-visible::before,
.vp-scrub:focus-visible .vp-incarcat,
.vp-scrub:focus-visible .vp-redat { height: 6px; }
.vp-scrub:hover .vp-buton-scrub,
.vp-scrub:focus-visible .vp-buton-scrub,
.vp-scrub.trage .vp-buton-scrub { transform: translateX(-50%) scale(1); }
.vp-scrub:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 4px; }

/* ---- randul de butoane ---- */
.vp-rand {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.vp-rand button {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 160ms;
}
.vp-rand button:hover { background: rgba(255,255,255,0.16); }
.vp-rand button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.vp-rand button svg { width: 19px; height: 19px; }
.vp-rand button[hidden] { display: none; }

.vp-timp {
  font-size: 13px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  padding: 0 8px;
  white-space: nowrap;
}
.vp-gol { flex: 1; }

.vp-viteza {
  width: auto !important;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- volum: cursorul se desfasoara la hover, ca sa nu ocupe loc mereu ---- */
.vp-volum { display: flex; align-items: center; }
.vp-volum input {
  width: 0;
  opacity: 0;
  margin: 0;
  accent-color: #fff;
  cursor: pointer;
  transition: width 200ms, opacity 200ms, margin 200ms;
}
.vp-volum:hover input,
.vp-volum:focus-within input { width: 72px; opacity: 1; margin: 0 8px 0 2px; }

@media (max-width: 560px) {
  .vp-volum { display: none; }        /* pe telefon volumul e al aparatului */
  .vp-timp { font-size: 12px; padding: 0 4px; }
  .vp-rand button { width: 32px; height: 32px; }
}

/* ---- clip fara durata declarata: bara nu poate spune adevarul, o retragem ---- */
.vp.fara-durata .vp-scrub { pointer-events: none; opacity: 0.45; }
.vp.fara-durata .vp-buton-scrub { display: none; }
