/* ============================================================
   TV — detail page
   ============================================================ */

.detail-hero {
  position: relative;
  min-height: clamp(400px, 58vh, 590px);
  background-size: cover;
  background-position: center 18%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.detail-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, #0a0a0c 2%, rgba(10,10,12,0.62) 30%, rgba(10,10,12,0.12) 62%, rgba(10,10,12,0.24) 100%),
    linear-gradient(to right, rgba(10,10,12,0.62), rgba(10,10,12,0.12) 55%);
}
.detail-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 44px 34px;
}
.detail-channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(235,235,245,0.6);
  margin-bottom: 14px;
}
.detail-title {
  font-size: clamp(32px, 3.8vw, 50px);
  font-weight: 800;
  letter-spacing: -0.026em;
  line-height: 1.05;
  max-width: 22ch;
  margin-bottom: 14px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.detail-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.detail-resume-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.detail-resume-note .resume-bar {
  width: 148px; height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  overflow: hidden;
}
.detail-resume-note .resume-bar .bar { height: 100%; background: #fff; }

.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.detail-meta-row .genre-link { color: var(--text-secondary); }
.detail-meta-row .genre-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.detail-body { padding: 30px 44px 70px; display: flex; gap: 52px; }
.detail-main { flex: 1.62; min-width: 0; }
.detail-aside { flex: 1; min-width: 260px; max-width: 400px; }

.detail-section { margin-bottom: 38px; }
.detail-section > h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.014em;
  margin-bottom: 14px;
}
.detail-desc {
  font-size: 14.5px;
  line-height: 1.58;
  color: rgba(235,235,245,0.82);
  max-width: 68ch;
}

/* ---------------- Season selector ---------------- */
.season-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  position: relative;
}
.season-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  background: rgba(120,120,128,0.22);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 130ms;
}
.season-menu-btn:hover { background: rgba(120,120,128,0.36); }
.season-menu-btn svg { width: 11px; height: 11px; color: var(--text-secondary); }
.season-count { font-size: 12.5px; color: var(--text-tertiary); }

/* ---------------- Episode rows ---------------- */
.ep-list { display: flex; flex-direction: column; }
.ep-row {
  display: flex;
  gap: 16px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 130ms var(--ease-out);
  align-items: flex-start;
}
.ep-row:hover { background: rgba(255,255,255,0.055); }
.ep-row:active { background: rgba(255,255,255,0.08); }
.ep-row.is-watched { opacity: 0.55; }
.ep-row.is-watched:hover { opacity: 0.85; }

.ep-num {
  flex: none;
  width: 22px;
  padding-top: 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.ep-thumb {
  position: relative;
  flex: none;
  width: 158px;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #17171b;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  transition: box-shadow 160ms, transform 160ms var(--ease-out);
}
.ep-row:hover .ep-thumb { box-shadow: 0 6px 20px rgba(0,0,0,0.5); transform: scale(1.016); }
.ep-thumb .ep-play-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  opacity: 0;
  background: rgba(0,0,0,0.22);
  transition: opacity 160ms;
}
.ep-thumb .ep-play-hint svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 8px rgba(0,0,0,0.6)); }
.ep-row:hover .ep-play-hint { opacity: 1; }
.ep-thumb .ep-progress {
  position: absolute;
  left: 8px; right: 8px; bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.3);
}
.ep-thumb .ep-progress .bar { height: 100%; background: #fff; border-radius: 2px; }
.ep-thumb .ep-watched-check {
  position: absolute;
  right: 7px; top: 7px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: rgba(20,20,24,0.7);
  backdrop-filter: blur(4px);
  color: #30d158;
  display: flex; align-items: center; justify-content: center;
}
.ep-thumb .ep-watched-check svg { width: 11px; height: 11px; }
.ep-info { flex: 1; min-width: 0; padding-top: 1px; }
.ep-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 3px;
}
.ep-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.008em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-dur { margin-left: auto; flex: none; font-size: 12.5px; color: var(--text-tertiary); }
.ep-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-tertiary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------- Cast & crew ---------------- */
.cast-row { display: flex; gap: 22px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.cast-row::-webkit-scrollbar { display: none; }
.cast-item {
  flex: none;
  width: 96px;
  text-align: center;
  cursor: pointer;
}
.cast-item .cast-avatar {
  width: 76px; height: 76px;
  margin: 0 auto 9px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
  transition: transform 180ms var(--ease-out), box-shadow 180ms;
}
.cast-item:hover .cast-avatar { transform: scale(1.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3); }
.cast-item .cast-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
.cast-item .cast-role {
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crew-line { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.crew-line b { color: var(--text-primary); font-weight: 600; }

/* ---------------- Info / ratings panel ---------------- */
.info-panel {
  border-radius: 12px;
  background: rgba(120,120,128,0.12);
  padding: 18px 20px;
}
.info-panel h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 13px;
  padding: 5.5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-tertiary); flex: none; }
.info-row .v { text-align: right; color: rgba(235,235,245,0.85); }

.rating-panel { margin-top: 20px; overflow: hidden; border-radius: 12px; }
.rating-panel .rating-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(41, 151, 255, 0.16);
  font-size: 13.5px;
  font-weight: 700;
}
.rating-panel .rating-head .rating-badge { border-color: rgba(255,255,255,0.6); color: #fff; }
.rating-panel .rating-body {
  padding: 12px 16px 14px;
  background: rgba(120,120,128,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.rating-desc-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  border-radius: 12px;
  background: rgba(255,255,255,0.09);
  font-size: 12px;
  font-weight: 500;
  color: rgba(235,235,245,0.85);
}

/* ---------------- Related rail inside detail ---------------- */
.detail-rails { padding: 0 44px 70px; }

/* Season popover (reuses ctx-menu look) */
.season-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 150px;
  max-height: 264px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 10px;
  background: rgba(46,46,52,0.9);
  backdrop-filter: blur(30px) saturate(170%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), inset 0 0 0 0.5px rgba(255,255,255,0.12);
  animation: menu-in 130ms var(--ease-out);
}
.season-pop .sp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.season-pop .sp-item:hover { background: var(--accent); color: #fff; }
.season-pop .sp-item .sp-check { width: 13px; height: 13px; color: var(--accent); }
.season-pop .sp-item:hover .sp-check { color: #fff; }
