/* ============================================
   ATG Play — Browse / Hero / Title detail
   ============================================ */

/* ── Hero ── */
.hero {
  position: relative; height: 82vh; min-height: 540px; max-height: 820px;
  display: flex; align-items: flex-end; color: #fff; margin-bottom: 10px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center top; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(11,11,15,.92) 0%, rgba(11,11,15,.55) 38%, transparent 70%),
    linear-gradient(0deg, var(--bg) 2%, transparent 45%);
}
.hero-inner { position: relative; z-index: 1; padding: 0 48px 84px; max-width: 720px; }
.hero h1 { font-size: clamp(34px, 5vw, 62px); font-weight: 900; line-height: 1.05; margin-bottom: 18px; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.hero-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; font-size: 14px; color: #d6d6dd; }
.hero-meta .badge { color: #fff; }
.hero p { font-size: 16.5px; color: #e2e2e8; margin-bottom: 26px; max-width: 580px; text-shadow: 0 1px 8px rgba(0,0,0,.7); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions .btn { padding: 13px 30px; font-size: 16px; }

/* row scroll arrows */
.row { position: relative; }
.row-arrow {
  position: absolute; top: 0; bottom: 18px; width: 48px; z-index: 6;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(11,11,15,.55); color: #fff; border: none; opacity: 0; transition: opacity .2s;
}
.row:hover .row-arrow { opacity: 1; }
.row-arrow.left { left: 0; } .row-arrow.right { right: 0; }
.row-arrow svg { width: 28px; height: 28px; }
.row-arrow:hover { background: rgba(11,11,15,.8); }

/* skeleton shimmer */
.skel { background: linear-gradient(90deg, #16161c 25%, #20202a 50%, #16161c 75%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── Hero entrance stagger animations ── */
.hero-inner h1,
.hero-inner .hero-meta,
.hero-inner p,
.hero-inner .hero-actions { opacity: 0; transform: translateY(28px); }

.hero.loaded .hero-inner h1         { animation: heroUp 0.65s 0.05s ease both; }
.hero.loaded .hero-inner .hero-meta { animation: heroUp 0.65s 0.20s ease both; }
.hero.loaded .hero-inner p          { animation: heroUp 0.65s 0.32s ease both; }
.hero.loaded .hero-inner .hero-actions { animation: heroUp 0.65s 0.44s ease both; }

@keyframes heroUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero parallax — scroll handler sets transform via JS */
.hero-bg { will-change: transform; }

/* ── Title detail page ── */
.detail-hero { position: relative; min-height: 70vh; display: flex; align-items: flex-end; color: #fff; }
.detail-hero .hero-bg::after {
  background:
    linear-gradient(90deg, rgba(11,11,15,.95) 0%, rgba(11,11,15,.4) 55%, transparent 90%),
    linear-gradient(0deg, var(--bg) 1%, transparent 50%);
}
.detail-inner { position: relative; z-index: 1; padding: 0 48px 60px; max-width: 760px; }
.detail-inner h1 { font-size: clamp(30px, 4vw, 52px); font-weight: 900; margin-bottom: 16px; }
.detail-hero-rich {
  min-height: 78vh;
  overflow: hidden;
}
.detail-hero-rich .hero-bg { filter: saturate(1.05); }
.detail-hero-rich .hero-bg::after {
  background:
    linear-gradient(90deg, rgba(5,5,8,.96) 0%, rgba(5,5,8,.78) 31%, rgba(5,5,8,.28) 62%, rgba(5,5,8,.68) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(11,11,15,.3) 36%, transparent 76%);
}
.detail-inner-rich { padding-bottom: 72px; max-width: 680px; }
.detail-kicker {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.detail-synopsis {
  max-width: 630px;
  margin: 0 0 20px;
  color: #e9e9ef;
  font-size: 15.5px;
  line-height: 1.7;
  text-shadow: 0 1px 10px rgba(0,0,0,.72);
}
.detail-resume-note {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 7px 11px;
  border-radius: 7px;
  background: rgba(229,9,20,.16);
  border: 1px solid rgba(229,9,20,.32);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.detail-actions { align-items: center; }
.detail-play { min-width: 116px; }
.detail-like svg { width: 20px; height: 20px; }
.detail-poster {
  position: absolute;
  right: 5vw;
  bottom: 8vh;
  z-index: 1;
  width: min(26vw, 390px);
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 28px 80px rgba(0,0,0,.62);
  transform: perspective(1100px) rotateY(-8deg);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-more {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 34px;
  padding: 34px 48px 6px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.detail-more h2 {
  margin-bottom: 10px;
  font-size: 22px;
}
.detail-copy p {
  max-width: 760px;
  color: var(--text2);
  line-height: 1.72;
}
.detail-facts {
  display: grid;
  gap: 12px;
  align-content: start;
}
.detail-facts div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  color: var(--text2);
  font-size: 14px;
}
.detail-facts span { color: var(--text3); }
.detail-facts strong { color: var(--text); font-weight: 700; }
.detail-genres { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.chip { font-size: 12.5px; padding: 4px 12px; border-radius: 100px; background: var(--surface2); color: var(--text2); }
.detail-action-pill {
  min-height: 48px;
  padding: 0 18px;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(28,28,36,.72);
  color: var(--text1);
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}
.detail-action-pill:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.62);
  transform: translateY(-1px);
}
.detail-action-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-action-icon svg { width: 20px; height: 20px; }

.episodes { padding: 36px 48px 0; }
.detail-episodes { padding-top: 34px; }
.episodes-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.episodes-header h2 { font-size: 22px; margin: 0; }
.season-dropdown { position: relative; }
.season-dropdown-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text1); font-size: 14px; font-family: inherit;
  padding: 8px 14px; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.season-dropdown-btn:hover { border-color: var(--text3); background: var(--surface); }
.season-chevron { width: 14px; height: 14px; flex-shrink: 0; color: var(--text3); transition: transform 0.2s ease; }
.season-dropdown-btn[aria-expanded="true"] .season-chevron { transform: rotate(180deg); }
.season-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: #1c1c26; border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; min-width: 140px; list-style: none; margin: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(-6px) scale(0.97); pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.season-dropdown-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.season-option {
  padding: 10px 16px; border-radius: 7px; cursor: pointer; font-size: 14px;
  color: var(--text2); transition: background 0.12s, color 0.12s;
}
.season-option:hover { background: var(--surface); color: var(--text1); }
.season-option.active { color: var(--text1); font-weight: 600; background: var(--surface); }
.ep {
  display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: 10px;
  border: 1px solid var(--border); margin-bottom: 10px; cursor: pointer; transition: var(--transition);
  background: rgba(255,255,255,.018);
}
.ep:hover { background: var(--surface); }
.ep.active {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.22);
}
.ep-num { font-size: 22px; font-weight: 800; color: var(--text3); width: 36px; text-align: center; flex-shrink: 0; }
.ep-thumb { position: relative; width: 150px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--surface2); }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.24); }
.ep-progress > div { height: 100%; background: var(--accent); }
.ep-info { flex: 1; min-width: 0; }
.ep-title-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.ep-info h4 { font-size: 16px; margin: 0; }
.ep-info p { font-size: 13.5px; color: var(--text3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-watch-mark {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.ep-lang {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 2px 9px 2px 7px; border-radius: 100px; font-size: 11.5px; font-weight: 800; white-space: nowrap;
  border: 1px solid transparent;
}
.ep-lang svg { width: 13px; height: 13px; }
.ep-lang.dub { color: #6fdc97; background: rgba(80,200,120,.14); border-color: rgba(80,200,120,.3); }
.ep-lang.sub { color: #8ec5ff; background: rgba(70,145,255,.14); border-color: rgba(70,145,255,.3); }
.ep-dur { font-size: 13px; color: var(--text3); flex-shrink: 0; }

@media (max-width: 768px) {
  .hero-inner, .detail-inner { padding-left: 18px; padding-right: 18px; }
  .episodes { padding-left: 18px; padding-right: 18px; }
  .ep-thumb { width: 96px; }
  .detail-hero-rich { min-height: 74vh; }
  .detail-inner-rich { padding-bottom: 44px; }
  .detail-poster { display: none; }
  .detail-more {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 18px 0;
  }
  .detail-facts div { grid-template-columns: 68px minmax(0, 1fr); }
  .detail-actions {
    align-items: stretch;
    gap: 10px;
  }
  .detail-action-pill {
    min-height: 44px;
    padding: 0 14px;
    font-size: 13px;
  }
  .ep {
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
  }
  .ep-num { width: 24px; font-size: 18px; padding-top: 24px; }
  .ep-title-line { display: block; }
  .ep-watch-mark { display: block; margin-top: 3px; }
  .ep-dur { display: none; }
}
