/* ============================================================
   QUANTUM CODEX — Component Library & Design System
   ============================================================ */

/* ──────────────────────────────────────────
   TYPOGRAPHY SCALES & HELPERS
   ────────────────────────────────────────── */
.qc-text-caption { font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.02em; }
.qc-text-equation { font-family: 'Times New Roman', serif; font-size: 1.25rem; font-style: italic; letter-spacing: 0.05em; }
.qc-text-reference { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* ──────────────────────────────────────────
   1. CONTENT COMPONENTS
   ────────────────────────────────────────── */

/* Base Semantic Card */
.qc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  position: relative;
  overflow: hidden;
  transition: all var(--dur-base) var(--ease-smooth);
}

/* Information Card (Info) */
.qc-card-info {
  border-left: 4px solid var(--color-info);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.05) 0%, transparent 100%), var(--bg-card);
}

/* Definition Card */
.qc-card-definition {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-accent);
}
.qc-card-definition .def-term { font-weight: 700; color: var(--accent-cyan); display: block; margin-bottom: 8px; }

/* Concept Card */
.qc-card-concept {
  border-top: 4px solid var(--accent-indigo);
}

/* Insight Card */
.qc-card-insight {
  background: linear-gradient(135deg, rgba(124, 107, 255, 0.1) 0%, rgba(224, 64, 251, 0.05) 100%), var(--bg-card);
  border: 1px solid rgba(124, 107, 255, 0.2);
}

/* Key Takeaway Panel (Success) */
.qc-takeaway-panel {
  border-left: 4px solid var(--color-success);
  background: rgba(0, 255, 157, 0.05);
}
.qc-takeaway-panel::before { content: '✓'; color: var(--color-success); font-weight: bold; position: absolute; left: 12px; top: 24px; }

/* Warning / Misconception Card */
.qc-warning-card {
  border: 1px solid rgba(255, 74, 74, 0.3);
  background: rgba(255, 74, 74, 0.05);
}
.qc-warning-card h4 { color: var(--color-error); }

/* Real-World Application Card */
.qc-realworld-card {
  border-left: 4px solid var(--color-warning);
  background: rgba(255, 184, 48, 0.05);
}

/* Historical Timeline Block */
.qc-timeline {
  border-left: 2px solid var(--border-soft);
  margin-left: 16px;
  padding-left: 32px;
  position: relative;
  margin-bottom: 40px;
}
.qc-timeline::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-void);
  border: 2px solid var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}
.qc-timeline-year { font-family: var(--font-mono); color: var(--accent-cyan); font-weight: 700; margin-bottom: 8px; }

/* Equation Container */
.qc-equation-container {
  padding: 32px;
  margin: 32px 0;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* Reference & Citation Block */
.qc-reference-block {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

/* Summary Section */
.qc-summary-section {
  padding: 48px;
  background: var(--bg-deep);
  border-radius: var(--radius-lg);
  text-align: center;
  margin-top: 64px;
}


/* ──────────────────────────────────────────
   2. LEARNING COMPONENTS
   ────────────────────────────────────────── */

/* Hero Section */
.qc-lesson-hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--section-pad-y) var(--section-pad-x);
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.1) 0%, transparent 60%);
}

/* Interactive Demonstration Container */
.qc-demo-container {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-accent);
  box-shadow: var(--glow-cyan);
  margin: 40px 0;
}

/* Simulation Launch Card */
.qc-sim-launch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(90deg, var(--bg-card), var(--bg-card-hover));
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
}

/* Previous / Next Lesson Navigation */
.qc-lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}
.qc-lesson-nav-btn {
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  transition: all var(--dur-fast) ease;
  min-width: 200px;
}
.qc-lesson-nav-btn:hover { background: rgba(0, 212, 255, 0.05); border-color: var(--border-accent); }
.qc-lesson-nav-btn .nav-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.qc-lesson-nav-btn .nav-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-top: 4px; }
.qc-lesson-nav-btn.next { text-align: right; }

/* Progress Indicator */
.qc-progress-container { width: 100%; height: 4px; background: var(--bg-surface); position: fixed; top: 0; left: 0; z-index: 9999; }
.qc-progress-bar { height: 100%; background: var(--accent-cyan); width: 0%; transition: width var(--dur-fast) ease; }


/* ──────────────────────────────────────────
   3. INTERFACE COMPONENTS
   ────────────────────────────────────────── */

/* Loading States */
.qc-state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
}
.qc-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 212, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error States */
.qc-state-error {
  text-align: center;
  padding: 48px;
  border: 1px dashed var(--color-error);
  border-radius: var(--radius-lg);
  background: rgba(255, 74, 74, 0.05);
}

/* Empty States */
.qc-state-empty {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-muted);
}

/* Tooltips */
.qc-tooltip-wrapper { position: relative; display: inline-block; cursor: help; }
.qc-tooltip-wrapper::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-deep);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--dur-fast) ease;
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 100;
}
.qc-tooltip-wrapper:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
