/* Inspiração: YouTube tema claro — legível, hierarquia clara, TV-friendly */

:root {
  --yt-bg: #f9f9f9;
  --yt-surface: #ffffff;
  --yt-raised: #f1f1f1;
  --yt-line: #e5e5e5;
  --yt-text: #0f0f0f;
  --yt-muted: #606060;
  --yt-soft: #717171;
  --yt-red: #ff0000;
  --yt-focus: #065fd4;
  --yt-card-hover: #f2f2f2;
  --yt-active-fill: rgba(6, 95, 212, 0.08);
  --yt-active-ring: rgba(6, 95, 212, 0.45);
  --yt-radius-lg: 12px;
  --yt-radius-sm: 8px;
  --yt-topbar-h: 56px;
  --yt-max: 1280px;
  --yt-sidebar-w: 402px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body.yt-app {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--yt-bg);
  color: var(--yt-text);
  line-height: 1.5;
}

/* ——— Top bar (estilo YouTube) ——— */

.yt-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--yt-topbar-h);
  background: var(--yt-surface);
  border-bottom: 1px solid var(--yt-line);
}

.yt-topbar__inner {
  max-width: var(--yt-max);
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.yt-brand__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
  background: var(--yt-red);
  border-radius: 4px;
}

.yt-brand__play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent #fff;
  margin-left: 2px;
}

.yt-topbar__titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  min-width: 0;
}

.yt-topbar__name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.yt-topbar__hint {
  font-size: 0.75rem;
  color: var(--yt-muted);
  margin-top: 2px;
}

/* ——— Alerta ——— */

.yt-alert {
  max-width: var(--yt-max);
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: var(--yt-radius-sm);
  background: #fff8e6;
  color: #5c4a00;
  border: 1px solid #f0d090;
  font-size: 0.9rem;
}

.yt-alert[hidden] {
  display: none !important;
}

/* ——— Conteúdo principal ——— */

.yt-main {
  max-width: var(--yt-max);
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.yt-columns {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}

@media (min-width: 1000px) {
  .yt-columns {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .yt-primary {
    flex: 1;
    min-width: 0;
  }

  .yt-sidebar {
    width: var(--yt-sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--yt-topbar-h) + 12px);
    max-height: calc(100vh - var(--yt-topbar-h) - 24px);
    overflow-y: auto;
    padding-right: 4px;
    padding-left: 20px;
    margin-left: 4px;
    border-left: 1px solid var(--yt-line);
  }
}

/* ——— Player ——— */

.yt-player-card {
  background: transparent;
}

.yt-player-frame {
  background: #000;
  border-radius: var(--yt-radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--yt-line);
}

.yt-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

.yt-ratio #player,
.yt-ratio #player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-ratio #player iframe {
  display: block;
}

/* ——— Título / meta (abaixo do player, estilo “watch”) ——— */

.yt-details {
  margin-top: 14px;
  padding: 0 2px;
}

.yt-details__title {
  margin: 0 0 12px;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--yt-text);
}

.yt-details__row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.yt-channel-chip__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d28d9, #db2777);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.yt-details__meta {
  flex: 1;
  min-width: 0;
}

.yt-details__channel {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--yt-text);
}

.yt-details__sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--yt-muted);
  line-height: 1.45;
}

.yt-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--yt-raised);
  border: 1px solid var(--yt-line);
  border-radius: var(--yt-radius-sm);
  font-size: 0.82rem;
  color: var(--yt-text);
  cursor: pointer;
  max-width: 100%;
}

.yt-option input {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--yt-focus);
}

.yt-option span {
  line-height: 1.35;
}

/* ——— Sidebar / lista relacionada ——— */

.yt-sidebar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--yt-line);
}

.yt-sidebar__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--yt-text);
}

.yt-sidebar__count {
  font-size: 0.75rem;
  color: var(--yt-soft);
  white-space: nowrap;
}

.yt-related {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Cartão estilo “vídeo sugerido” YouTube */

.card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px;
  margin: 0;
  border: none;
  border-radius: var(--yt-radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.card:hover,
.card:focus {
  background: var(--yt-card-hover);
  outline: none;
}

.card:focus-visible {
  box-shadow: 0 0 0 2px var(--yt-focus);
}

.card.is-active {
  background: var(--yt-active-fill);
  box-shadow: inset 0 0 0 1px var(--yt-active-ring);
}

.thumb {
  flex: 0 0 auto;
  width: 168px;
  max-width: 42vw;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #e8e8e8 center/cover no-repeat;
  background-color: #e8e8e8;
  overflow: hidden;
  position: relative;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.meta {
  flex: 1;
  min-width: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta .title {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--yt-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta .id {
  font-size: 0.72rem;
  color: var(--yt-soft);
  font-family: ui-monospace, monospace;
  word-break: break-all;
}

/* Mobile: miniaturas um pouco menores */
@media (max-width: 480px) {
  .thumb {
    width: 136px;
    max-width: 38vw;
  }

  .meta .title {
    font-size: 0.82rem;
  }
}

/* ——— Rodapé ——— */

.yt-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--yt-line);
  font-size: 0.75rem;
  color: var(--yt-soft);
}

.yt-footer code {
  font-size: 0.72rem;
  background: var(--yt-raised);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--yt-text);
  border: 1px solid var(--yt-line);
}
