/* ═══════════════════════════════════════════════════════════════
   anime-hub.css — S3r4phNet Anime Intel Hub (Refactored)
   Isekai Cyberpunk design system · Dark void + neon accents
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --bg: #0a0810;
  --surface: #0f0c18;
  --card: #141020;
  --card2: #1a1428;
  --border: #2a1a40;
  --border-hover: #3d2860;
  --accent: #a855f7;
  --accent2: #ff6eb4;
  --accent3: #d8b4fe;
  --text: #d8d0e8;
  --muted: #6a5a8a;
  --glow: 0 0 18px rgba(168,85,247,0.22);
  --glow2: 0 0 18px rgba(255,110,180,0.22);
  --danger: #ff3366;
  --warn: #ff8c42;
  --success: #00ff88;
  --cyan: #00f0ff;
  --gold: #ffcc00;
  --radius: 12px;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Ambient background gradients */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(168,85,247,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,110,180,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(216,180,254,0.02) 0%, transparent 40%);
  pointer-events: none; z-index: 0;
}
/* CRT scanline overlay */
body::after {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(168,85,247,0.008) 2px, rgba(168,85,247,0.008) 4px
  );
  pointer-events: none; z-index: 0;
}

.container { max-width: 1400px; margin: 0 auto; padding: 1.5rem; position: relative; z-index: 1; }

/* ── Header ── */
.hub-header { text-align: center; padding: 2rem 0 1.2rem; }
.hub-header h1 {
  font-size: 2.2rem; font-weight: 700;
  background: linear-gradient(135deg, #a855f7, #ff6eb4, #d8b4fe);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.hub-header .subtitle { color: var(--muted); font-size: 0.95rem; margin-top: 0.3rem; }
.hub-header .classification {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 700;
  animation: pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: var(--accent); box-shadow: 0 0 8px rgba(168,85,247,0.2); }
  50% { border-color: var(--accent2); box-shadow: 0 0 16px rgba(255,110,180,0.3); }
}

/* Collapsible about */
.about-toggle {
  margin: 0.8rem auto 0; max-width: 800px;
}
.about-toggle summary {
  cursor: pointer; color: var(--muted); font-size: 0.82rem;
  list-style: none; text-align: center;
  padding: 0.3rem 0;
  transition: color 0.2s;
}
.about-toggle summary:hover { color: var(--accent); }
.about-toggle summary::before { content: '▸ '; }
.about-toggle[open] summary::before { content: '▾ '; }
.about-toggle .about-body {
  margin-top: 0.6rem; padding: 1rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted); font-size: 0.85rem; line-height: 1.7;
}
.about-toggle .about-body a { color: var(--accent); text-decoration: none; }
.about-toggle .about-body a:hover { text-decoration: underline; }

/* ── Stats Bar ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem; margin: 1rem 0;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.stat-card:hover { border-color: var(--accent); box-shadow: var(--glow); }
.stat-card .label {
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  font-family: var(--font-mono);
}
.stat-card .value { font-size: 1.7rem; font-weight: 700; color: var(--accent); margin: 0.2rem 0; }
.stat-card .value.pink { color: var(--accent2); }
.stat-card .value.green { color: var(--success); }
.stat-card .value.gold { color: var(--gold); }
.stat-card .value.cyan { color: var(--cyan); }

/* ── Section Headers ── */
.section-title {
  color: var(--accent2); font-size: 1.15rem; margin: 1.5rem 0 0.8rem;
  padding-bottom: 0.4rem; padding-left: 0.6rem;
  border-left: 3px solid;
  border-image: linear-gradient(to bottom, var(--accent), var(--accent2)) 1;
  border-bottom: none;
}

