/* Shared chrome for the Cerne Play+ example (login, profiles, home, title, watch, browse). */

body {
  background-color: #0b0b0f;
  color: #fff;
}

[data-theme="light"] body,
:root:not([data-theme="dark"]) body {
  background-color: #0b0b0f;
  color: #fff;
}

/* The whole example is deliberately dark-only (Netflix-style), so overlays
   spawned by shared components (consent banner, modal) need to stay dark
   too instead of following a light data-theme set on an earlier page. */
[data-theme="light"] .consent-banner,
:root:not([data-theme="dark"]) .consent-banner,
[data-theme="light"] .modal-dialog,
:root:not([data-theme="dark"]) .modal-dialog,
[data-theme="light"] .dropdown-menu,
:root:not([data-theme="dark"]) .dropdown-menu {
  background-color: #16161d;
  color: #fff;
  border-color: rgb(255 255 255 / 12%);
}

[data-theme="light"] .dropdown-item:hover,
:root:not([data-theme="dark"]) .dropdown-item:hover {
  background-color: rgb(255 255 255 / 8%);
}

[data-theme="light"] .dropdown-header,
:root:not([data-theme="dark"]) .dropdown-header {
  color: rgb(255 255 255 / 55%);
}

[data-theme="light"] .consent-category-desc,
:root:not([data-theme="dark"]) .consent-category-desc {
  color: rgb(255 255 255 / 65%);
}

[data-theme="light"] .form-range::-webkit-slider-runnable-track,
:root:not([data-theme="dark"]) .form-range::-webkit-slider-runnable-track,
[data-theme="light"] .form-range::-moz-range-track,
:root:not([data-theme="dark"]) .form-range::-moz-range-track {
  background-color: rgb(255 255 255 / 25%);
}

[data-theme="light"] .form-range::-webkit-slider-thumb,
:root:not([data-theme="dark"]) .form-range::-webkit-slider-thumb,
[data-theme="light"] .form-range::-moz-range-thumb,
:root:not([data-theme="dark"]) .form-range::-moz-range-thumb {
  border-color: #0b0b0f;
}

.stream-nav {
  display: flex;
  align-items: center;
  gap: var(--cerne-space-6);
  padding: var(--cerne-space-4) var(--cerne-space-8);
  position: sticky;
  top: 0;
  z-index: var(--cerne-z-sticky);
  background: linear-gradient(to bottom, rgb(0 0 0 / 85%), rgb(0 0 0 / 40%));
  backdrop-filter: blur(6px);
}

.stream-brand {
  font-weight: var(--cerne-font-weight-bold);
  font-size: var(--cerne-font-size-xl);
  color: var(--cerne-color-danger);
  margin-inline-end: var(--cerne-space-4);
}

.stream-nav a {
  color: rgb(255 255 255 / 80%);
  font-size: var(--cerne-font-size-sm);
}

.stream-nav a:hover,
.stream-nav a.is-active {
  color: #fff;
  font-weight: var(--cerne-font-weight-medium);
}

.hero {
  position: relative;
  height: 34rem;
  display: flex;
  align-items: flex-end;
  padding: var(--cerne-space-10) var(--cerne-space-8);
  background:
    linear-gradient(to top, #0b0b0f 5%, transparent 55%),
    linear-gradient(to right, rgb(0 0 0 / 70%), transparent 65%),
    url(../assets/video/yt-como-construimos-o-cerne.jpg);
  background-size: cover;
  background-position: center;
  margin-top: -4.5rem;
}

.hero-content {
  max-width: 34rem;
}

.shelf-section {
  padding-inline: var(--cerne-space-8);
  margin-bottom: var(--cerne-space-8);
}

.shelf-title {
  font-size: var(--cerne-font-size-lg);
  font-weight: var(--cerne-font-weight-semibold);
  margin-bottom: var(--cerne-space-3);
}

.poster {
  display: block;
  position: relative;
  width: 15rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--cerne-radius-md);
  overflow: hidden;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--cerne-space-2);
  background: rgb(0 0 0 / 50%);
  opacity: 0;
  transition: opacity var(--cerne-duration-fast) var(--cerne-ease-standard);
}

.poster:hover .poster-overlay,
.poster:focus-within .poster-overlay {
  opacity: 1;
}

.poster-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
}

.poster-btn.is-outline {
  background: rgb(255 255 255 / 15%);
  color: #fff;
  border: 1px solid rgb(255 255 255 / 60%);
}

.poster-progress {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 3px;
  background: rgb(255 255 255 / 25%);
}

.poster-progress-bar {
  height: 100%;
  background: var(--cerne-color-danger);
}

.poster-title {
  display: block;
  margin-top: var(--cerne-space-2);
  font-size: var(--cerne-font-size-sm);
  color: rgb(255 255 255 / 75%);
}

a.poster-title:hover {
  color: #fff;
}

.stream-chip {
  padding: 0.3em 0.9em;
  border-radius: var(--cerne-radius-full);
  border: 1px solid rgb(255 255 255 / 25%);
  color: rgb(255 255 255 / 85%);
  font-size: var(--cerne-font-size-sm);
  background: none;
}

