/* custom.css — melhorias de UX do tutorial TechMedVida (carrega após tutorial.css) */

@keyframes tmvFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tmv-anim {
  animation: tmvFadeUp .38s ease both;
}

.tmv-anim-d1 { animation-delay: .06s; }
.tmv-anim-d2 { animation-delay: .12s; }
.tmv-anim-d3 { animation-delay: .18s; }

.tmv-card-hover {
  transition: transform .18s ease, box-shadow .18s ease;
}

.tmv-card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(2, 6, 23, .14);
}

.tmv-video-experience {
  min-width: 0;
  margin-top: 1rem;
}

.tmv-video-experience video {
  display: block;
  width: 100%;
  max-width: 100%;
}

.tmv-video-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: .75rem;
  border: 1px solid rgb(186 230 253);
  border-radius: .875rem;
  background: linear-gradient(135deg, rgb(240 249 255), rgb(236 254 255));
}

.dark .tmv-video-intro {
  border-color: rgb(14 116 144 / .5);
  background: linear-gradient(135deg, rgb(8 47 73 / .65), rgb(22 78 99 / .4));
}

.tmv-video-eyebrow,
.tmv-section-label {
  margin: 0 0 .4rem;
  color: #0369a1;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dark .tmv-video-eyebrow,
.dark .tmv-section-label { color: #7dd3fc; }

.tmv-learning-list {
  display: grid;
  gap: .25rem;
  margin: 0;
  padding-left: 1.1rem;
  color: #334155;
  font-size: .875rem;
}

.dark .tmv-learning-list { color: #cbd5e1; }

.tmv-duration {
  flex: 0 0 auto;
  padding: .35rem .6rem;
  border-radius: 999px;
  background: rgb(255 255 255 / .8);
  color: #475569;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.dark .tmv-duration { background: rgb(15 23 42 / .75); color: #cbd5e1; }

.tmv-player-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .75rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.dark .tmv-player-tools { border-color: #334155; }

.tmv-tool-button,
.tmv-speed-button,
.tmv-resume-button {
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: .65rem;
  background: #fff;
  color: #334155;
  font-size: .78rem;
  font-weight: 750;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.tmv-tool-button { min-width: 56px; padding: .45rem .65rem; }
.tmv-resume-button { padding: .45rem .75rem; border-color: #0284c7; color: #0369a1; }
.tmv-resume-button[hidden] { display: none; }

.dark .tmv-tool-button,
.dark .tmv-speed-button,
.dark .tmv-resume-button { border-color: #475569; background: #0f172a; color: #e2e8f0; }

.tmv-tool-button:hover,
.tmv-speed-button:hover,
.tmv-resume-button:hover { border-color: #0284c7; background: #f0f9ff; }

.dark .tmv-tool-button:hover,
.dark .tmv-speed-button:hover,
.dark .tmv-resume-button:hover { border-color: #38bdf8; background: #0c4a6e; }

.tmv-speed-controls { display: flex; align-items: center; gap: .3rem; }
.tmv-tool-label { margin: 0 .2rem; color: #64748b; font-size: .72rem; font-weight: 700; }
.dark .tmv-tool-label { color: #94a3b8; }
.tmv-speed-button { min-width: 43px; padding: .4rem .35rem; }
.tmv-speed-button[aria-pressed="true"] { border-color: #0284c7; background: #0284c7; color: #fff; }

.tmv-player-status {
  flex: 1 1 130px;
  color: #64748b;
  font-size: .75rem;
  text-align: right;
}

.dark .tmv-player-status { color: #94a3b8; }

.tmv-chapter-section { margin-top: 1rem; }
.tmv-chapter-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .5rem; }

.tmv-chapter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 48px;
  padding: .55rem .65rem;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
  background: #fff;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.dark .tmv-chapter { border-color: #475569; background: #0f172a; color: #e2e8f0; }
.tmv-chapter:hover { border-color: #38bdf8; background: #f0f9ff; }
.dark .tmv-chapter:hover { border-color: #38bdf8; background: #0c4a6e; }

.tmv-chapter[aria-pressed="true"] {
  border-color: #0284c7;
  background: #e0f2fe;
  color: #0c4a6e;
  box-shadow: inset 3px 0 #0284c7;
}

.dark .tmv-chapter[aria-pressed="true"] { background: #0c4a6e; color: #fff; }
.tmv-chapter-time { color: #0284c7; font-size: .72rem; font-variant-numeric: tabular-nums; font-weight: 800; }
.dark .tmv-chapter-time { color: #7dd3fc; }
.tmv-chapter-title { min-width: 0; font-size: .8rem; font-weight: 700; line-height: 1.25; }
.tmv-chapter-kind { padding: .2rem .4rem; border-radius: 999px; font-size: .61rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.tmv-kind-fluxo { background: #e0f2fe; color: #0369a1; }
.tmv-kind-atencao { background: #fef3c7; color: #92400e; }
.tmv-kind-resultado { background: #d1fae5; color: #065f46; }
.dark .tmv-kind-fluxo { background: #075985; color: #e0f2fe; }
.dark .tmv-kind-atencao { background: #78350f; color: #fef3c7; }
.dark .tmv-kind-resultado { background: #065f46; color: #d1fae5; }

.tmv-chapter:focus-visible,
.tmv-tool-button:focus-visible,
.tmv-speed-button:focus-visible,
.tmv-resume-button:focus-visible,
.tmv-transcript button:focus-visible,
.tmv-transcript summary:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}

.tmv-transcript {
  margin-top: .8rem;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  overflow: clip;
}

.dark .tmv-transcript { border-color: #334155; }
.tmv-transcript summary { padding: .75rem .9rem; color: #334155; cursor: pointer; font-size: .82rem; font-weight: 800; }
.dark .tmv-transcript summary { color: #e2e8f0; }
.tmv-transcript summary span { margin-left: .3rem; color: #64748b; font-size: .7rem; font-weight: 500; }
.tmv-transcript-loading { margin: 0; padding: 0 .9rem .75rem; color: #64748b; font-size: .75rem; }
.tmv-transcript-loading.is-ready { color: #047857; }
.tmv-transcript-loading.is-error { color: #b91c1c; }
.dark .tmv-transcript-loading { color: #94a3b8; }
.dark .tmv-transcript-loading.is-ready { color: #6ee7b7; }
.dark .tmv-transcript-loading.is-error { color: #fecaca; }
.tmv-transcript ol { display: grid; gap: .25rem; max-height: 280px; margin: 0; padding: 0 .6rem .6rem; overflow-y: auto; list-style: none; }
.tmv-transcript ol:empty { display: none; }
.tmv-transcript button { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .5rem; width: 100%; min-height: 40px; padding: .6rem; border-radius: .55rem; color: #475569; text-align: left; }
.dark .tmv-transcript button { color: #cbd5e1; }
.tmv-transcript button:hover,
.tmv-transcript button.is-current { background: #f0f9ff; color: #075985; }
.dark .tmv-transcript button:hover,
.dark .tmv-transcript button.is-current { background: #0c4a6e; color: #fff; }
.tmv-transcript button span { color: #0284c7; font-size: .72rem; font-variant-numeric: tabular-nums; }
.tmv-transcript button strong { font-size: .8rem; font-weight: 550; line-height: 1.4; }
.tmv-transcript button.is-current strong { font-weight: 750; }
.tmv-transcript-fallback { margin-top: .75rem; color: #64748b; font-size: .78rem; }
.tmv-media-error { margin-top: .75rem; padding: .75rem; border-radius: .65rem; background: #fef2f2; color: #b91c1c; font-size: .82rem; font-weight: 700; }
.dark .tmv-media-error { background: rgb(127 29 29 / .35); color: #fecaca; }

@media (max-width: 639px) {
  .tutorial-step-navigation {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem;
  }
  .tutorial-step-complete {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: center;
    width: 100%;
  }
  .tutorial-step-nav-button {
    justify-content: center;
    min-width: 0;
    padding-inline: .5rem !important;
  }
  .tmv-video-intro { flex-direction: column; padding: .8rem; }
  .tmv-duration { align-self: flex-start; }
  .tmv-player-tools { align-items: stretch; }
  .tmv-speed-controls { order: 3; flex: 1 1 100%; justify-content: space-between; }
  .tmv-player-status { order: 4; flex-basis: 100%; text-align: left; }
  .tmv-chapter { grid-template-columns: auto minmax(0, 1fr); }
  .tmv-chapter-kind { grid-column: 2; justify-self: start; }
}

@media (max-width: 339px) {
  .tmv-speed-controls { display: grid; grid-template-columns: repeat(4, 1fr); }
  .tmv-tool-label { grid-column: 1 / -1; }
  .tmv-speed-button { min-width: 0; }
}

.tmv-progress-track {
  height: 8px;
  border-radius: 9999px;
  background: rgba(100, 116, 139, .25);
  overflow: hidden;
}

.tmv-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width .5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tmv-anim,
  .tmv-anim-d1,
  .tmv-anim-d2,
  .tmv-anim-d3 {
    animation: none;
  }

  .tmv-chapter,
  .tmv-tool-button,
  .tmv-speed-button,
  .tmv-resume-button,
  .tmv-progress-fill {
    transition: none;
  }
}
