/**
 * AVIHPSAM - Topic Page Styles
 * Modern documentation style - clean, readable, study portal
 */

/* ============================================
   DESIGN TOKENS - Topic Page Specific
   ============================================ */

.topic-layout {
  --content-max-width: 720px;
  --section-spacing: 1.75rem;
  --content-line-height: 1.7;
}

/* ============================================
   TOPIC PAGE LAYOUT - Sidebar + Content
   ============================================ */

.topic-layout {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  background: #fff;
}

/* ============================================
   TOPIC SIDEBAR - Left ToC Panel
   ============================================ */

.topic-sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: var(--space-xl) var(--space-lg);
  position: sticky;
  top: 60px;
  height: fit-content;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  border-right: 1px solid var(--color-border-light);
  background: #fafbfc;
}

.toc-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
}

.toc-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin: 2px 0;
}

.toc-link {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--color-primary);
  background: rgba(30, 64, 175, 0.06);
}

.toc-link.active {
  color: var(--color-primary);
  background: rgba(30, 64, 175, 0.1);
  font-weight: 500;
}

.toc-separator {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-sm) 0;
}

/* Related Topics in Sidebar */
.toc-related {
  margin-top: var(--space-md);
}

.toc-related-header {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.toc-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-related-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-light);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.toc-related-link:hover {
  color: var(--color-accent);
  background: var(--color-background-alt);
}

.toc-related-link::before {
  content: "→";
  opacity: 0.5;
}

/* ============================================
   TOPIC CONTENT - Right Panel
   ============================================ */

.topic-content {
  flex-grow: 1;
  min-width: 0;
  padding: var(--space-xl) 0;
  background: #fff;
}

/* Content sections within sidebar layout - Compact spacing */
.topic-content .content-section {
  max-width: var(--content-max-width, 720px);
  padding: var(--section-spacing, 1.5rem) var(--space-xl);
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
}

.topic-content .content-section:last-of-type {
  border-bottom: none;
}

/* Typography within content sections */
.topic-content p {
  font-size: 1rem;
  line-height: var(--content-line-height, 1.7);
  color: #334155;
  margin-bottom: 1em;
}

.topic-content p:last-child {
  margin-bottom: 0;
}

/* Hero Section - Clean & Minimal */
.topic-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  padding: 2rem 0;
}

/* Flagged topic hero - red theme */
.topic-hero.topic-hero-flagged {
  background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
}

.topic-hero-flagged .flagged-warning {
  background: rgba(255, 255, 255, 0.1);
  border-left: 3px solid #fca5a5;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
}

.topic-hero-flagged .flagged-warning p {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.95;
}

.topic-hero-flagged .flagged-warning p:first-child {
  margin-bottom: 4px;
}

.topic-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.topic-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 8px;
}

.topic-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.2;
  color: #fff;
  letter-spacing: -0.02em;
}

/* Tier badge in hero - white with subtle background */
.topic-hero .tier-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 11px;
  padding: 4px 10px;
}

.topic-subtitle {
  font-size: 1.125rem;
  opacity: 0.85;
  margin-bottom: 12px;
  font-weight: 400;
}

.topic-question {
  display: none; /* Hide the Sanskrit question - too cluttered */
}

/* Key Stats - Single line with separators */
.key-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  opacity: 0.85;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item:first-child {
  padding-left: 0;
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-size: 0.875rem;
  font-weight: 600;
  display: inline;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
  display: inline;
}

.stat-label::before {
  content: ": ";
  display: none;
}

/* Content sections - Compact spacing */
.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
}

.section-header {
  margin-bottom: var(--space-md);
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.3;
}

.section-header p {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Evidence box - Clean callout style */
.evidence-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.evidence-box h3 {
  color: #166534;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.evidence-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.evidence-list li {
  padding: 6px 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #334155;
}

.evidence-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: 600;
}