/* ── Card base (shared) ── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: 0.8rem 0;
}

/* ── Arc Timeline ── */
.arc-entry {
  display: flex; gap: 1rem; padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.arc-entry:hover { background: rgba(168,85,247,0.03); }
.arc-entry:last-child { border-bottom: none; }
.arc-date {
  flex-shrink: 0; width: 95px;
  font-size: 0.78rem; color: var(--accent2);
  font-weight: 600; padding-top: 0.15rem;
  font-family: var(--font-mono);
}
.arc-body { flex: 1; }
.arc-name { font-weight: 600; color: var(--text); font-size: 0.92rem; margin-bottom: 0.15rem; }
.arc-studio { font-size: 0.73rem; color: var(--accent); font-family: var(--font-mono); }
.arc-desc { font-size: 0.83rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.5; }
.arc-status { flex-shrink: 0; display: flex; align-items: flex-start; padding-top: 0.15rem; }

/* Status badges */
.badge-airing { background: rgba(0,255,136,0.12); color: var(--success); padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.68rem; font-weight: 600; white-space: nowrap; }
.badge-confirmed { background: rgba(168,85,247,0.15); color: var(--accent); padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.68rem; font-weight: 600; white-space: nowrap; }
.badge-rumor { background: rgba(255,140,66,0.12); color: var(--warn); padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.68rem; font-weight: 600; white-space: nowrap; }
.badge-upcoming { background: rgba(0,240,255,0.12); color: var(--cyan); padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.68rem; font-weight: 600; white-space: nowrap; }
.badge-completed { background: rgba(106,90,138,0.2); color: var(--muted); padding: 0.15rem 0.6rem; border-radius: 10px; font-size: 0.68rem; font-weight: 600; white-space: nowrap; }

/* ── Rumors & Conventions 2-col grid ── */
.intel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.8rem 0;
}

/* Rumors */
.rumor-entry {
  display: flex; gap: 0.8rem; padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.rumor-entry:hover { background: rgba(255,140,66,0.03); }
.rumor-entry:last-child { border-bottom: none; }
.rumor-source {
  flex-shrink: 0; width: 80px;
  font-size: 0.68rem; color: var(--warn);
  font-weight: 600; padding-top: 0.15rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  font-family: var(--font-mono);
}
.rumor-body { flex: 1; }
.rumor-title { font-weight: 600; color: var(--text); font-size: 0.88rem; margin-bottom: 0.15rem; }
.rumor-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.rumor-credibility { flex-shrink: 0; display: flex; align-items: flex-start; padding-top: 0.15rem; }
.cred-high { color: var(--success); font-size: 0.68rem; font-weight: 600; font-family: var(--font-mono); }
.cred-medium { color: var(--gold); font-size: 0.68rem; font-weight: 600; font-family: var(--font-mono); }
.cred-low { color: var(--danger); font-size: 0.68rem; font-weight: 600; font-family: var(--font-mono); }

/* Convention cards */
.con-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}
.con-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.con-card:hover { border-color: var(--accent); box-shadow: var(--glow); }
.con-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.4rem; }
.con-name { font-weight: 700; color: var(--accent); font-size: 0.95rem; }
.con-date { font-size: 0.72rem; color: var(--accent2); font-weight: 600; font-family: var(--font-mono); }
.con-location { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; }
.con-highlights { font-size: 0.8rem; color: var(--text); line-height: 1.5; }
.con-tag {
  display: inline-block; font-size: 0.62rem; padding: 0.12rem 0.45rem;
  border-radius: 3px; background: rgba(168,85,247,0.1); color: var(--accent);
  border: 1px solid rgba(168,85,247,0.2); margin-top: 0.4rem; margin-right: 0.25rem;
}

/* ── Series Section: Sidebar + Table ── */
.series-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  margin: 0.8rem 0;
}

