/* ==========================================================================
   NOVEL STUDY HUB — The Life Changer & Sweet Sixteen
   ========================================================================== */

/* ── Wrapper ──────────────────────────────────────────────────────────── */
.novel-hub-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── Top Bar ─────────────────────────────────────────────────────────── */
.novel-hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.novel-hub-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.novel-back-btn {
  gap: 0.4rem;
  color: var(--text-secondary);
}

.novel-back-btn:hover {
  color: var(--text-primary);
}

/* ── Novel Hero Section ──────────────────────────────────────────────── */
.novel-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
}

.novel-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 70% at 0% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Book cover illustration */
.book-cover {
  width: 120px;
  height: 170px;
  position: relative;
  border-radius: 4px 8px 8px 4px;
  box-shadow: 4px 6px 20px rgba(0,0,0,0.35), inset -3px 0 6px rgba(0,0,0,0.2);
  flex-shrink: 0;
  transform: perspective(400px) rotateY(-5deg);
  transition: transform 0.3s ease;
  cursor: default;
}

.book-cover:hover {
  transform: perspective(400px) rotateY(-12deg);
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(180deg, #047857, #065f46);
  border-radius: 4px 0 0 4px;
}

.book-front {
  position: absolute;
  left: 14px;
  right: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(160deg, #065f46 0%, #047857 40%, #059669 70%, #10b981 100%);
  border-radius: 0 8px 8px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem 0.6rem 0;
  overflow: hidden;
}

.book-front::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 8px,
    rgba(255,255,255,0.03) 8px,
    rgba(255,255,255,0.03) 9px
  );
}

.book-title-area {
  position: relative;
  z-index: 1;
}

