/* ============================================
   DETAIL PAGE
   ============================================ */

/* Back button */
.detail__back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  margin-bottom: 16px;
}
.detail__back:hover { background: var(--chip); color: var(--text-primary); }
.detail__back svg { width: 18px; height: 18px; }

/* Hero */
.detail__hero {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 16/7;
  min-height: 220px;
  max-height: 500px;
}
.detail__hero-img {
  width: 100%; height: 140%;
  object-fit: cover;
  object-position: top center;
}
.detail__hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 10%,
    color-mix(in srgb, var(--bg) 40%, transparent) 50%,
    var(--bg) 100%
  );
}
.detail__hero-info {
  position: absolute; bottom: 24px; left: 24px; right: 24px;
  z-index: 5;
}
.detail__hero-title {
  font-size: 28px; font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  margin-bottom: 6px;
  word-break: break-word;
}
.detail__hero-original {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 10px;
}
.detail__hero-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255,255,255,0.12);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.hero-pill--kp {
  background: rgba(255, 120, 0, 0.45);
  border-color: rgba(255, 149, 0, 0.5);
  color: #ffe0b2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-pill--imdb {
  background: rgba(245, 197, 24, 0.4);
  border-color: rgba(245, 197, 24, 0.5);
  color: #fff8e1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-pill--accent {
  background: color-mix(in srgb, var(--accent) 40%, rgba(255,255,255,0.08));
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: #fff;
}

