/* ============================================================
   PSYCHOLOGY PREP HUB — styles.css
   Premium Educational Interface
   ============================================================ */

/* ============================================================
   ROOT VARIABLES — DARK MODE (DEFAULT)
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-primary: #0d1117;
  --bg-secondary: #111827;
  --bg-tertiary: #161d2e;

  /* Surfaces */
  --surface: #1a2236;
  --surface-2: #1f2a40;
  --surface-3: #243047;
  --surface-glass: rgba(26, 34, 54, 0.75);
  --surface-hover: #263352;

  /* Text */
  --text-primary: #e8edf5;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0d1117;

  /* Accents */
  --accent: #7c9df5;
  --accent-soft: rgba(124, 157, 245, 0.12);
  --accent-hover: #93b1f8;
  --accent-2: #a78bfa;
  --accent-2-soft: rgba(167, 139, 250, 0.12);
  --accent-3: #67e8c4;
  --accent-3-soft: rgba(103, 232, 196, 0.1);

  /* Semantic colors */
  --color-memorize: #fbbf24;
  --color-memorize-soft: rgba(251, 191, 36, 0.1);
  --color-memorize-border: rgba(251, 191, 36, 0.3);
  --color-exam: #f472b6;
  --color-exam-soft: rgba(244, 114, 182, 0.1);
  --color-exam-border: rgba(244, 114, 182, 0.25);
  --color-quiz: #34d399;
  --color-quiz-soft: rgba(52, 211, 153, 0.08);
  --color-flashcard: #60a5fa;
  --color-flashcard-soft: rgba(96, 165, 250, 0.08);
  --color-cheatsheet: #a78bfa;
  --color-cheatsheet-soft: rgba(167, 139, 250, 0.08);

  /* Borders */
  --border: rgba(124, 157, 245, 0.12);
  --border-strong: rgba(124, 157, 245, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.05);

  /* Shadows */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 4px 24px rgba(124, 157, 245, 0.15);

  /* Lecture number badge gradients */
  --grad-1: linear-gradient(135deg, #7c9df5, #a78bfa);
  --grad-2: linear-gradient(135deg, #a78bfa, #f472b6);
  --grad-3: linear-gradient(135deg, #f472b6, #fb923c);
  --grad-4: linear-gradient(135deg, #fb923c, #fbbf24);
  --grad-5: linear-gradient(135deg, #34d399, #67e8c4);
  --grad-6: linear-gradient(135deg, #7c9df5, #34d399);
  --grad-7: linear-gradient(135deg, #a78bfa, #7c9df5);
  --grad-8: linear-gradient(135deg, #60a5fa, #34d399);
  --grad-9: linear-gradient(135deg, #f472b6, #a78bfa);
  --grad-10: linear-gradient(135deg, #fbbf24, #f472b6);

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 80px;
  --content-max: 900px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Typography */
  --font-display: "DM Serif Display", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "DM Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] {
  --bg-primary: #f0f4ff;
  --bg-secondary: #f8faff;
  --bg-tertiary: #eef2fc;

  --surface: #ffffff;
  --surface-2: #f3f6fd;
  --surface-3: #e8eef8;
  --surface-glass: rgba(255, 255, 255, 0.85);
  --surface-hover: #edf1fb;

  --text-primary: #1a2236;
  --text-secondary: #4b5a72;
  --text-muted: #7f8ea6;
  --text-inverse: #ffffff;

  --accent: #4a72e0;
  --accent-soft: rgba(74, 114, 224, 0.1);
  --accent-hover: #3560d0;
  --accent-2: #7c4dff;
  --accent-2-soft: rgba(124, 77, 255, 0.09);
  --accent-3: #00b894;
  --accent-3-soft: rgba(0, 184, 148, 0.09);

  --color-memorize: #d97706;
  --color-memorize-soft: rgba(217, 119, 6, 0.08);
  --color-memorize-border: rgba(217, 119, 6, 0.25);
  --color-exam: #db2777;
  --color-exam-soft: rgba(219, 39, 119, 0.07);
  --color-exam-border: rgba(219, 39, 119, 0.2);
  --color-quiz: #059669;
  --color-quiz-soft: rgba(5, 150, 105, 0.07);
  --color-flashcard: #2563eb;
  --color-flashcard-soft: rgba(37, 99, 235, 0.07);
  --color-cheatsheet: #7c3aed;
  --color-cheatsheet-soft: rgba(124, 58, 237, 0.07);

  --border: rgba(74, 114, 224, 0.14);
  --border-strong: rgba(74, 114, 224, 0.25);
  --border-subtle: rgba(0, 0, 0, 0.05);

  --shadow: 0 4px 20px rgba(30, 60, 140, 0.08);
  --shadow-sm: 0 2px 8px rgba(30, 60, 140, 0.07);
  --shadow-lg: 0 12px 40px rgba(30, 60, 140, 0.12);
  --shadow-accent: 0 4px 20px rgba(74, 114, 224, 0.15);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
.creator-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.creator-name {
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.creator-ig {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.creator-ig:hover {
  color: rgba(255, 255, 255, 0.85);
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.85em;
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--accent-hover); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

strong { color: var(--text-primary); font-weight: 600; }

em { font-style: italic; color: var(--text-secondary); }

ul, ol {
  list-style: none;
  padding: 0;
}

dl { padding: 0; }

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

details { cursor: pointer; }

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.site-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .site-header,
.site-body .site-header {
  background: rgba(13, 17, 23, 0.9);
}

[data-theme="light"] .site-header {
  background: rgba(248, 250, 255, 0.92);
}

.header-inner {
  max-width: calc(var(--sidebar-width) + var(--content-max) + 80px);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

.brand-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(124, 157, 245, 0.4));
  animation: brainPulse 4s ease-in-out infinite;
}

@keyframes brainPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(124, 157, 245, 0.35)); }
  50% { filter: drop-shadow(0 0 18px rgba(167, 139, 250, 0.55)); }
}

.site-title {
  font-size: 1.5rem;
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.site-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.header-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
  white-space: nowrap;
}

[data-badge="status"] {
  background: rgba(103, 232, 196, 0.12);
  color: var(--accent-3);
  border-color: rgba(103, 232, 196, 0.2);
}

[data-badge="level"] {
  background: var(--accent-2-soft);
  color: var(--accent-2);
  border-color: rgba(167, 139, 250, 0.2);
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
}

.nav-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}

.nav-toggle:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item { border-radius: var(--radius-sm); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-soft);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-link:hover::before { opacity: 1; }

.nav-link.active,
.nav-item.active .nav-link {
  color: var(--accent);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
}

.nav-number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  opacity: 0.7;
  min-width: 20px;
  flex-shrink: 0;
}

.nav-label {
  line-height: 1.35;
  font-size: 0.8rem;
}

.nav-quick-links {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.quick-links-title {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

.quick-links-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-link {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.quick-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  padding: 2.5rem 2rem;
  max-width: var(--content-max);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ============================================================
   SECTION HEADER (dashboard + reference sections)
   ============================================================ */
.section-header {
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.section-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  cursor: default;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity var(--transition);
}

.dashboard-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
}

.dashboard-card:hover::before { opacity: 1; }

.dashboard-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.1rem;
}

.dashboard-card-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.dashboard-card-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* Progress bar */
.progress-indicator {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lecture overview list */
.dashboard-lecture-overview {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.overview-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.overview-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  list-style: none;
  counter-reset: none;
  padding: 0;
}

.overview-item {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  line-height: 1.5;
}

.overview-item:hover { background: var(--accent-soft); }

.overview-item a {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   LECTURE SECTIONS
   ============================================================ */
.lecture-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Lecture Header */
.lecture-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.lecture-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
}

.lecture-number-badge {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  color: #fff;
  letter-spacing: -0.02em;
}

/* Per-lecture badge colors */
[data-lecture="1"] .lecture-number-badge { background: var(--grad-1); }
[data-lecture="2"] .lecture-number-badge { background: var(--grad-2); }
[data-lecture="3"] .lecture-number-badge { background: var(--grad-3); }
[data-lecture="4"] .lecture-number-badge { background: var(--grad-4); }
[data-lecture="5"] .lecture-number-badge { background: var(--grad-5); }
[data-lecture="6"] .lecture-number-badge { background: var(--grad-6); }
[data-lecture="7"] .lecture-number-badge { background: var(--grad-7); }
[data-lecture="8"] .lecture-number-badge { background: var(--grad-8); }
[data-lecture="9"] .lecture-number-badge { background: var(--grad-9); }
[data-lecture="10"] .lecture-number-badge { background: var(--grad-10); }

.lecture-header-text {
  position: relative;
  z-index: 1;
}

.lecture-title {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.lecture-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
}

/* ============================================================
   LECTURE BLOCKS (generic article containers)
   ============================================================ */
.lecture-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.lecture-block:hover {
  border-color: var(--border-strong);
}

.block-title {
  font-size: 1.05rem;
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.block-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 0.5rem;
}

/* ============================================================
   DEFINITION LISTS
   ============================================================ */
.definition-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.definition-item {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  transition: all var(--transition);
}

.definition-item:hover {
  border-color: var(--border);
  background: var(--surface-3);
}

.definition-term {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
  font-family: var(--font-body);
  margin-bottom: 0.35rem;
  display: block;
  letter-spacing: 0.01em;
}

.definition-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0;
}

/* ============================================================
   CONCEPT GRID & CARDS
   ============================================================ */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.concept-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.concept-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background: var(--surface-hover);
}

.concept-card-title {
  font-size: 0.9rem;
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.concept-card p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   SCHOLAR CARDS
   ============================================================ */
.scholars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.scholar-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.scholar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.scholar-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.scholar-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.scholar-dates {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

.scholar-contribution {
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.scholar-contribution strong { color: var(--accent); }

.scholar-theory {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   COMPARISON TABLES
   ============================================================ */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.comparison-table thead {
  background: var(--surface-2);
}

.comparison-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.comparison-table td {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  line-height: 1.6;
}

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

.comparison-table tbody tr {
  background: var(--surface);
  transition: background var(--transition);
}

.comparison-table tbody tr:nth-child(even) {
  background: var(--surface-2);
}

.comparison-table tbody tr:hover {
  background: var(--accent-soft);
}

.comparison-table td strong { color: var(--text-primary); }

.table-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

/* Master scholar table wrapper for horizontal scroll */
.master-scholar-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   NUMBERED & METHOD LISTS
   ============================================================ */
.numbered-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  list-style: none;
  counter-reset: num-counter;
  padding: 0;
}

.numbered-list .numbered-item,
.numbered-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  counter-increment: num-counter;
}

.numbered-list .numbered-item::before,
.numbered-list li::before {
  content: counter(num-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.method-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.method-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem 0.4rem 1rem;
  border-left: 2px solid var(--border-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.65;
  transition: border-color var(--transition), background var(--transition);
}

.method-list li:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.reflection-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
}

.reflection-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  line-height: 1.5;
}

.reflection-list li::before {
  content: '→ ';
  color: var(--accent);
  font-weight: 600;
}

.inner-list {
  padding-left: 1.1rem;
  list-style: decimal;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0.5rem 0;
}

.inner-list li::marker { color: var(--accent); }

/* ============================================================
   EXAMPLES GRID
   ============================================================ */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.example-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  transition: all var(--transition);
}

.example-card:hover {
  border-color: var(--accent-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.example-context-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 0.5rem;
}

.example-card p {
  font-size: 0.83rem;
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   CYCLE DIAGRAM
   ============================================================ */
.cycle-diagram {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

.cycle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  counter-reset: cycle-counter;
  padding: 0;
  align-items: center;
}

.cycle-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  counter-increment: cycle-counter;
  padding: 0.4rem 0.75rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin: 0.3rem;
  transition: all var(--transition);
}

.cycle-step::before {
  content: counter(cycle-counter);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.cycle-step:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.cycle-note, .process-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.75rem;
}

/* ============================================================
   MUST MEMORIZE BLOCKS
   ============================================================ */
.must-memorize {
  background: var(--color-memorize-soft);
  border: 1px solid var(--color-memorize-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.must-memorize::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-memorize), #fb923c);
}

.must-memorize .block-title {
  color: var(--color-memorize);
}

.must-memorize .block-title::after {
  background: var(--color-memorize-border);
}

.memorize-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.memorize-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: var(--color-memorize-soft);
  border: 1px solid var(--color-memorize-border);
  border-radius: var(--radius-sm);
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  transition: background var(--transition);
}

.memorize-list li:hover {
  background: rgba(251, 191, 36, 0.16);
}

.memorize-list li::before {
  content: '⭐';
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.memorize-list li strong { color: var(--color-memorize); }

/* ============================================================
   EXAM CHEAT SHEETS
   ============================================================ */
.exam-cheat-sheet {
  background: var(--color-cheatsheet-soft);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.exam-cheat-sheet .block-title {
  color: var(--color-cheatsheet);
}

.exam-cheat-sheet .block-title::after {
  background: rgba(167, 139, 250, 0.2);
}

.exam-cheat-sheet p {
  font-size: 0.875rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(167, 139, 250, 0.35);
  margin-bottom: 0.4rem;
  background: rgba(167, 139, 250, 0.04);
}

.exam-cheat-sheet p strong { color: var(--color-cheatsheet); }

/* ============================================================
   EXAM QUESTIONS
   ============================================================ */
.exam-questions {
  background: var(--color-exam-soft);
  border: 1px solid var(--color-exam-border);
  position: relative;
  overflow: hidden;
}

.exam-questions::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-exam), var(--accent-2));
}

.exam-questions .block-title {
  color: var(--color-exam);
}

.exam-questions .block-title::after {
  background: var(--color-exam-border);
}

.exam-question-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  counter-reset: q-counter;
  padding: 0;
}

.exam-question {
  background: var(--surface);
  border: 1px solid var(--color-exam-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  counter-increment: q-counter;
  position: relative;
}

.exam-question::before {
  content: 'Q' counter(q-counter);
  position: absolute;
  top: 0.75rem; right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-exam);
  background: var(--color-exam-soft);
  padding: 0.2rem 0.45rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
  border: 1px solid var(--color-exam-border);
}

.question-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.6;
  padding-right: 3rem;
}

/* ============================================================
   MODEL ANSWERS (details/summary)
   ============================================================ */
.model-answer {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.model-answer[open] {
  border-color: var(--accent);
}

.model-answer summary {
  padding: 0.6rem 1rem;
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--transition);
}

.model-answer summary::-webkit-details-marker { display: none; }

.model-answer summary::before {
  content: '▶';
  font-size: 0.55rem;
  transition: transform var(--transition);
  color: var(--accent);
}

.model-answer[open] summary::before { transform: rotate(90deg); }

.model-answer summary:hover { background: var(--accent-soft); }

.model-answer p {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--surface);
  margin: 0;
  border-top: 1px solid var(--border);
}

.model-answer p:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

/* ============================================================
   QUIZ CONTAINERS (placeholders)
   ============================================================ */
.quiz-container {
  background: var(--color-quiz-soft);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-style: dashed;
}

.quiz-container .block-title { color: var(--color-quiz); }

.quiz-container .block-title::after {
  background: rgba(52, 211, 153, 0.2);
}

.quiz-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.quiz-questions-wrapper {
  background: var(--surface-2);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-placeholder-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin: 0;
  line-height: 1.7;
}

.quiz-result-area {
  margin-top: 0.75rem;
  min-height: 20px;
  font-size: 0.85rem;
  color: var(--color-quiz);
}

/* ============================================================
   FLASHCARD SECTION & DECK
   ============================================================ */
.flashcard-section {
  background: var(--color-flashcard-soft);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-style: dashed;
}

.flashcard-section .block-title { color: var(--color-flashcard); }

.flashcard-section .block-title::after {
  background: rgba(96, 165, 250, 0.2);
}

.flashcard-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.flashcard-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.flashcard {
  aspect-ratio: 3/2;
  background: var(--surface-2);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 80px;
}

.flashcard:hover { transform: rotateY(180deg); }

.flashcard::before,
.flashcard::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: 0.78rem;
  line-height: 1.55;
}

.flashcard::before {
  content: attr(data-front);
  background: var(--surface-2);
  color: var(--text-primary);
  font-weight: 600;
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.flashcard::after {
  content: attr(data-back);
  background: var(--color-flashcard);
  color: #fff;
  transform: rotateY(180deg);
  font-size: 0.75rem;
  font-weight: 400;
}

.flashcard-placeholder-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin: 0.5rem 0 0;
}

/* ============================================================
   SUB-HEADINGS
   ============================================================ */
.sub-heading {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--accent);
  margin: 1.25rem 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sub-heading::before {
  content: '';
  display: block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
}

/* ============================================================
   KEY QUOTES
   ============================================================ */
.key-quote {
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.5rem;
  margin: 1.25rem 0;
}

.key-quote p {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.7;
  margin: 0 0 0.3rem;
}

.quote-source {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: normal;
  margin-top: 0.5rem;
  display: block;
}

.closing-quote {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
  border-color: var(--accent);
}

.closing-quote p {
  font-size: 1.05rem;
}

/* ============================================================
   COURSE CLOSING
   ============================================================ */
.course-closing {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
  border: 1px solid var(--border-strong);
}

/* ============================================================
   REFERENCE SECTIONS (Scholar Reference, Glossary)
   ============================================================ */
.reference-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   GLOSSARY GRID
   ============================================================ */
.glossary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.glossary-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
}

.glossary-item:hover {
  border-color: var(--border);
  background: var(--accent-soft);
}

.glossary-term {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.glossary-lecture {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.4rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  white-space: nowrap;
  font-weight: 600;
}

.glossary-def {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem;
}

.footer-inner {
  max-width: calc(var(--sidebar-width) + var(--content-max) + 80px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 2rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-icon { font-size: 1.5rem; line-height: 1; }

.footer-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
}

.footer-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.footer-note {
  font-size: 0.75rem !important;
  color: var(--text-muted);
  font-style: italic;
}

.footer-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
}

.footer-nav-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.2rem 0.45rem;
  border-radius: 100px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
  white-space: nowrap;
}

.footer-nav-link:hover {
  color: var(--accent);
  border-color: var(--border);
  background: var(--accent-soft);
}

.footer-quick-tools {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-tool-link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
  white-space: nowrap;
  display: block;
}

.footer-tool-link:hover {
  color: var(--accent);
  border-color: var(--border);
  background: var(--accent-soft);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Scroll-in reveal — applied by JS or native CSS scroll-driven */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lecture-section,
.dashboard,
.reference-section {
  animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Stagger lecture sections */
.lecture-section:nth-of-type(1) { animation-delay: 0.05s; }
.lecture-section:nth-of-type(2) { animation-delay: 0.08s; }
.lecture-section:nth-of-type(3) { animation-delay: 0.1s; }

/* Focus states for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Smooth card hover pulse */
@keyframes cardPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 157, 245, 0); }
  50% { box-shadow: 0 0 0 4px rgba(124, 157, 245, 0.1); }
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1100px) {
  :root {
    --sidebar-width: 240px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .site-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.sidebar-open {
    display: block;
  }

  .main-content {
    padding: 1.5rem 1.25rem;
    max-width: 100%;
  }

  .lecture-header {
    padding: 1.25rem;
  }

  .lecture-number-badge {
    min-width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .comparison-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .concept-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .header-inner {
    padding: 0 1rem;
  }

  .header-meta {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }

  .header-inner { height: 64px; }

  .brand-text .site-subtitle { display: none; }

  .site-title { font-size: 1.2rem; }

  .brand-icon { font-size: 1.5rem; }

  .main-content {
    padding: 1rem 0.875rem;
    gap: 2rem;
  }

  .lecture-block {
    padding: 1.25rem;
  }

  .dashboard {
    padding: 1.25rem;
  }

  .reference-section {
    padding: 1.25rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .dashboard-card {
    padding: 0.85rem 0.5rem;
  }

  .dashboard-card-value {
    font-size: 1.35rem;
  }

  .concept-grid,
  .examples-grid {
    grid-template-columns: 1fr;
  }

  .flashcard-deck {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-quick-tools {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .overview-list { gap: 0.2rem; }

  .glossary-item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .glossary-def {
    grid-column: 1 / -1;
    padding-top: 0.1rem;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .site-header,
  .quiz-container,
  .flashcard-section,
  .nav-toggle {
    display: none !important;
  }

  .site-layout {
    grid-template-columns: 1fr;
  }

  .lecture-block {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a { color: inherit; }

  .must-memorize {
    background: #fffbea;
    border: 1px solid #f59e0b;
  }

  .exam-questions {
    background: #fff5f8;
    border: 1px solid #ec4899;
  }
}
