/* ═══════════════════════════════════════════════════════════════
   Player dos vídeos de tutorial — /assets/js/tvplayer.js
   Mesmo visual no app, na Central de Ajuda e na página inicial.
   ═══════════════════════════════════════════════════════════════ */
.tvp {
  --tvp-azul: #044CFF;
  --tvp-fundo: #0C235F;
  position: relative; overflow: hidden; border-radius: 10px;
  background: var(--tvp-fundo); color: #fff; aspect-ratio: 16 / 9;
  font-family: inherit; line-height: 1.2; user-select: none; -webkit-user-select: none;
  outline: none; isolation: isolate;
}
.tvp:focus-visible { box-shadow: 0 0 0 3px rgba(4, 76, 255, .45); }
.tvp video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--tvp-fundo); }
.tvp.is-pronto video { cursor: pointer; }
.tvp:fullscreen { border-radius: 0; aspect-ratio: auto; }
.tvp:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }

/* Botão grande do começo */
.tvp__play {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  width: 76px; height: 76px; margin: -38px 0 0 -38px; border: 0; border-radius: 50%;
  background: var(--tvp-azul); color: #fff; cursor: pointer;
  display: grid; place-items: center; font-size: 34px;
  box-shadow: 0 10px 30px rgba(4, 76, 255, .45), 0 0 0 8px rgba(255, 255, 255, .18);
  transition: transform .18s ease, opacity .2s ease;
}
.tvp__play i { margin-left: 4px; }
.tvp__play:hover { transform: scale(1.06); }
.tvp.is-tocando .tvp__play, .tvp.is-iniciado .tvp__play { opacity: 0; pointer-events: none; transform: scale(.85); }
.tvp__dur {
  position: absolute; right: 12px; top: 12px; z-index: 3; padding: 4px 9px; border-radius: 6px;
  background: rgba(12, 35, 95, .78); font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.tvp.is-iniciado .tvp__dur { display: none; }

/* Aviso rápido no centro (velocidade, ±10s) */
.tvp__toast {
  position: absolute; left: 50%; top: 18%; z-index: 4; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; background: rgba(12, 35, 95, .86);
  font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.tvp__toast.on { opacity: 1; }

.tvp__load {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%;
  animation: tvpGira .8s linear infinite; display: none;
}
.tvp.is-carregando .tvp__load { display: block; }
@keyframes tvpGira { to { transform: rotate(360deg); } }

/* Barra de baixo */
.tvp__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 26px 12px 8px;
  background: linear-gradient(to top, rgba(6, 18, 52, .88), rgba(6, 18, 52, .55) 55%, transparent);
  transition: opacity .25s ease, transform .25s ease;
}
.tvp:not(.is-iniciado) .tvp__bar { opacity: 0; pointer-events: none; }
.tvp.is-oculto .tvp__bar { opacity: 0; transform: translateY(8px); pointer-events: none; }
.tvp.is-oculto { cursor: none; }

.tvp__linha { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.tvp__trilho { position: relative; flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); transition: height .12s ease; }
.tvp__linha:hover .tvp__trilho, .tvp.is-arrastando .tvp__trilho { height: 6px; }
.tvp__buf, .tvp__feito { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.tvp__buf { background: rgba(255, 255, 255, .35); }
.tvp__feito { background: var(--tvp-azul); }
.tvp__bola {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(4, 76, 255, .55); transform: scale(0); transition: transform .12s ease;
}
.tvp__linha:hover .tvp__bola, .tvp.is-arrastando .tvp__bola { transform: scale(1); }
/* Divisão dos capítulos: um corte no trilho */
.tvp__cap { position: absolute; top: -1px; bottom: -1px; width: 3px; margin-left: -1.5px; background: rgba(6, 18, 52, .9); }
.tvp__dica {
  position: absolute; bottom: 24px; transform: translateX(-50%); padding: 6px 9px; border-radius: 6px;
  background: #fff; color: #0C235F; font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
.tvp__dica b { display: block; color: #5B6B8C; font-weight: 600; font-size: 11px; margin-top: 1px; }
.tvp__linha:hover .tvp__dica, .tvp.is-arrastando .tvp__dica { opacity: 1; }

.tvp__ctl { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.tvp__b {
  height: 36px; min-width: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent;
  color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.tvp__b i { font-size: 18px; line-height: 1; }
.tvp__b:hover, .tvp__b[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
.tvp__b:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.tvp__tempo { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 6px; opacity: .92; }
.tvp__capatual { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; opacity: .8; padding: 0 4px; }
.tvp__capatual:empty { visibility: hidden; }
.tvp__vel { min-width: 46px; font-variant-numeric: tabular-nums; }

/* Curtir */
.tvp__curtir.is-on { color: #fff; background: var(--tvp-azul); }
.tvp__curtir.is-on:hover { background: #2E6BFF; }
.tvp__curtir.pulsa i { animation: tvpPulsa .45s ease; }
@keyframes tvpPulsa { 40% { transform: scale(1.35); } }

/* Menus (velocidade e capítulos) */
.tvp__menu {
  position: absolute; right: 12px; bottom: 64px; z-index: 6; min-width: 170px; max-height: calc(100% - 84px); overflow-y: auto;
  padding: 6px; border-radius: 10px; background: rgba(12, 35, 95, .96); box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.tvp__menu[hidden] { display: none; }
.tvp__menu h4 { margin: 4px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.tvp__op {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.tvp__op:hover { background: rgba(255, 255, 255, .12); }
.tvp__op.is-on { background: rgba(4, 76, 255, .55); }
.tvp__op small { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .7; }
.tvp__op .tvp__ok { margin-left: auto; font-size: 14px; visibility: hidden; }
.tvp__op.is-on .tvp__ok { visibility: visible; }
.tvp__menu--caps { min-width: 250px; }
/* Player pequeno (celular, coluna estreita): o menu cobre o vídeo inteiro
   em vez de flutuar cortado acima da barra. */
.tvp.is-pequeno .tvp__menu { inset: 0; max-height: none; min-width: 0; border-radius: 0; padding: 12px; background: rgba(12, 35, 95, .97); }
.tvp.is-pequeno .tvp__menu--vel:not([hidden]) { display: grid; grid-template-columns: repeat(3, 1fr); align-content: center; gap: 8px; }
.tvp.is-pequeno .tvp__menu--vel h4 { grid-column: 1 / -1; text-align: center; }
.tvp.is-pequeno .tvp__menu--vel .tvp__op { justify-content: center; padding: 12px 6px; border: 1px solid rgba(255, 255, 255, .18); font-weight: 600; }
.tvp.is-pequeno .tvp__menu--vel .tvp__ok { display: none; }

@media (max-width: 640px) {
  .tvp { border-radius: 8px; }
  .tvp__play { width: 62px; height: 62px; margin: -31px 0 0 -31px; font-size: 28px; }
  .tvp__bar { padding: 22px 6px 4px; }
  .tvp__b { min-width: 34px; height: 34px; padding: 0 6px; }
  .tvp__capatual, .tvp__vol { display: none; }
  .tvp__menu { right: 6px; bottom: 54px; }
}
@media (max-width: 420px) { .tvp__voltar { display: none; } }
@media (prefers-reduced-motion: reduce) { .tvp *, .tvp { transition: none !important; animation: none !important; } }