/* Stat strip below hero */
.detail__stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s;
}
.stat-chip:hover {
  border-color: rgba(255,255,255,0.1);
  background: color-mix(in srgb, var(--card) 90%, var(--accent));
}
.stat-chip__icon {
  width: 16px; height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.stat-chip__label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-chip__value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-chip--kp .stat-chip__value { color: #ff9500; }
.stat-chip--imdb .stat-chip__value { color: #f5c518; }
.detail__hero-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.detail__play-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 14px;
  background: var(--accent);
  color: #fff; font-size: 15px; font-weight: 700;
  transition: all 0.2s;
  white-space: nowrap;
}
.detail__play-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.detail__play-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.detail__fav-btn {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  transition: all 0.2s;
}
.detail__fav-btn:hover { background: rgba(255,255,255,0.18); transform: scale(1.08); }
.detail__fav-btn svg { width: 22px; height: 22px; }
.detail__fav-btn--active svg { fill: #e50914; color: #e50914; }

/* Info grid */
.detail__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.detail__body > div {
  min-width: 0;
  overflow: hidden;
}

/* Section */
.detail__section-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.detail__section-title svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

/* Description */
.detail__description {
  font-size: 14px; line-height: 1.7;
  color: var(--text-secondary);
  word-break: break-word;
}
.detail__description--clamped {
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.detail__more-btn {
  color: var(--accent); font-size: 13px; font-weight: 600;
  margin-top: 8px; display: inline-flex; align-items: center; gap: 4px;
}
.detail__more-btn:hover { text-decoration: underline; }

/* Info chips */
.detail__chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.detail__chip {
  padding: 6px 14px; border-radius: 10px;
  background: var(--chip);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
}

/* Info table */
.detail__info-table {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 16px;
  word-break: break-word;
  max-width: 100%;
}
.detail__info-label {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.detail__info-value {
  font-size: 13px; color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* Info card wrapper */
.detail__info-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.04);
  min-width: 0;
  overflow: hidden;
}

/* (Intro stats removed — now hero pills) */

/* People row */
.detail__people-wrap {
  min-width: 0;
  overflow: hidden;
  margin-top: 24px;
}
.detail__people {
  display: flex; gap: 14px;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.detail__people::-webkit-scrollbar { display: none; }

.detail__person {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 80px; max-width: 80px;
  flex-shrink: 0;
}
.detail__person-photo {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  border: 2px solid var(--chip);
}
.detail__person-name {
  font-size: 11px; font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Player */
.detail__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  margin-bottom: 24px;
}
.detail__player iframe {
  width: 100%; height: 100%; border: none;
}
.detail__player-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: var(--text-secondary);
  gap: 12px;
}
.detail__player-placeholder svg { width: 48px; height: 48px; opacity: 0.3; }

/* Franchise */
.detail__franchise { margin-top: 4px; }
.detail__franchise-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.detail__franchise-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.detail__franchise-item--active {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}
.detail__franchise-num {
  font-size: 14px; font-weight: 800;
  color: var(--accent);
  min-width: 28px;
  flex-shrink: 0;
}
.detail__franchise-title {
  flex: 1; font-size: 13px; font-weight: 600;
  word-break: break-word;
}
.detail__franchise-meta {
  font-size: 11px; color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE — DESKTOP LARGE (1200px+)
   ============================================ */
@media (min-width: 1200px) {
  .detail__hero { aspect-ratio: 21/8; max-height: 520px; }
  .detail__hero-title { font-size: 40px; }
  .detail__hero-info { bottom: 32px; left: 32px; right: 32px; }
  .detail__body {
    grid-template-columns: 2fr 1fr;
    gap: 36px;
  }
  .detail__player { border-radius: 20px; }
  .detail__person { min-width: 90px; max-width: 90px; }
  .detail__person-photo { width: 72px; height: 72px; }
  .detail__person-name { font-size: 12px; }
}

/* ============================================
   RESPONSIVE — DESKTOP (900px – 1199px)
   ============================================ */
@media (min-width: 900px) and (max-width: 1199px) {
  .detail__body {
    grid-template-columns: 5fr 2fr;
    gap: 28px;
  }
  .detail__hero { aspect-ratio: 16/6; }
  .detail__hero-title { font-size: 34px; }
}

/* ============================================
   RESPONSIVE — TABLET (601px – 899px)
   ============================================ */
@media (min-width: 601px) and (max-width: 899px) {
  .detail__hero { aspect-ratio: 16/8; border-radius: 16px; }
  .detail__hero-title { font-size: 26px; }
  .detail__hero-info { bottom: 20px; left: 20px; right: 20px; }
  .detail__body {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .detail__player { border-radius: 14px; }
  .detail__play-btn { padding: 11px 24px; font-size: 14px; }
}

/* ============================================
   RESPONSIVE — MOBILE (480px – 600px)
   ============================================ */
@media (max-width: 600px) {
  .detail__back { padding: 6px 12px; font-size: 13px; margin-bottom: 12px; }
  .detail__hero {
    aspect-ratio: 3/2;
    border-radius: 14px;
    margin-bottom: 20px;
    min-height: 200px;
    max-height: 320px;
  }
  .detail__hero-title { font-size: 22px; }
  .detail__hero-original { font-size: 12px; margin-bottom: 8px; }
  .detail__hero-info { bottom: 14px; left: 14px; right: 14px; }
  .detail__hero-pills { gap: 5px; margin-bottom: 10px; }
  .hero-pill { padding: 4px 10px; font-size: 10px; border-radius: 8px; }
  .detail__stat-strip { gap: 8px; margin-bottom: 16px; }
  .stat-chip { padding: 6px 12px; border-radius: 10px; font-size: 12px; }
  .stat-chip__icon { width: 14px; height: 14px; }
  .stat-chip__label { font-size: 9px; }
  .stat-chip__value { font-size: 12px; }
  .detail__hero-actions { gap: 8px; }
  .detail__play-btn {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 12px;
    gap: 6px;
  }
  .detail__play-btn svg { width: 16px; height: 16px; }
  .detail__fav-btn {
    width: 42px; height: 42px;
    border-radius: 12px;
  }
  .detail__fav-btn svg { width: 20px; height: 20px; }
  .detail__body { gap: 20px; }
  .detail__section-title { font-size: 15px; margin-bottom: 10px; }
  .detail__description { font-size: 13px; line-height: 1.65; }
  .detail__chip { padding: 5px 12px; font-size: 12px; }
  .detail__player {
    border-radius: 12px;
    margin-bottom: 20px;
  }
  .detail__person { min-width: 70px; max-width: 70px; }
  .detail__person-photo { width: 56px; height: 56px; }
  .detail__person-name { font-size: 10px; }
  .detail__people { gap: 10px; }
  .detail__franchise-item { padding: 10px 12px; gap: 10px; border-radius: 10px; }
  .detail__franchise-title { font-size: 12px; }
  .detail__franchise-meta { font-size: 10px; }
  .detail__info-table { gap: 8px 12px; }
  .detail__info-label { font-size: 12px; }
  .detail__info-value { font-size: 12px; }

}

/* ============================================
   RESPONSIVE — SMALL MOBILE (< 400px)
   ============================================ */
@media (max-width: 400px) {
  .detail__hero {
    aspect-ratio: 1/1;
    border-radius: 12px;
    min-height: 180px;
    max-height: 280px;
  }
  .detail__hero-title { font-size: 18px; }
  .detail__hero-original { font-size: 11px; }
  .detail__hero-info { bottom: 12px; left: 12px; right: 12px; }
  .detail__hero-pills { gap: 4px; margin-bottom: 8px; }
  .hero-pill { padding: 3px 7px; font-size: 9px; border-radius: 6px; }
  .detail__stat-strip { gap: 6px; margin-bottom: 12px; }
  .stat-chip { padding: 5px 10px; border-radius: 8px; gap: 4px; }
  .stat-chip__label { font-size: 8px; }
  .stat-chip__value { font-size: 11px; }
  .detail__hero-actions { gap: 6px; }
  .detail__play-btn {
    padding: 8px 16px; font-size: 12px;
    border-radius: 10px;
  }
  .detail__fav-btn { width: 38px; height: 38px; border-radius: 10px; }
  .detail__fav-btn svg { width: 18px; height: 18px; }
  .detail__section-title { font-size: 14px; gap: 6px; }
  .detail__section-title svg { width: 16px; height: 16px; }
  .detail__description { font-size: 12px; }
  .detail__chip { padding: 4px 10px; font-size: 11px; border-radius: 8px; }
  .detail__person { min-width: 60px; max-width: 60px; }
  .detail__person-photo { width: 48px; height: 48px; }
  .detail__person-name { font-size: 9px; }
  .detail__people { gap: 8px; }
  .detail__franchise-item { padding: 8px 10px; }
  .detail__franchise-num { font-size: 12px; min-width: 24px; }
  .detail__franchise-title { font-size: 11px; }
  .detail__franchise-meta { font-size: 9px; }
  .detail__info-table { gap: 6px 10px; }
  .detail__info-label { font-size: 11px; }
  .detail__info-value { font-size: 11px; }
  .detail__player { border-radius: 10px; margin-bottom: 16px; }
  .detail__player-placeholder svg { width: 36px; height: 36px; }
  .detail__player-placeholder p { font-size: 12px; }

}

/* ============================================
   SAFE AREA (notch devices)
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .detail__hero-info {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ============================================
   ACTOR DETAIL PAGE
   ============================================ */

/* Header */
.actor__header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.actor__photo-wrap {
  flex-shrink: 0;
}
.actor__photo {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px rgba(var(--accent-rgb, 229, 9, 20), 0.2);
}
.actor__header-info {
  min-width: 0;
}
.actor__name {
  font-size: 26px; font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
  word-break: break-word;
}
.actor__original-name {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.actor__badges {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.actor__badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
  background: var(--chip);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Info card */
.actor__info-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 28px;
}

/* Sections */
.actor__section {
  margin-bottom: 28px;
}

/* Best works */
.actor__best-works {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.actor__best-work {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.04);
}
.actor__best-work-num {
  font-size: 14px; font-weight: 800;
  color: var(--accent);
  min-width: 24px;
  flex-shrink: 0;
}
.actor__best-work-title {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

/* Filmography grid */
.actor__filmography {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.actor__film-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.2s;
  cursor: pointer;
}
.actor__film-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.actor__film-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}
.actor__film-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.actor__film-rating {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px; font-weight: 700;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.5);
  color: #fff;
}
.actor__film-title {
  padding: 10px 10px 2px;
  font-size: 12px; font-weight: 600;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.actor__film-meta {
  padding: 2px 10px 10px;
  font-size: 11px;
  color: var(--text-secondary);
}
.actor__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  margin-left: 6px;
}

/* Person clickable */
.detail__person--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s;
}
.detail__person--link:hover {
  transform: scale(1.05);
}

/* ============================================
   ACTOR RESPONSIVE
   ============================================ */
@media (min-width: 1200px) {
  .actor__photo { width: 140px; height: 140px; }
  .actor__name { font-size: 32px; }
  .actor__filmography { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
}
@media (max-width: 600px) {
  .actor__header { gap: 16px; margin-bottom: 20px; }
  .actor__photo { width: 90px; height: 90px; border-width: 2px; }
  .actor__name { font-size: 20px; }
  .actor__original-name { font-size: 12px; margin-bottom: 8px; }
  .actor__badge { padding: 4px 10px; font-size: 11px; }
  .actor__info-card { padding: 16px; margin-bottom: 20px; }
  .actor__section { margin-bottom: 20px; }
  .actor__best-work { padding: 8px 12px; }
  .actor__best-work-title { font-size: 12px; }
  .actor__filmography { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .actor__film-title { padding: 8px 8px 2px; font-size: 11px; }
  .actor__film-meta { padding: 2px 8px 8px; font-size: 10px; }
}
@media (max-width: 400px) {
  .actor__header { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .actor__photo { width: 80px; height: 80px; }
  .actor__name { font-size: 18px; }
  .actor__original-name { font-size: 11px; }
  .actor__badges { justify-content: center; }
  .actor__badge { padding: 3px 8px; font-size: 10px; }
  .actor__filmography { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .actor__film-title { font-size: 10px; }
  .actor__film-meta { font-size: 9px; }
  .actor__film-rating { font-size: 10px; padding: 2px 6px; }
}