/* Pramana Section - Clean list style */
.pramana-section-intro {
  text-align: left;
  margin: 0 0 1.25rem;
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.pramana-section-intro a {
  color: var(--color-primary);
  text-decoration: none;
}

.pramana-section-intro a:hover {
  text-decoration: underline;
}

.pramana-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.pramana-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.pramana-item.primary {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.pramana-item-header {
  min-width: 140px;
  flex-shrink: 0;
}

.pramana-item-header .sanskrit {
  font-size: 0.9375rem;
  color: #1e40af;
  font-family: var(--font-sanskrit);
  display: block;
  margin-bottom: 2px;
}

.pramana-item-header .name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
}

.pramana-item-header .badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-full);
  margin-left: var(--space-xs);
  text-transform: uppercase;
}

.pramana-item-content {
  flex-grow: 1;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}

/* Legacy card styles for backwards compatibility */
.pramana-cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.pramana-visual-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  background: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  text-align: left;
  border-left: 3px solid var(--color-border);
}

.pramana-visual-card:hover {
  background: var(--color-background-alt);
}

.pramana-visual-card.primary {
  border-left-color: var(--color-accent);
  background: rgba(46, 90, 76, 0.03);
}

.pramana-visual-card .sanskrit-large {
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-family: var(--font-sanskrit);
  min-width: 60px;
}

.pramana-visual-card h4 {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
  min-width: 80px;
}

.pramana-visual-card .pramana-meaning {
  display: none;
}

.pramana-visual-card .pramana-description {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
  flex-grow: 1;
}

.pramana-visual-card .pramana-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-full);
  margin-left: var(--space-xs);
  text-transform: uppercase;
}

.pramana-visual-card .pramana-example {
  display: none;
}

.pramana-explanation-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 1px 6px rgba(245, 158, 11, 0.1);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
}

.pramana-explanation-box h4 {
  color: #b45309;
  font-size: var(--text-sm);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.pramana-explanation-box p {
  font-size: var(--text-xs);
  line-height: 1.6;
}

/* Legacy pramana-box for backwards compatibility */
.pramana-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 2px 16px rgba(245, 158, 11, 0.12);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.pramana-box h3 {
  color: #b45309;
  margin-bottom: var(--space-sm);
  font-size: var(--text-md);
}

.pramana-box p,
.pramana-box li {
  font-size: var(--text-sm);
}

.pramana-box ul {
  margin-top: var(--space-sm);
  margin-left: var(--space-md);
}

/* Gaps box - Research Gaps Callout */
.gaps-box {
  background: #ffffff;
  border: 1px solid #fecaca;
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  padding: 0.875rem 1rem;
}

.gaps-box h3 {
  color: #dc2626;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gaps-box h3::before {
  content: "⚠";
  font-size: 0.875rem;
}

.gaps-box li {
  font-size: 0.875rem;
  margin-bottom: 4px;
  line-height: 1.5;
  color: #475569;
}

.gaps-box li:last-child {
  margin-bottom: 0;
}

.gaps-box ul {
  margin-left: 1rem;
  list-style-type: disc;
}

/* Source cards - Clean List Layout */
.sources-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-card {
  background: #ffffff;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.source-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.source-card h4 {
  margin-bottom: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
}

.source-meta {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 8px;
}

.source-card p {
  font-size: 0.875rem;
  margin-top: 8px;
  line-height: 1.6;
  color: #475569;
}

.source-type {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.source-type.textual {
  background: #eff6ff;
  color: #1e40af;
}

.source-type.archaeological {
  background: #fffbeb;
  color: #b45309;
}

.source-type.peer-reviewed {
  background: #f0fdf4;
  color: #166534;
}

.source-type.inscription {
  background: #fdf2f8;
  color: #9d174d;
}

.source-type.manuscript {
  background: #faf5ff;
  color: #7c3aed;
}

.source-quote {
  font-style: italic;
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: #475569;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 0 8px 8px 0;
}

/* Personalities / Key Figures - Carousel Layout with Subtle Background */
.content-section:has(.personalities-carousel-wrapper) {
  background: #f8fafc;
  border-radius: 0;
  /* margin-left: calc(-1 * var(--space-xl));
  margin-right: calc(-1 * var(--space-xl)); */
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

.personalities-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.personalities-carousel {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--space-xs) 0;
  flex: 1;
}

.personalities-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  background: white;
  border-radius: 50%;
  font-size: var(--text-lg);
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background: var(--color-background-alt);
  color: var(--color-text);
  border-color: var(--color-accent);
}

.personality-card {
  flex-shrink: 0;
  width: 280px;
  padding: var(--space-sm) var(--space-md);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border-light);
  transition: all 0.2s ease;
}

