/* =============================================
   FilmChest — extra.css
   Detail pages, season accordion, cast rail,
   trailer embed, form pages, browse controls
   ============================================= */

/* --- Detail Page Layout --- */
.detail-backdrop {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .detail-backdrop { height: 480px; }
}

.detail-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.detail-backdrop-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12,11,20,0.2) 0%,
    rgba(12,11,20,0.6) 60%,
    var(--bg) 100%
  );
}

[data-theme="light"] .detail-backdrop-grad {
  background: linear-gradient(
    to bottom,
    rgba(244,240,232,0.2) 0%,
    rgba(244,240,232,0.6) 60%,
    var(--bg) 100%
  );
}

.detail-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 80px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: -120px;
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .detail-layout {
    grid-template-columns: 220px 1fr;
    margin-top: -180px;
    gap: 40px;
  }
}

@media (min-width: 1024px) {
  .detail-layout { grid-template-columns: 260px 1fr; }
}

.detail-poster-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

@media (min-width: 768px) {
  .detail-poster-col { align-items: flex-start; }
}

.detail-poster {
  width: 160px;
  border-radius: var(--r3);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .detail-poster { width: 100%; }
}

.detail-info-col {
  padding-top: 0;
}

@media (min-width: 768px) {
  .detail-info-col { padding-top: 120px; }
}

.detail-title {
  font-family: var(--f-serif);
  font-size: clamp(26px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-rating-imdb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--f-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

.detail-rating-imdb svg { width: 16px; height: 16px; }
.detail-rating-imdb .rating-source { font-size: 10px; font-weight: 500; color: var(--text2); }

.detail-rating-tmdb {
  font-size: 12px;
  color: var(--text2);
  font-family: var(--f-mono);
}

.detail-year { font-size: 14px; color: var(--text2); }
.detail-runtime { font-size: 14px; color: var(--text2); }

.detail-content-rating {
  font-size: 11px;
  color: var(--text3);
  padding: 3px 8px;
  border: 1px solid var(--text3);
  border-radius: var(--r1);
}

.detail-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--pill);
}

.detail-status--ongoing { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.detail-status--ended { background: var(--bg2); color: var(--text2); }
.detail-status--cancelled { background: rgba(248, 113, 113, 0.12); color: var(--red); }

.detail-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.detail-genre-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--pill);
  background: var(--gold-d);
  color: var(--gold);
  font-weight: 500;
  border: 1px solid var(--gold-g);
}

.detail-overview {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 20px;
  max-width: 680px;
}

.detail-credit {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 8px;
}

.detail-credit strong { color: var(--text1); font-weight: 600; }

/* --- Download Section --- */
.download-section {
  margin-top: 28px;
  padding: 24px;
  background: var(--bg2);
  border: var(--glass-border);
  border-radius: var(--r3);
}

.download-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 16px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 480px) {
  .quality-grid { grid-template-columns: repeat(3, 1fr); }
}

.quality-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: var(--r2);
  background: var(--bg3);
  border: var(--glass-border);
  color: var(--text1);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
  gap: 3px;
}

.quality-btn:hover {
  background: var(--gold-d);
  border-color: var(--gold-g);
  color: var(--gold);
  transform: translateY(-2px);
}

.quality-btn-size {
  font-size: 10px;
  font-family: var(--f-mono);
  color: var(--text2);
  font-weight: 400;
}

.download-unavailable {
  font-size: 14px;
  color: var(--text2);
  font-style: italic;
  padding: 12px 0;
}

/* --- Channel CTA Block --- */
.channel-cta {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg2);
  border: var(--glass-border);
  border-radius: var(--r3);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.channel-cta-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-cta-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r2);
  background: var(--gold-d);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.channel-cta-icon svg { width: 20px; height: 20px; }

.channel-cta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}

.channel-cta-title {
  font-size: 15px;
  font-weight: 600;
}

.channel-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.channel-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.channel-cta-btn--primary {
  background: var(--gold);
  color: var(--on-gold);
}

.channel-cta-btn--primary:hover { background: var(--gold2); }

.channel-cta-btn--secondary {
  background: var(--bg3);
  border: var(--glass-border);
  color: var(--text1);
}

.channel-cta-btn--secondary:hover { background: var(--bg4); }
.channel-cta-btn svg { width: 14px; height: 14px; }

.channel-coming-soon {
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.channel-coming-soon svg { width: 14px; height: 14px; color: var(--text3); }

.channel-notify-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg3);
  border: var(--glass-border);
  color: var(--text1);
  transition: all var(--transition);
}

.channel-notify-btn:hover { background: var(--bg4); }
.channel-notify-btn svg { width: 13px; height: 13px; }

/* --- Season Accordion --- */
.seasons-section {
  margin-top: 40px;
}

.seasons-title {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.season-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.season-item {
  background: var(--bg2);
  border: var(--glass-border);
  border-radius: var(--r3);
  overflow: hidden;
  transition: border-color var(--transition);
}

.season-item.open { border-color: var(--gold-g); }

.season-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.season-header:hover { background: var(--bg3); }

.season-number {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.season-ep-count {
  font-size: 12px;
  color: var(--text2);
  font-family: var(--f-mono);
}

.season-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--gold-d);
  color: var(--gold);
  border: 1px solid var(--gold-g);
  transition: all var(--transition);
}

.season-dl-btn:hover { background: var(--gold-g); }
.season-dl-btn svg { width: 12px; height: 12px; }