.book-star {
  font-size: 0.5rem;
  color: rgba(209, 250, 229, 0.7);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.book-front h2 {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ecfdf5;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.book-front p {
  font-size: 0.58rem;
  color: rgba(209, 250, 229, 0.75);
  font-style: italic;
}

.book-bottom-band {
  background: rgba(0,0,0,0.3);
  margin: 0 -0.6rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.5rem;
  color: rgba(209, 250, 229, 0.65);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Hero Info */
.novel-hero-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.novel-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  width: fit-content;
}

.novel-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.1;
}

.novel-hero-author {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.novel-hero-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
}

.novel-hero-stats {
  display: flex;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.novel-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.novel-stat-n {
  font-size: 1.25rem;
  font-weight: 800;
  color: #10b981;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.novel-stat-l {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.novel-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.novel-quiz-btn {
  gap: 0.5rem;
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.novel-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.novel-tabs::-webkit-scrollbar { display: none; }

.novel-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.novel-tab:hover {
  color: var(--text-primary);
  background: var(--surface-highlight);
}

.novel-tab.active {
  color: var(--text-primary);
  background: var(--surface-base);
  box-shadow: var(--shadow-sm);
}

/* ── Tab Content Area ────────────────────────────────────────────────── */
.novel-tab-content {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
}

.novel-content-section {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── Summary Tab ─────────────────────────────────────────────────────── */
.novel-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.novel-overview-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nov-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nov-card-icon {
  font-size: 1.25rem;
}

.nov-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.novel-overview-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.nov-facts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.nov-facts-list li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.nov-facts-list li span {
  color: var(--text-tertiary);
  font-weight: 600;
  min-width: 110px;
  flex-shrink: 0;
}

.nov-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Storyline cards */
.storyline-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.storyline-card {
  display: flex;
  gap: 1.25rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.15s;
}

.storyline-card:hover {
  border-color: var(--border-medium);
}

.storyline-red { border-left: 3px solid #ef4444; }
.storyline-green { border-left: 3px solid #10b981; }
.storyline-amber { border-left: 3px solid #f59e0b; }

.storyline-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
}

.storyline-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.storyline-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.storyline-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.storyline-lesson {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.storyline-lesson strong {
  color: var(--text-secondary);
}

/* ── Characters Tab ──────────────────────────────────────────────────── */
.characters-intro, .themes-intro, .pastqs-intro, .ss-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.characters-intro h3, .themes-intro h3, .pastqs-intro h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.characters-intro p, .themes-intro p, .pastqs-intro p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.character-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, transform 0.15s;
}

.character-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.char-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-left: 0.75rem;
}

.char-emoji {
  font-size: 1.5rem;
}

.char-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.char-role {
  font-size: 0.78rem;
  font-weight: 600;
}

.char-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.trait-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.char-significance {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  background: var(--canvas-bg);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  line-height: 1.5;
  border: 1px solid var(--border-subtle);
}

.char-significance strong {
  color: #10b981;
}

/* ── Themes Tab ───────────────────────────────────────────────────────── */
.themes-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.theme-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border-left: 3px solid var(--theme-color, #10b981);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.15s;
}

.theme-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--theme-color, #10b981);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-icon { font-size: 1.1rem; }

.theme-card h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.theme-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.theme-examples-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-examples {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.theme-examples li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-left: 0.25rem;
}

/* ── Past Questions Accordion ────────────────────────────────────────── */
.novel-pastqs-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.accordion-item {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  gap: 1rem;
  transition: background 0.12s;
}

.accordion-trigger:hover {
  background: var(--surface-highlight);
}

.acc-trigger-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.acc-year-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.acc-q-count {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

.acc-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

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

.accordion-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.accordion-item.open .accordion-body {
  display: flex;
}

/* Individual question card */
.novel-q-card {
  background: var(--canvas-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.novel-q-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.novel-q-num span {
  color: #10b981;
  text-transform: none;
  letter-spacing: 0;
}

.novel-q-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.65;
  font-weight: 500;
}

.novel-q-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.novel-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  background: var(--surface-elevated);
}

.novel-opt:hover {
  border-color: var(--border-medium);
  background: var(--surface-highlight);
}

.novel-opt.opt-correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.novel-opt.opt-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.07);
}

.novel-opt .opt-key {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--canvas-bg);
  border: 1.5px solid var(--border-medium);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.novel-opt.opt-correct .opt-key {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.novel-opt.opt-wrong .opt-key {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.novel-opt .opt-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.novel-q-explanation {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  animation: fadeIn 0.2s ease;
}

.novel-q-explanation .explanation-title {
  font-weight: 700;
  color: #10b981;
  margin-bottom: 0.4rem;
}

/* ── Sweet Sixteen Tab ───────────────────────────────────────────────── */
.ss-hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--canvas-bg) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border-left: 3px solid #3b82f6;
}

.ss-book-cover {
  width: 90px;
  height: 130px;
  background: linear-gradient(160deg, #1e3a8a 0%, #1d4ed8 50%, #3b82f6 100%);
  border-radius: 4px 8px 8px 4px;
  box-shadow: 4px 6px 16px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: perspective(400px) rotateY(-5deg);
  transition: transform 0.3s;
  cursor: default;
}

.ss-book-cover:hover {
  transform: perspective(400px) rotateY(-12deg);
}

.ss-book-inner {
  text-align: center;
  padding: 0.75rem 0.5rem;
}

.ss-book-label {
  font-size: 0.45rem;
  color: rgba(219, 234, 254, 0.6);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.ss-book-inner h3 {
  font-size: 0.7rem;
  font-weight: 800;
  color: #eff6ff;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.ss-book-inner p {
  font-size: 0.52rem;
  color: rgba(219, 234, 254, 0.7);
  font-style: italic;
}

.ss-tag {
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 600;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.ss-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.ss-author {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ss-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
}

.ss-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.ss-fact {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--surface-highlight);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.ss-fact span {
  color: var(--text-tertiary);
  font-weight: 600;
  margin-right: 0.3rem;
}

.ss-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

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

.ss-char-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ss-char-emoji {
  font-size: 1.75rem;
}

.ss-char-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ss-char-card p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ss-themes {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ss-theme {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ss-theme span {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .novel-hub-wrapper {
    padding: 1rem;
    gap: 1.25rem;
  }

  .novel-hero {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .novel-hero-book {
    display: none;
  }

  .novel-hero-title {
    font-size: 1.6rem;
  }

  .novel-hero-stats {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .novel-overview-grid {
    grid-template-columns: 1fr;
  }

  .characters-grid {
    grid-template-columns: 1fr;
  }

  .ss-hero-card {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .ss-book-mini {
    display: none;
  }

  .novel-content-section {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .novel-hero-title {
    font-size: 1.3rem;
  }

  .novel-hero-actions {
    flex-direction: column;
  }

  .novel-hero-actions button {
    width: 100%;
    justify-content: center;
  }

  .storyline-card {
    flex-direction: column;
    gap: 0.75rem;
  }
}
