/* Cineby-inspired watch pages (tv.html, movie.html) */
.watch-body {
  background: #05070a;
  color: #eef1f6;
}

.watch-body .navbar {
  background: rgba(5, 7, 10, 0.92);
  border-bottom: 1px solid #374151;
}

.watch-body .logo {
  font-family: Inter, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #eef1f6;
  letter-spacing: -0.02em;
}

.watch-body .logo::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: #dc2626;
  margin-right: 10px;
  vertical-align: -0.1em;
}

.btn-tertiary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 10px 20px;
  height: 44px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid #374151;
  color: #eef1f6;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-tertiary:hover {
  border-color: #dc2626;
  color: #fff;
}

/* Show hero */
.show-hero {
  position: relative;
  min-height: 52vh;
  margin-top: var(--nav-height);
  overflow: hidden;
}

.show-hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 28%;
}

.show-hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 10, 0.55) 0%, rgba(5, 7, 10, 0) 35%),
    linear-gradient(90deg, rgba(5, 7, 10, 0.85) 0%, rgba(5, 7, 10, 0.35) 45%, transparent 70%),
    linear-gradient(0deg, #05070a 0%, rgba(5, 7, 10, 0.6) 50%, transparent 100%);
  pointer-events: none;
}

.show-hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 48px 48px 80px;
}

.show-hero-content--movie {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  max-width: 900px;
}

.show-hero-poster {
  width: 180px;
  border-radius: 8px;
  border: 1px solid #374151;
  flex-shrink: 0;
}

.show-hero-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.show-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 13px;
  color: rgba(238, 241, 246, 0.85);
  margin-bottom: 16px;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(238, 241, 246, 0.35);
}

.show-hero-rating {
  color: #dc2626;
  font-weight: 500;
}

.show-hero-desc {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(238, 241, 246, 0.75);
  margin-bottom: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.show-hero-play {
  border-radius: 9999px !important;
  height: 44px;
  padding: 10px 28px !important;
  background: #eef1f6 !important;
  color: #05070a !important;
  font-weight: 600;
}

.show-hero-play:hover {
  background: #fff !important;
}

/* Episodes */
.episodes-block {
  padding: 48px;
  max-width: 1200px;
}

.section-heading {
  font-size: 23px;
  font-weight: 500;
  margin-bottom: 20px;
}

.episodes-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.season-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.season-chip {
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid #374151;
  background: #0b0f14;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.season-chip:hover,
.season-chip.active {
  border-color: #dc2626;
  color: #eef1f6;
}

.season-chip.active {
  background: rgba(220, 38, 38, 0.12);
}

.episode-search {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  height: 44px;
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1px solid #374151;
  background: #0b0f14;
  color: #eef1f6;
  font-size: 14px;
  outline: none;
}

.episode-search:focus {
  border-color: #dc2626;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40rem;
  overflow-y: auto;
  padding-right: 4px;
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #0b0f14;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}

.episode-card:hover {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(255, 255, 255, 0.03);
}

.episode-card--active {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.episode-card--last .episode-card-thumb {
  box-shadow: inset 0 0 0 2px #dc2626;
}

.episode-card-thumb {
  position: relative;
  width: 160px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.episode-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-card-num {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(5, 7, 10, 0.85);
  border-radius: 4px;
}

.episode-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #dc2626;
  color: #eef1f6;
}

.episode-card-title {
  font-size: 15px;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.episode-card-runtime {
  font-size: 12px;
  color: #6b7280;
}

/* Player overlay */
.player-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #05070a;
  flex-direction: column;
}

.player-overlay.active {
  display: flex;
}

body.player-open {
  overflow: hidden;
}

.player-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #0b0f14;
  border-bottom: 1px solid #374151;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.player-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid #374151;
  background: transparent;
  color: #eef1f6;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.player-back:hover {
  border-color: #dc2626;
}

.player-now {
  flex: 1;
  font-size: 14px;
  color: #9ca3af;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-actions {
  display: flex;
  gap: 8px;
}

.player-nav-btn {
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid #374151;
  background: #0b0f14;
  color: #eef1f6;
  font-size: 13px;
  cursor: pointer;
}

.player-nav-btn:hover:not(:disabled) {
  border-color: #dc2626;
}

.player-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.player-video {
  flex: 1;
  position: relative;
  min-height: 0;
}

.player-video .embed-source-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
}

.player-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-video:has(.embed-source-bar) iframe {
  top: 44px;
  height: calc(100% - 44px);
}

/* In-player episode drawer */
.player-episode-drawer {
  display: none;
  position: absolute;
  top: 56px;
  right: 0;
  width: min(360px, 100%);
  max-height: calc(100% - 56px);
  background: rgba(11, 15, 20, 0.98);
  border-left: 1px solid #374151;
  z-index: 10;
  flex-direction: column;
  overflow: hidden;
}

.player-episode-drawer.open {
  display: flex;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #374151;
  font-weight: 600;
}

.drawer-close {
  background: none;
  border: none;
  color: #eef1f6;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.drawer-seasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid #374151;
}

.drawer-episodes {
  overflow-y: auto;
  padding: 8px;
}

.drawer-ep-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
}

.drawer-ep-item:hover,
.drawer-ep-item.active {
  background: rgba(220, 38, 38, 0.1);
  color: #eef1f6;
}

.watch-loading,
.watch-error,
.watch-muted {
  padding: 24px;
  color: #6b7280;
}

.watch-error {
  color: #ef4444;
}

/* Continue watching row (homepage) */
.continue-watching-row .movie-card {
  position: relative;
}

.continue-watching-row .continue-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(5, 7, 10, 0.8);
}

.continue-watching-row .continue-progress-bar {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, #dc2626, #b91c1c);
}

.continue-watching-row a.movie-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.continue-watching-row .continue-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #dc2626;
  color: #eef1f6;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .show-hero-content,
  .episodes-block {
    padding: 24px 16px 48px;
  }

  .show-hero-content--movie {
    flex-direction: column;
  }

  .show-hero-poster {
    width: 140px;
  }

  .episode-card-thumb {
    width: 120px;
  }

  .player-now {
    display: none;
  }
}