.season-chevron {
  width: 20px;
  height: 20px;
  color: var(--text3);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.season-item.open .season-chevron { transform: rotate(180deg); }

.season-episodes {
  display: none;
  padding: 0 0 12px;
  border-top: var(--glass-border);
}

.season-item.open .season-episodes { display: block; }

.episode-row {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 14px;
  border-bottom: var(--glass-border);
  transition: background var(--transition);
}

.episode-row:last-child { border-bottom: none; }
.episode-row:hover { background: var(--bg3); }

.ep-number {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text3);
  min-width: 36px;
  flex-shrink: 0;
}

.ep-title {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-qualities {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.episode-quality-btn {
  padding: 4px 9px;
  border-radius: var(--r1);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg3);
  border: var(--glass-border);
  color: var(--text2);
  transition: all var(--transition);
}

.episode-quality-btn:hover {
  background: var(--gold-d);
  color: var(--gold);
  border-color: var(--gold-g);
}

/* --- Cast Rail --- */
.cast-section {
  margin-top: 40px;
}

.cast-title {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.cast-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
}

.cast-rail::-webkit-scrollbar { display: none; }

.cast-card {
  flex-shrink: 0;
  width: 100px;
  text-align: center;
}

.cast-headshot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  background: var(--bg3);
  border: 2px solid var(--bg3);
}

.cast-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text1);
  line-height: 1.3;
  margin-bottom: 3px;
}

.cast-character {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Trailer Section --- */
.trailer-section {
  margin-top: 40px;
}

.trailer-title {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.trailer-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--r3);
  overflow: hidden;
  background: var(--bg2);
}

.trailer-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* --- Report Link --- */
.detail-report-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  margin-top: 32px;
  transition: color var(--transition);
}

.detail-report-link:hover { color: var(--text2); }
.detail-report-link svg { width: 13px; height: 13px; }

/* --- Form Pages --- */
.form-page-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) var(--pad) 80px;
}

.form-page-title {
  font-family: var(--f-serif);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-page-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 32px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 8px;
}

.form-label .form-required { color: var(--gold); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg2);
  border: var(--glass-border);
  border-radius: var(--r2);
  color: var(--text1);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--gold); }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text3); }

.form-select option { background: var(--bg3); }

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  font-size: 12px;
  color: var(--text3);
  margin-top: 6px;
}

.form-submit-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--pill);
  background: var(--gold);
  color: var(--on-gold);
  font-size: 15px;
  font-weight: 700;
  transition: background var(--transition);
  margin-top: 8px;
}

.form-submit-btn:hover { background: var(--gold2); }
.form-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.form-success {
  padding: 24px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--r3);
  text-align: center;
  color: var(--green);
  font-size: 15px;
  font-weight: 500;
}

/* --- Announcements Page --- */
.announcements-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Trending Page --- */
.trending-rank {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(12,11,20,0.8);
  padding: 2px 6px;
  border-radius: var(--r1);
}

/* --- Profile Page --- */
.profile-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) var(--pad) 80px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: var(--bg2);
  border: var(--glass-border);
  border-radius: var(--r3);
  margin-bottom: 28px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 700;
}

.profile-username {
  font-size: 13px;
  color: var(--text2);
  margin-top: 3px;
  font-family: var(--f-mono);
}

.profile-signout-btn {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: var(--pill);
  background: var(--bg3);
  border: var(--glass-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
}

.profile-signout-btn:hover { color: var(--red); border-color: var(--red); }

.profile-section {
  margin-bottom: 28px;
}

.profile-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: var(--glass-border);
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
}

.profile-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 12px;
  background: var(--bg2);
}

.profile-table td {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text2);
  border-bottom: var(--glass-border);
}

.profile-table td:first-child { color: var(--text1); font-weight: 500; }

.profile-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-pending { background: rgba(245,166,35,0.15); color: var(--gold); }
.badge-fulfilled { background: rgba(52,211,153,0.15); color: var(--green); }
.badge-declined { background: rgba(248,113,113,0.15); color: var(--red); }

.profile-empty {
  padding: 24px;
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  background: var(--bg2);
  border-radius: var(--r2);
}

.profile-notify-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  gap: 12px;
  border-bottom: var(--glass-border);
}

.profile-notify-row:last-child { border-bottom: none; }

.profile-notify-title { flex: 1; font-size: 13px; }

.profile-notify-remove {
  font-size: 12px;
  color: var(--text3);
  padding: 4px 10px;
  border-radius: var(--r1);
  border: var(--glass-border);
  transition: all var(--transition);
}

.profile-notify-remove:hover { color: var(--red); border-color: var(--red); }

/* --- Search Page --- */
.search-page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) var(--pad) 80px;
}

.search-page-input-wrap {
  position: relative;
  margin-bottom: 32px;
}

.search-page-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text3);
  pointer-events: none;
}

.search-page-input {
  width: 100%;
  padding: 16px 18px 16px 52px;
  background: var(--bg2);
  border: var(--glass-border);
  border-radius: var(--pill);
  font-size: 16px;
  color: var(--text1);
  outline: none;
  transition: border-color var(--transition);
}

.search-page-input:focus { border-color: var(--gold); }
.search-page-input::placeholder { color: var(--text3); }

.search-type-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border: var(--glass-border);
  border-radius: var(--pill);
  padding: 3px;
  align-self: flex-start;
  margin-bottom: 24px;
}

/* --- Adult Page Specifics --- */
.adult-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--pill);
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.adult-badge svg { width: 12px; height: 12px; }
