/* =============================================================================
   SX | videos.css — página /videos (tutoriais no YouTube + controle de assistidos)
   -----------------------------------------------------------------------------
   Tudo escopado em .sx-videos. Segue a linguagem da home nova (index2.css):
   navy #12326b, laranja #dd6514, cartões brancos com raio 16px, peso máximo
   500 no corpo, nenhum translate em hover, alturas reservadas (zero shift).
   ========================================================================== */

.sx-videos {
  --vd-navy: #12326b;
  --vd-navy-dark: #0e1b3a;
  --vd-orange: #dd6514;
  --vd-ink: #1f2937;
  --vd-muted: #6b7280;
  --vd-line: #e6e9ef;
  --vd-card: #ffffff;
  --vd-green: #1f7a4d;
  --vd-green-soft: #e6f6ee;
  --vd-orange-soft: #fff3ea;
  --vd-shadow: 0 3px 14px rgba(14, 27, 58, .06);
  --vd-shadow-lg: 0 10px 30px rgba(14, 27, 58, .08);
  --vd-radius: 16px;

  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 16px 56px;
  box-sizing: border-box;
  color: var(--vd-ink);
  font-size: 15px;
  line-height: 1.55;
}

.sx-videos *,
.sx-videos *::before,
.sx-videos *::after { box-sizing: border-box; }

/* Peso máximo 500 no corpo da página (cabeçalho/rodapé do site ficam de fora). */
.sx-videos h1,
.sx-videos h2,
.sx-videos b,
.sx-videos strong,
.sx-videos button { font-weight: 500; }

/* -----------------------------------------------------------------------------
   1) Cabeçalho: texto + cartão "Seu progresso"
   -------------------------------------------------------------------------- */
.sx-videos__cab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px 28px;
  align-items: center;
  background: var(--vd-card);
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius);
  box-shadow: var(--vd-shadow);
  padding: 22px 24px;
}

.sx-videos__eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--vd-orange);
  margin-bottom: 6px;
}

.sx-videos__titulo {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--vd-navy-dark);
}

.sx-videos__sub {
  margin: 0;
  color: var(--vd-muted);
  max-width: 62ch;
}

.sx-videos__resumo {
  background: #f7f9fc;
  border: 1px solid var(--vd-line);
  border-radius: 12px;
  padding: 14px 16px 16px;
}

.sx-videos__resumo-topo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  white-space: nowrap;
}

.sx-videos__resumo-rotulo {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--vd-muted);
}

.sx-videos__resumo-num {
  font-size: 14px;
  color: var(--vd-navy-dark);
}

.sx-videos__resumo-num b { color: var(--vd-navy); }

.sx-videos__barra {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e3e8f0;
  overflow: hidden;
}

.sx-videos__barra > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--vd-orange), #f08a3c);
  transition: width .4s ease;
}

/* -----------------------------------------------------------------------------
   2) Aviso para o visitante deslogado
   -------------------------------------------------------------------------- */
.sx-videos__aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid #f3ddcb;
  background: var(--vd-orange-soft);
  color: #7a3f0c;
  border-radius: 12px;
  font-size: 14px;
}

.sx-videos__aviso svg { flex: 0 0 auto; margin-top: 2px; color: var(--vd-orange); }

.sx-videos__aviso a {
  color: var(--vd-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* -----------------------------------------------------------------------------
   3) Lista de vídeos — cada vídeo é um cartão: player à esquerda, ficha à direita
   -------------------------------------------------------------------------- */
.sx-videos__lista {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.sx-video {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
  background: var(--vd-card);
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius);
  box-shadow: var(--vd-shadow);
  padding: 18px;
  scroll-margin-top: 90px;
  transition: box-shadow .16s ease, border-color .16s ease;
}

.sx-video:hover {
  border-color: #d9dfe9;
  box-shadow: var(--vd-shadow-lg);
}

/* Player 16:9 com altura reservada — o iframe entra no lugar do poster sem
   deslocar nada (o YT.Player substitui o .sx-video__frame pelo <iframe>). */
.sx-video__player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--vd-navy-dark);
  border-radius: 12px;
  overflow: hidden;
}

