/* ==========================================================================
   VERITASIQ MANGA READER — STUDIO MULTI-THEME DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800;900&family=Noto+Sans+TC:wght@400;500;700;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-main: #0a0d14;
  --bg-card: #121824;
  --border-color: #2a364f;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --theme-accent: #e63946;
  --theme-gold: #ffd166;
  --theme-secondary: #1d3557;
  --theme-banner-bg: linear-gradient(135deg, #111827, #1f293d);
}

/* Theme 1: Detective Conan */
body.theme-conan {
  --bg-main: #0a0d14;
  --bg-card: #121824;
  --border-color: #2b3854;
  --theme-accent: #e63946;
  --theme-gold: #ffd166;
  --theme-secondary: #1d3557;
  --theme-banner-bg: linear-gradient(135deg, #0b0f19, #1c263b);
  background-image: radial-gradient(circle at 10% 10%, rgba(230, 57, 70, 0.12) 0%, transparent 40%);
}

/* Theme 2: Pokémon */
body.theme-pokemon {
  --bg-main: #080c14;
  --bg-card: #0f172a;
  --border-color: #1e293b;
  --theme-accent: #ffcc00;
  --theme-gold: #ffea79;
  --theme-secondary: #ee1515;
  --theme-banner-bg: linear-gradient(135deg, #1e1b4b, #312e81);
  background-image: radial-gradient(circle at 85% 15%, rgba(255, 204, 0, 0.15) 0%, transparent 45%);
}

/* Theme 3: Naruto */
body.theme-naruto {
  --bg-main: #0c0a09;
  --bg-card: #1c1917;
  --border-color: #44403c;
  --theme-accent: #ff6b00;
  --theme-gold: #fbbf24;
  --theme-secondary: #06b6d4;
  --theme-banner-bg: linear-gradient(135deg, #292524, #1c1917);
  background-image: radial-gradient(circle at 50% 10%, rgba(255, 107, 0, 0.15) 0%, transparent 45%);
}

/* Theme 4: Bubu & Dudu */
body.theme-bubu_dudu {
  --bg-main: #140d0a;
  --bg-card: #201612;
  --border-color: #4a3429;
  --theme-accent: #ff9a8b;
  --theme-gold: #ffd8be;
  --theme-secondary: #795548;
  --theme-banner-bg: linear-gradient(135deg, #2b1810, #3e2723);
  background-image: radial-gradient(circle at 20% 80%, rgba(255, 154, 139, 0.12) 0%, transparent 45%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans TC', 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color 0.3s ease;
}

/* Header */
.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reader-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.theme-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--theme-gold);
  letter-spacing: 0.05em;
}

.brand-group h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

/* Theme Switcher Bar */
.theme-switcher-bar {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.theme-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.theme-btn.active {
  background: var(--theme-accent);
  color: #ffffff;
  border-color: var(--theme-accent);
  box-shadow: 0 0 14px rgba(230, 57, 70, 0.4);
}

.theme-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
}

.theme-status-dot.ready {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.header-actions-group {
  display: flex;
  gap: 0.5rem;
}

.audio-btn {
  background: rgba(255, 209, 102, 0.15) !important;
  border-color: rgba(255, 209, 102, 0.4) !important;
  color: #ffd166 !important;
}

.return-btn {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

/* Container */
.reader-container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem 5rem;
}

.manga-frame {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* Banner Header */
.manga-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.banner-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
}

.banner-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.date-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--theme-gold);
}

/* Multi-Analyst Case Tabs */
.case-tabs-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.case-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.case-tab-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.case-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--theme-accent);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(230, 57, 70, 0.25);
}

/* Hero Artwork Box */
.hero-art-box {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: #000;
  margin-bottom: 2rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-art-box:hover {
  transform: scale(1.01);
  box-shadow: 0 0 25px rgba(230, 57, 70, 0.25);
}

.hero-art-box img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.zoom-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-not-ready {
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.hero-not-ready-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-not-ready-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.hero-not-ready-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Panels */
.panels-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.panel-row {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
}

.panel-tag-icon {
  width: 72px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.panel-tag-icon span {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--theme-gold);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.speech-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--theme-accent);
  border-radius: 12px;
  padding: 1.25rem;
}

.speech-box-header {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--theme-gold);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.verdict-speech-box {
  border-left-color: var(--theme-gold);
}

.verdict-body {
  color: #f1f5f9;
  font-size: 1rem;
  line-height: 1.7;
}

/* Stocks Section */
.stocks-verdict-container {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.stocks-verdict-container h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 1rem;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.stock-card-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stock-card-ticker {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #ffffff;
}

.stock-card-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.verdict-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.verdict-buy   { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.verdict-hold  { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.verdict-sell  { background: rgba(239, 68, 68, 0.2);  color: #ef4444; }
.verdict-watch { background: rgba(14, 165, 233, 0.2); color: #0ea5e9; }

/* Catchphrase Banner */
.catchphrase-banner {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--theme-accent);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
}

.catchphrase-banner h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  color: var(--theme-gold);
}

/* Today's in-character line, taken from the case's manga_script. Sits under
   the fixed catchphrase so the banner carries both the persona and the day. */
.catchphrase-banner #catchphrase-today {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.82);
}

.catchphrase-banner #catchphrase-today:empty {
  display: none;
}

/* Floating Audio Player HUD */
.floating-audio-hud {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(18, 24, 36, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 8px 16px 8px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.hud-disc {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-gold);
  font-size: 18px;
}

.hud-disc.spinning {
  animation: spinDisc 3s linear infinite;
}

@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hud-info {
  display: flex;
  flex-direction: column;
}

.hud-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.hud-status {
  font-size: 10px;
  color: var(--text-muted);
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--theme-accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.hud-btn:hover {
  transform: scale(1.1);
}

.hud-volume-slider {
  width: 60px;
  accent-color: var(--theme-accent);
  cursor: pointer;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  object-fit: contain;
}

.lightbox-close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #000;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .reader-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .panel-row {
    flex-direction: column;
  }
  .panel-tag-icon {
    width: 100%;
    flex-direction: row;
    gap: 6px;
    padding: 6px;
  }
  .floating-audio-hud {
    bottom: 12px;
    right: 12px;
    left: 12px;
    justify-content: space-between;
  }
}