.personality-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-accent);
}

.personality-card-content {
  min-width: 0;
}

.personality-card-header {
  margin-bottom: var(--space-xs);
}

.personality-card-header .sanskrit {
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-family: var(--font-sanskrit);
  line-height: 1.2;
}

.personality-card-header h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

.personality-card-header .period {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--color-text-light);
  background: var(--color-background-alt);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.personality-card-content p {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Load more section */
.personalities-load-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

.personalities-count {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.btn-load-more {
  font-size: var(--text-xs);
  color: var(--color-accent);
  background: none;
  border: 1px solid var(--color-accent);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-load-more:hover {
  background: var(--color-accent);
  color: white;
}

.personalities-carousel.expanded .personality-card {
  flex: 1 1 280px;
  max-width: 320px;
}

@media (max-width: 600px) {
  .carousel-btn {
    display: none;
  }

  .personality-card {
    width: 240px;
  }
}

/* Timeline - Clean Vertical Design */
.timeline-wrapper {
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-accent), #e2e8f0);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 1rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 0 3px rgba(46, 90, 76, 0.1);
}

.timeline-item:first-child::before {
  background: var(--color-accent);
}

.timeline-date {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-accent);
  margin-bottom: 2px;
  display: inline-block;
  background: rgba(46, 90, 76, 0.08);
  padding: 1px 8px;
  border-radius: 3px;
}

.timeline-content {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569;
}

/* Evolution Diagram - Clean Horizontal Flow */
.evolution-diagram {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.evolution-stage {
  flex: 1;
  min-width: 140px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 1.25rem 1rem;
  border-radius: 8px;
  transition: border-color 0.2s ease;
}

.evolution-stage:hover {
  border-color: var(--color-accent);
}

.evolution-icon {
  font-size: 1.75rem;
  margin-bottom: 8px;
  display: block;
}

.evolution-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-primary);
}

.evolution-desc {
  font-size: 0.8125rem;
  margin-top: 6px;
  color: #64748b;
  line-height: 1.5;
}

.evolution-arrow {
  font-size: 1.25rem;
  color: #94a3b8;
  align-self: center;
  flex-shrink: 0;
}

/* Debate boxes - Clean Card Layout */
.debates-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debate-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s ease;
}

.debate-box:hover {
  border-color: #94a3b8;
}

.debate-box-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9375rem;
  color: var(--color-primary);
}

.debate-positions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debate-position {
  background: #f1f5f9;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8125rem;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Inquiry cards - Clean Question List */
.inquiry-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inquiry-card {
  background: #ffffff;
  color: var(--color-text);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.inquiry-card:hover {
  border-color: #818cf8;
  background: #faf5ff;
}

.inquiry-card h4 {
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4f46e5;
  font-family: var(--font-heading);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.inquiry-card h4::before {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.inquiry-card p {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #64748b;
  font-family: var(--font-body);
  margin-left: 24px;
}

/* Resources grid - Clean List */
.resources-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.resource-link:hover {
  border-color: var(--color-accent);
  background: #f8fafc;
}

.resource-link-icon {
  font-size: 1.25rem;
  opacity: 0.8;
}

.resource-link-text {
  flex: 1;
  min-width: 0;
}

.resource-link-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.resource-link-source {
  font-size: 0.8125rem;
  color: #64748b;
}

.resource-link-external {
  opacity: 0.4;
  font-size: 0.875rem;
}

/* CTA - Clean Call to Action */
.topic-chat-cta {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  margin-top: 2.5rem;
  border: 1px solid #e2e8f0;
}

.topic-chat-cta h3 {
  margin-bottom: 8px;
  font-size: 1.125rem;
  color: var(--color-primary);
}

.topic-chat-cta p {
  color: #64748b;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

/* Method cards - Clean Card Layout */
.method-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.method-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

.method-card:hover {
  border-color: var(--color-accent);
}

.method-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--color-accent);
  font-size: 1rem;
}

.method-card h3 span {
  font-size: 1.125rem;
}

.method-sanskrit {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 8px;
  font-family: var(--font-sanskrit);
}

.method-card p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #475569;
}

.method-example {
  background: #f8fafc;
  padding: 12px;
  border-radius: 6px;
  margin-top: 12px;
  font-family: monospace;
  font-size: 0.8125rem;
  border: 1px solid #e2e8f0;
}

/* Relevance - Consolidated Green Box with Bullet Points */
.relevance-overview {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 0.75rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
}

.relevance-list {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.relevance-item {
  padding: 0.375rem 0;
  padding-left: 1.25rem;
  background: transparent;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(34, 197, 94, 0.15);
  position: relative;
}

.relevance-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.relevance-item:first-child {
  padding-top: 0;
}

.relevance-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.4;
}

.relevance-item:hover {
  border-color: rgba(34, 197, 94, 0.15);
}

.relevance-item-header {
  display: inline;
  gap: 0;
  margin-bottom: 0;
}

.relevance-icon {
  display: none;
}

.relevance-item-header strong {
  font-size: 0.9rem;
  color: #166534;
  font-weight: 600;
}

.relevance-item p {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
  display: inline;
}

.relevance-item p::before {
  content: " — ";
  color: #94a3b8;
}

.relevance-example {
  display: block;
  margin-top: 4px !important;
  padding-top: 0;
  border-top: none;
  color: #64748b !important;
  font-size: 0.8125rem;
  margin-left: 0;
}

.relevance-example::before {
  display: none;
}

.example-label {
  font-weight: 600;
  color: var(--color-accent);
}

/* Legacy relevance cards */
.relevance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-sm);
}