.sx-video__player > iframe,
.sx-video__player > .sx-video__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.sx-video__poster {
  position: absolute;
  inset: 0;
  display: block;
  color: #fff;
}

.sx-video__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: .92;
}

.sx-video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* posicionamento, não hover */
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(221, 101, 20, .92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: background .16s ease;
}

.sx-video__play svg { margin-left: 3px; }

.sx-video__poster:hover .sx-video__play { background: var(--vd-orange); }

/* Ficha do vídeo */
.sx-video__info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sx-video__topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}

.sx-video__serie {
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--vd-orange);
  white-space: nowrap;
}

.sx-video__status {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12.5px;
  white-space: nowrap;
  background: #eef1f6;
  color: var(--vd-muted);
  transition: background .16s ease, color .16s ease;
}

.sx-video.is-andamento .sx-video__status {
  background: var(--vd-orange-soft);
  color: #b5500f;
}

.sx-video.is-concluido .sx-video__status {
  background: var(--vd-green-soft);
  color: var(--vd-green);
}

.sx-video__titulo {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  color: var(--vd-navy-dark);
  letter-spacing: -.01em;
}

.sx-video__desc {
  margin: 0;
  color: var(--vd-muted);
  font-size: 14.5px;
}

/* Barra de progresso do vídeo — sempre renderizada (0% quando não começou) */
.sx-video__progresso {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.sx-video__pbar {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: #e3e8f0;
  overflow: hidden;
}

.sx-video__pbar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--vd-orange);
  transition: width .3s ease, background .16s ease;
}

.sx-video.is-concluido .sx-video__pbar > span { background: var(--vd-green); }

.sx-video__ptxt {
  flex: 0 0 auto;
  min-width: 4ch;
  text-align: right;
  font-size: 12.5px;
  color: var(--vd-muted);
  font-variant-numeric: tabular-nums;
}

/* Ações */
.sx-video__acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 4px;
}

.sx-video__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 226px;   /* os dois textos cabem: nada se desloca ao alternar */
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #cfd6e2;
  background: #fff;
  color: var(--vd-navy);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.sx-video__btn:hover {
  background: #f4f7fc;
  border-color: #b9c6dc;
}

.sx-video__btn:focus-visible {
  outline: 2px solid var(--vd-orange);
  outline-offset: 2px;
}

.sx-video__btn[disabled] {
  opacity: .6;
  cursor: progress;
}

.sx-video__btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #b9c6dc;
  color: transparent;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.sx-video.is-concluido .sx-video__btn {
  background: var(--vd-green-soft);
  border-color: #bfe5cf;
  color: var(--vd-green);
}

.sx-video.is-concluido .sx-video__btn:hover {
  background: #d9f0e3;
  border-color: #a9dbbf;
}

.sx-video.is-concluido .sx-video__btn-ico {
  background: var(--vd-green);
  border-color: var(--vd-green);
  color: #fff;
}

.sx-video__yt {
  color: var(--vd-muted);
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.sx-video__yt:hover { color: var(--vd-navy); }

/* Feedback discreto de "salvando/salvo" ao lado do status */
.sx-video__status.is-salvando { opacity: .7; }

/* -----------------------------------------------------------------------------
   4) Convite de login (componente global .sx-login-cta): sem "pulinho" no hover
   -------------------------------------------------------------------------- */
.sx-videos .sx-login-cta { margin: 22px 0 0; max-width: none; }
.sx-videos .sx-login-cta__btn--primary:hover,
.sx-videos .sx-login-cta__btn--primary:active { transform: none; }

/* -----------------------------------------------------------------------------
   5) Responsivo
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .sx-videos__cab {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .sx-video {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .sx-videos { padding: 14px 12px 40px; font-size: 14.5px; }
  .sx-videos__titulo { font-size: 22px; }
  .sx-video__titulo { font-size: 17px; }

  .sx-video__acoes { flex-direction: column; align-items: stretch; }
  .sx-video__btn { min-width: 0; width: 100%; }
  .sx-video__yt { text-align: center; }
}