/* Genre sidebar */
.genre-sidebar {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.genre-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.genre-card:hover, .genre-card.active {
  border-color: var(--accent); box-shadow: var(--glow);
}
.genre-card.active { background: rgba(168,85,247,0.08); }
.genre-card .genre-icon { font-size: 1.4rem; }
.genre-card .genre-name { font-size: 0.75rem; color: var(--accent); font-weight: 600; margin-top: 0.15rem; }
.genre-card .genre-count { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.genre-card .genre-sub { font-size: 0.62rem; color: var(--muted); }

/* Table area */
.table-area { min-width: 0; } /* prevent grid blowout */

.search-box {
  width: 100%; max-width: 400px;
  padding: 0.55rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
  outline: none;
  transition: border-color 0.3s;
}
.search-box:focus { border-color: var(--accent); }

/* Collapsible season chart toggle */
.chart-toggle { margin-bottom: 0.8rem; }
.chart-toggle summary {
  cursor: pointer; color: var(--accent2); font-size: 0.85rem;
  font-weight: 600; list-style: none;
  padding: 0.4rem 0;
}
.chart-toggle summary::before { content: '▸ '; font-family: var(--font-mono); }
.chart-toggle[open] summary::before { content: '▾ '; }
.chart-toggle .chart-body {
  margin-top: 0.5rem; padding: 1rem;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bar-row { display: flex; align-items: center; margin: 0.3rem 0; gap: 0.5rem; }
.bar-label { width: 120px; text-align: right; font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 20px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; min-width: 2px; display: flex; align-items: center; padding-left: 8px; font-size: 0.7rem; color: #fff; font-weight: 600; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
thead th {
  text-align: left;
  padding: 0.6rem 0.7rem;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  position: sticky; top: 0; z-index: 2;
}
thead th:hover { color: var(--accent2); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.2s; }
tbody tr:nth-child(even) { background: rgba(168,85,247,0.015); }
tbody tr:hover { background: rgba(168,85,247,0.05); }
tbody td { padding: 0.5rem 0.7rem; color: var(--text); }
.td-series a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dashed rgba(168,85,247,0.4);
  transition: color 0.2s;
}
.td-series a:hover { color: var(--accent2); }

/* (Replaced by STEM-style sections below) */

/* ── STEM-style Sections (Daily Scan & Weekly Briefings) ── */
.stem-section {
  margin: 1.2rem 0;
}
.section-header.stem-header {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
  border: none; padding: 0;
}
.section-header.stem-header .prompt {
  color: var(--accent); margin-right: 0.4rem;
}
.stem-note {
  color: var(--muted); font-size: 0.82rem; margin-bottom: 0.8rem;
  line-height: 1.5;
}

/* Scan card */
.stem-scan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.stem-scan-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.6rem;
}
.stem-scan-label {
  color: var(--cyan); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 1.5px; font-family: var(--font-mono);
}
.stem-scan-date {
  color: var(--muted); font-size: 0.75rem; font-family: var(--font-mono);
}
.stem-scan-summary {
  color: var(--text); font-size: 0.88rem; line-height: 1.7;
}
.stem-scan-updates {
  margin-top: 0.5rem; color: var(--accent); font-size: 0.8rem;
  font-family: var(--font-mono);
}

/* Briefing list */
.stem-briefing-list-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.briefing-list {
  margin: 0; padding: 0; list-style: none;
}
.briefing-list li { margin: 0.4rem 0; }
.briefing-list a {
  color: var(--accent3); text-decoration: none; font-size: 0.85rem;
  transition: color 0.2s;
}
.briefing-list a:hover { color: var(--accent); }
.briefing-date {
  color: var(--muted); font-size: 0.75rem; font-family: var(--font-mono);
  margin-left: 0.5rem;
}
.briefing-live {
  color: var(--gold) !important; font-weight: 700;
}

/* ── Footer ── */
.site-footer { margin-top: auto; border-top: 1px solid #1a1a2e; background: rgba(10, 10, 15, 0.8); }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1.5rem; text-align: center; }
.site-footer p {
  font-size: 0.75rem; color: #4a4a5e; letter-spacing: 1px;
  font-family: var(--font-mono); line-height: 1.6;
}
.site-footer #lastUpdated:not(:empty)::before { content: " | Last updated: "; opacity: 0.7; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .intel-grid { grid-template-columns: 1fr; }
  .series-layout { grid-template-columns: 1fr; }
  .genre-sidebar {
    flex-direction: row; flex-wrap: wrap; gap: 0.4rem;
  }
  .genre-card { padding: 0.5rem 0.7rem; flex: 1 1 100px; min-width: 90px; }
  .genre-card .genre-icon { font-size: 1.1rem; }
  .genre-card .genre-count { font-size: 0.9rem; }
}
@media (max-width: 768px) {
  .hub-header h1 { font-size: 1.5rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .arc-entry, .rumor-entry { flex-direction: column; gap: 0.2rem; }
  .arc-date, .rumor-source { width: auto; }
}
