/* Archytele Deep-Dive & Features Styling: Ratings Heatmap, Binge Calculator, Facts & Hubs */

.show-deepdive, .binge-hub {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Breadcrumbs */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: #94a3b8;
  gap: 0.5rem;
}
.breadcrumbs li+li:before {
  content: "/";
  margin-right: 0.5rem;
  color: #64748b;
}
.breadcrumbs a {
  color: #94a3b8;
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: #f8fafc;
  text-decoration: underline;
}

/* Header & Tabs */
.deepdive-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.5rem;
}
.deepdive-meta {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.header-poster img {
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: block;
}
.header-titles h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0.25rem 0 0.5rem;
  color: #ffffff;
}
.badge-series {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}
.deepdive-meta .subtitle {
  font-size: 1rem;
  color: #94a3b8;
  margin: 0;
}

/* Subpage Tabs */
.subpage-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}
.tab-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.tab-link.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.metric-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-card.highlight {
  border-color: rgba(59, 130, 246, 0.4);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, #111827 100%);
}
.metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}
.metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.metric-value small {
  font-size: 1rem;
  color: #94a3b8;
}
.metric-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.metric-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
}
.metric-link:hover {
  text-decoration: underline;
}

/* Heatmap Table */
.panel {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 1rem 0 1.25rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}
.score-great { background: #15803d; color: #f0fdf4; }
.score-good  { background: #166534; color: #dcfce7; }
.score-mid   { background: #b45309; color: #fef3c7; }
.score-bad   { background: #b91c1c; color: #fee2e2; }
.score-muted { background: #374151; color: #9ca3af; }
.score-none  { background: transparent; color: #4b5563; }

.heatmap-table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}
.heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.85rem;
  text-align: center;
}
.heatmap-table th {
  padding: 0.5rem;
  font-weight: 700;
  color: #94a3b8;
}
.heatmap-table .th-ep, .heatmap-table .row-num {
  text-align: left;
  white-space: nowrap;
  font-size: 0.8rem;
  color: #64748b;
  padding-right: 0.5rem;
}
.heatmap-table .cell {
  border-radius: 4px;
  padding: 0;
  height: 38px;
  min-width: 44px;
  vertical-align: middle;
}
.heatmap-table .cell a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.heatmap-table .cell.empty-cell {
  color: #374151;
}
.season-avg-row th, .season-avg-row td {
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem;
}

/* Tables general */
.table-responsive {
  overflow-x: auto;
}
.striped-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.striped-table th, .striped-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.striped-table th {
  color: #94a3b8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bold-link {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}
.bold-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}
.badge-score {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Binge Pacing Cards */
.pacing-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.pacing-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
}
.pacing-card.pacing-recommended {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
}
.recommended-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
}
.pacing-card h3 {
  font-size: 0.95rem;
  color: #ffffff;
  margin: 0.25rem 0 0.75rem;
}
.pacing-stat {
  margin-bottom: 0.75rem;
}
.days-num {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
}
.days-lbl {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-left: 0.25rem;
}
.pacing-finish {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* Playback Speed Pills */
.speed-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1rem;
}
.speed-box h3 {
  font-size: 0.95rem;
  color: #ffffff;
  margin: 0 0 0.35rem;
}
.speed-box p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0 0 0.75rem;
}
.speed-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.speed-pills .pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: #e2e8f0;
}

/* Progress bar wrap */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.progress-bar-fill {
  height: 8px;
  background: #3b82f6;
  border-radius: 9999px;
}
.progress-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Facts Grid */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.fact-box {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.25rem;
}
.fact-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: block;
  margin-bottom: 0.35rem;
}
.fact-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

/* Status Pill */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #374151;
  color: #f3f4f6;
}
.status-ended { background: #4b5563; }
.status-returning-series, .status-in-production { background: #065f46; color: #a7f3d0; }
.status-canceled { background: #991b1b; color: #fecaca; }

/* FAQ Accordions */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.faq-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}
.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
}
.faq-question:hover {
  background: rgba(255, 255, 255, 0.06);
}
.faq-answer {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.6;
}
.faq-answer p {
  margin: 0;
}

/* Binge Hub Cards */
.quick-jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.jump-pill {
  display: inline-block;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
}
.jump-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.show-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.binge-show-card {
  display: flex;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.85rem;
  align-items: center;
}
.card-poster img {
  border-radius: 6px;
  display: block;
}
.card-info {
  flex: 1;
  min-width: 0;
}
.card-info h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-info h3 a {
  color: #ffffff;
  text-decoration: none;
}
.card-info h3 a:hover {
  color: #38bdf8;
  text-decoration: underline;
}
.badge-time {
  background: #1e3a8a;
  color: #93c5fd;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.35rem;
}
.card-verdict {
  font-size: 0.8rem;
  color: #34d399;
  margin: 0.35rem 0 0.5rem;
}
.calc-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
}
.calc-link:hover {
  text-decoration: underline;
}

/* Crosslink Footer */
.crosslink-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}
.crosslink-card h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #ffffff;
}
.link-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}
.btn-primary { background: #2563eb; color: #ffffff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: rgba(255, 255, 255, 0.06); color: #cbd5e1; border: 1px solid rgba(255, 255, 255, 0.1); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

/* Responsive adjustments */
@media (max-width: 640px) {
  .deepdive-meta {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .header-titles h1 {
    font-size: 1.75rem;
  }
}