.relevance-card {
  background: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--color-accent);
}

.relevance-card h4 {
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm);
}

.relevance-card p {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.5;
}

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: var(--text-sm);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

.comparison-table th {
  background: var(--color-background-alt);
  font-weight: 600;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--color-border-light);
}

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

.comparison-table tbody tr:hover {
  background: var(--color-background-alt);
}

/* Responsive */
@media (max-width: 768px) {
  .key-stats {
    justify-content: center;
  }

  .topic-title {
    font-size: var(--text-xl);
  }

  .evolution-diagram {
    flex-direction: column;
  }

  .evolution-arrow {
    transform: rotate(90deg);
  }
}

/* ============================================
   TOPIC SIDEBAR - Mobile Responsive
   ============================================ */

@media (max-width: 1024px) {
  .topic-layout {
    flex-direction: column;
  }

  .topic-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    max-height: none;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-background-alt);
  }

  .toc-header {
    display: none;
  }

  .toc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .toc-link {
    padding: var(--space-xs) var(--space-sm);
    border-left: none;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    background: white;
  }

  .toc-link.active {
    background: var(--color-accent);
    color: white;
    border-left: none;
  }

  .toc-link:hover {
    background: var(--color-border);
  }

  .toc-separator {
    display: none;
  }

  .toc-related {
    display: none;
  }

  .topic-content {
    width: 100%;
  }

  .topic-content .content-section {
    padding: var(--space-md);
    padding-left: var(--space-md);
  }
}

/* Mobile ToC toggle */
.toc-mobile-toggle {
  display: none;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-background-alt);
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.toc-mobile-toggle::after {
  content: " ▼";
  float: right;
  opacity: 0.5;
}

.toc-mobile-toggle.expanded::after {
  content: " ▲";
}

@media (max-width: 768px) {
  .toc-mobile-toggle {
    display: block;
  }

  .topic-sidebar {
    padding: 0;
  }

  .topic-sidebar .toc-nav {
    display: none;
    padding: var(--space-sm) var(--space-md);
  }

  .topic-sidebar.expanded .toc-nav {
    display: flex;
  }
}

/* ============================================
   KNOWLEDGE DASHBOARD - New Layout
   ============================================ */

/* Evolution Journey - Full Width Visual Timeline */
.evolution-journey {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: var(--space-xl) var(--space-lg);
  margin: 0;
}