.stream-chip.is-selected {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.shelf .shelf-nav-icon {
  background: rgb(20 20 20 / 90%);
  color: #fff;
  box-shadow: none;
}

/* Login */
.stream-login-bg {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--cerne-space-6);
  background:
    linear-gradient(rgb(0 0 0 / 55%), rgb(0 0 0 / 80%)),
    linear-gradient(135deg, #3a2b6e, #1c2b52 55%, #0b0b0f);
}

.stream-login-card {
  width: 100%;
  max-width: 26rem;
  background: rgb(0 0 0 / 75%);
  border-radius: var(--cerne-radius-lg);
  padding: var(--cerne-space-8);
}

.stream-login-card .form-control {
  background-color: rgb(255 255 255 / 8%);
  border-color: rgb(255 255 255 / 20%);
  color: #fff;
}

.stream-login-card .form-label {
  color: rgb(255 255 255 / 85%);
}

/* Profiles */
.profile-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--cerne-space-6);
}

.profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--cerne-space-3);
  color: rgb(255 255 255 / 75%);
  width: 9rem;
}

.profile-tile-avatar {
  width: 8rem;
  height: 8rem;
  border-radius: var(--cerne-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--cerne-font-size-2xl);
  font-weight: var(--cerne-font-weight-bold);
  color: #fff;
  border: 3px solid transparent;
}

.profile-tile:hover .profile-tile-avatar,
.profile-tile:focus-visible .profile-tile-avatar {
  border-color: #fff;
}

.profile-tile:hover,
.profile-tile:focus-visible {
  color: #fff;
}

.profile-tile-avatar.is-add {
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 25%);
}

/* Title details */
.title-backdrop {
  position: relative;
  height: 26rem;
  display: flex;
  align-items: flex-end;
  padding: var(--cerne-space-8);
  background:
    linear-gradient(to top, #0b0b0f 10%, transparent 60%),
    linear-gradient(135deg, #234e52, #0b0b0f);
}

.episode-row {
  display: flex;
  align-items: center;
  gap: var(--cerne-space-4);
  padding-block: var(--cerne-space-4);
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.episode-thumb {
  position: relative;
  width: 10rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--cerne-radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.episode-thumb .poster-overlay {
  justify-content: center;
}

.episode-duration-badge {
  position: absolute;
  inset-block-end: 0.4rem;
  inset-inline-end: 0.4rem;
  padding: 0.05em 0.4em;
  background: rgb(0 0 0 / 80%);
  color: #fff;
  font-size: 0.68rem;
  border-radius: var(--cerne-radius-sm);
}

.episode-row-btn {
  width: 100%;
  background: none;
  border: none;
  border-inline-start: 3px solid transparent;
  padding-inline-start: var(--cerne-space-3);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.episode-row-btn:hover {
  background-color: rgb(255 255 255 / 5%);
}

.episode-row-btn.is-current {
  border-inline-start-color: var(--cerne-color-danger);
  background-color: rgb(255 255 255 / 6%);
}

/* Watch / player */
.stream-player-shell {
  position: relative;
  height: 100dvh;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* The YouTube IFrame API replaces #stream-yt-target with a real <iframe>
   that keeps the same id — `inset: 0` alone doesn't stretch a replaced
   element (iframe/img/video) the way it stretches a plain div, so the
   iframe otherwise sticks to its intrinsic 640x360 default. */
#stream-yt-target {
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

.stream-player-back {
  position: absolute;
  top: var(--cerne-space-4);
  inset-inline-start: var(--cerne-space-4);
  z-index: 2;
}

.stream-center-play {
  display: flex;
  z-index: 3;
}

.stream-player-shell.is-playing .stream-center-play {
  display: none;
}

.stream-next-panel {
  position: absolute;
  inset-block-end: 6.5rem;
  inset-inline-end: var(--cerne-space-6);
  z-index: 6;
  display: flex;
  gap: var(--cerne-space-3);
  width: 22rem;
  max-width: calc(100vw - 2 * var(--cerne-space-6));
  padding: var(--cerne-space-3);
  background-color: #16161d;
  border-radius: var(--cerne-radius-lg);
  box-shadow: 0 12px 28px rgb(0 0 0 / 55%);
}

.stream-next-panel[hidden] {
  display: none;
}

.stream-next-thumb {
  flex-shrink: 0;
  width: 6rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--cerne-radius-md);
}

.stream-next-label {
  font-size: var(--cerne-font-size-xs);
  color: rgb(255 255 255 / 60%);
  margin: 0 0 2px;
}

.stream-next-title {
  font-size: var(--cerne-font-size-sm);
  font-weight: var(--cerne-font-weight-medium);
  margin: 0 0 var(--cerne-space-2);
}

/* Live mode: no seek/duration, so the fill bar reads as a static "live"
   marker rather than progress — a solid, non-interactive red line. */
.stream-player-shell.is-live .progress {
  cursor: default;
}

.stream-player-controls {
  position: relative;
  z-index: 1;
  padding: var(--cerne-space-3) var(--cerne-space-6) var(--cerne-space-6);
  background: linear-gradient(to top, rgb(0 0 0 / 80%), transparent);
}

.stream-player-controls-row {
  display: flex;
  align-items: center;
  gap: var(--cerne-space-3);
  color: #fff;
  margin-top: var(--cerne-space-2);
}

.stream-cc-btn {
  color: rgb(255 255 255 / 55%);
}

.stream-cc-btn.is-active {
  color: #fff;
}

/* Browse */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--cerne-space-4);
  padding-inline: var(--cerne-space-8);
}

.browse-grid .poster {
  width: 100%;
}