.evolution-journey-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.evolution-journey-title {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.evolution-journey-title h2 {
  font-size: var(--text-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.evolution-journey-title p {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.evolution-stages {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  position: relative;
}

.evolution-stage-card {
  flex: 1;
  max-width: 320px;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.evolution-stage-card:hover {
  transform: translateY(-4px);
}

/* Seed Stage - Earth tones */
.evolution-stage-card.seed {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.15);
}

.evolution-stage-card.seed .stage-icon {
  color: #b45309;
}

/* Growth Stage - Green tones */
.evolution-stage-card.growth {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.evolution-stage-card.growth .stage-icon {
  color: #047857;
}

/* Fruit Stage - Gold/Amber tones */
.evolution-stage-card.fruit {
  background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%);
  box-shadow: 0 4px 20px rgba(202, 138, 4, 0.2);
}

.evolution-stage-card.fruit .stage-icon {
  color: #a16207;
}

.stage-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.stage-sanskrit {
  font-family: var(--font-sanskrit);
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

.stage-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.stage-description {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
}

/* Arrow connectors between stages */
.evolution-arrow-connector {
  display: flex;
  align-items: center;
  padding: 0 var(--space-sm);
  font-size: 2rem;
  color: var(--color-text-light);
  opacity: 0.5;
}

/* Dashboard with Video Sidebar Layout */
.dashboard-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-lg);
  max-width: calc(var(--max-width) + 340px);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.dashboard-main {
  min-width: 0; /* Prevent grid blowout */
}

.dashboard-sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

@media (max-width: 1200px) {
  .dashboard-with-sidebar {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    max-height: none;
    order: -1; /* Move videos above content on mobile */
    margin-bottom: var(--space-lg);
  }
}

/* Dashboard Cards Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Card Base */
.dashboard-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.dashboard-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-background-alt);
}

.dashboard-card-icon {
  font-size: 1.5rem;
}

.dashboard-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-primary);
}

.dashboard-card-content {
  padding: var(--space-lg);
  flex-grow: 1;
}

.dashboard-card-footer {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-background-alt);
  font-size: var(--text-xs);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Process Steps */
.process-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.process-step {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.process-step:last-child {
  border-bottom: none;
}

.process-step-number {
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  flex-shrink: 0;
}

.process-step-content {
  flex-grow: 1;
}

.process-step-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-primary);
  margin-bottom: 2px;
}

.process-step-desc {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.5;
}

/* Resources Card Specific Styles */
.resources-section {
  margin-bottom: var(--space-md);
}

.resources-section:last-child {
  margin-bottom: 0;
}

.resources-section-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.resources-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.resource-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-background-alt);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text);
  border: 1px solid var(--color-border-light);
}

.resource-tag.material {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.resource-tag.tool {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.resource-tag.skill {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* Time Period Card Specific Styles */
.time-period-main {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.time-period-dates {
  flex-grow: 1;
}

.time-period-origin {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
}

.time-period-peak {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.time-period-location {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.time-period-spread {
  margin-top: var(--space-sm);
}

.time-period-spread-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.spread-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.spread-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-background-alt);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text);
}

/* Modern Parallel Card - Enhanced */
.modern-parallel-card {
  border-left: 4px solid var(--color-accent);
}

.modern-comparison {
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.modern-caveat {
  background: #fffbeb;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: #b45309;
  margin-bottom: var(--space-md);
}

.modern-differences-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.modern-differences-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modern-differences-list li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.modern-differences-list li::before {
  content: "≠";
  position: absolute;
  left: 0;
  color: #ef4444;
  font-weight: bold;
}

/* Full Width Cards */
.dashboard-card.full-width {
  grid-column: 1 / -1;
}

/* Collapsible Sections */
.collapsible-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-background-alt);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.collapsible-header:hover {
  background: var(--color-border-light);
}

.collapsible-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: var(--text-md);
}

.collapsible-count {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  font-weight: normal;
}

.collapsible-toggle {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  transition: transform 0.2s ease;
}

.collapsible-section.expanded .collapsible-toggle {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  padding: var(--space-lg);
  background: white;
}

.collapsible-section.expanded .collapsible-content {
  display: block;
}

/* Evolution Journey Responsive */
@media (max-width: 900px) {
  .evolution-stages {
    flex-direction: column;
    align-items: center;
  }

  .evolution-stage-card {
    max-width: 100%;
    width: 100%;
  }

  .evolution-arrow-connector {
    transform: rotate(90deg);
    padding: var(--space-xs) 0;
  }
}
