/* ==========================================================================
   UNIFIED STUDY MATERIAL DESIGN SYSTEM & STYLESHEET
   Style Baseline: PH 220 Exam 2 Comprehensive Interactive Review Suite
   Used across all subsites in /site/ (ME 322, PH 220, CHEM 105)
   ========================================================================== */

/* 1. Google Fonts Import (Inter & JetBrains Mono) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* 2. Design Tokens & CSS Variables */
:root {
  /* Surfaces & Canvas */
  --bg: #0b0f19;
  --card-bg: rgba(18, 24, 38, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(99, 102, 241, 0.45);
  --input-bg: rgba(15, 23, 42, 0.7);
  --glass: backdrop-filter: blur(12px);

  /* Typography */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Semantic Accents */
  --accent-indigo: #6366f1;
  --accent-blue: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-teal: #14b8a6;
}

/* 3. Global Resets & Body Mesh */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.16) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.14) 0px, transparent 50%);
  background-attachment: fixed;
  font-family: var(--font-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  width: 100%;
}

/* 4. Top Navigation Bar */
.top-nav, .portal-top-bar, .nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-indigo);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateX(-3px);
  color: #a5b4fc;
}

.btn-eq-sheet, .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-eq-sheet:hover, .nav-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #6ee7b7;
}

/* 5. Header & Hero */
header {
  margin-bottom: 28px;
  text-align: center;
}

.pill-badge, .badge-pill, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.pill-badge span.pulse-dot, .pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  display: inline-block;
}

h1, header h1, .page-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

p.subtitle, header p, .page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Optional conditional action buttons in header */
.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-actions .nav-btn-green {
  background: #10b981;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}
.hero-actions .nav-btn-green:hover { opacity: 0.9; }

.hero-actions .nav-btn-amber {
  background: #f59e0b;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}
.hero-actions .nav-btn-amber:hover { opacity: 0.9; }

/* 6. Scoreboard & Live Progress Panel */
.scoreboard-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.score-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.progress-bar-wrap {
  flex: 1;
  min-width: 180px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-emerald));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.btn-reset {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* 7. Filter Bar & Tabs */
.filter-wrapper, .filter-container, .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-btn, .tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.filter-btn:hover, .tab-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.3);
}

.filter-btn.active, .tab-btn.active {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

/* 8. Questions & Card Layout */
.questions-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.question-card, .card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  margin-bottom: 24px;
}

.question-card:hover, .card:hover {
  border-color: var(--card-hover-border);
}

.question-card.answered-correct, .card.answered-correct {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.card-header {
  margin-bottom: 14px;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pill-cat, .source-tag, .type-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.pill-chap {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.problem-title, .card-title, .card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 6px;
}

.problem-statement, .stem-text, .q-text, .prompt {
  font-size: 0.96rem;
  color: #e2e8f0;
  margin-bottom: 18px;
  line-height: 1.65;
}

/* 9. Diagrams & Media */
.diagram-wrapper, .diagram-box {
  text-align: center;
  margin: 16px 0 20px;
  background: rgba(15, 23, 42, 0.6);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.problem-diagram, .diagram-img, .diagram-box img {
  max-width: 100%;
  height: auto;
  max-height: 380px;
  border-radius: 6px;
  object-fit: contain;
}

.diagram-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* 10. Interactive Workspace */
.interactive-workspace {
  margin-top: 14px;
  margin-bottom: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* 11. Multiple Choice */
.mc-group, .multi-mc-options, .mc-options, .options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-option, .option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.92rem;
  color: #e2e8f0;
}

.mc-option:hover, .option-label:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.mc-option input[type="radio"],
.mc-option input[type="checkbox"],
.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  accent-color: var(--accent-indigo);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.mc-option.correct-choice, .option-label.correct {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--accent-emerald) !important;
  color: #a7f3d0 !important;
  font-weight: 600;
}

.mc-option.wrong-choice, .option-label.incorrect {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: var(--accent-rose) !important;
  color: #fecdd3 !important;
}

/* 12. Numeric Inputs & Buttons */
.input-row, .input-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.num-input, input[type="text"], input[type="number"], select {
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  width: 220px;
  outline: none;
  transition: all 0.2s ease;
}

.num-input:focus, input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.num-input.correct-field, input.correct-field {
  border-color: var(--accent-emerald) !important;
  background: rgba(16, 185, 129, 0.1) !important;
  color: #6ee7b7 !important;
}

.num-input.incorrect-field, input.incorrect-field {
  border-color: var(--accent-rose) !important;
  background: rgba(244, 63, 94, 0.1) !important;
  color: #fca5a5 !important;
}

.unit-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-check, button.btn, .btn {
  background: var(--accent-indigo);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-check:hover, button.btn:hover, .btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.btn-check-sub {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-check-sub:hover {
  background: var(--accent-indigo);
  color: #fff;
}

/* Multi-Numeric Rows */
.multi-numeric-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.multi-num-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.subq-label {
  font-size: 0.88rem;
  color: #cbd5e1;
  font-weight: 500;
  min-width: 220px;
}

.subq-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subq-input {
  width: 140px;
  padding: 6px 10px;
  font-size: 0.88rem;
}

.subq-status {
  font-size: 0.85rem;
  font-weight: 600;
}

.multi-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 13. Feedback Messages */
.feedback-msg, .feedback {
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
}

.feedback-msg.show, .feedback.show, .feedback.correct, .feedback.incorrect {
  display: block;
}

.feedback-msg.correct, .feedback.correct {
  color: var(--accent-emerald);
}

.feedback-msg.incorrect, .feedback.incorrect {
  color: var(--accent-rose);
}

/* 14. Collapsible Details Tabs */
.explanation-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

details {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  margin-top: 8px;
}

details[open] {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.12);
}

summary {
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

summary:hover {
  color: #fff;
}

.hint-tab summary, details.hint-box summary {
  color: #fcd34d;
}

.solution-tab summary, details.solution-box summary {
  color: var(--accent-blue);
}

.hint-content, .solution-content, .details-content, .solution {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.65;
}

.hint-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.hint-formula-list {
  list-style-type: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint-formula-list li {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 6px;
  border-left: 3px solid #fcd34d;
  font-size: 0.9rem;
}

.final-ans {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.12);
  border-left: 4px solid var(--accent-emerald);
  border-radius: 4px;
  font-weight: 700;
  color: #6ee7b7;
  font-size: 0.95rem;
}

/* 15. Tables & Property Lookups */
.table-container {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.90rem;
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
}

th {
  background: rgba(30, 41, 59, 0.8);
  color: #93c5fd;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* 16. Modal Dialogs */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
  font-size: 1.25rem;
  color: #fff;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: #fff;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 17. MathJax & KaTeX Equation Protection */
.katex {
  font-size: 1.05em;
}
.katex-display {
  margin: 0.6em 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}
mjx-container[jax="CHTML"][display="true"] {
  margin: 0.6em 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}

/* 18. Footer */
footer {
  margin-top: auto;
  text-align: center;
  padding: 30px;
  color: #64748b;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 19. Responsive Breakpoints */
@media (max-width: 640px) {
  .subq-label {
    min-width: 100%;
  }
  .num-input, input[type="text"], input[type="number"], select {
    width: 100%;
  }
  .score-stats {
    gap: 14px;
  }
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 20. Sections, Subparts & Resource Banners */
.section-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-desc {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid var(--accent-indigo);
  padding: 0.75rem 1.25rem;
  font-size: 0.92rem;
  color: #cbd5e1;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.5rem;
}

.subparts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.subpart-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.85rem;
  border-radius: 8px;
}

.resource-banner {
  max-width: 980px;
  margin: 18px auto 0;
  padding: 0 15px;
}

.banner-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.75), rgba(2, 132, 199, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  color: white;
  padding: 16px 22px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.banner-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7dd3fc;
  margin-bottom: 3px;
}

.banner-title { font-size: 1.15rem; font-weight: 800; }
.banner-desc { font-size: 0.88rem; opacity: 0.92; margin-top: 2px; }
.banner-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.banner-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.banner-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.banner-btn.primary {
  background: #10b981;
  border-color: #10b981;
}

.banner-btn.primary:hover {
  background: #059669;
}

/* Sticky Filter Headers */
.filter-sticky {
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.filter-count {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 9999px;
  margin-left: 4px;
}

.card-num {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-indigo);
}

.tag-conceptual {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-numerical {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 21. Additional Cross-Subsite Component Aliases */
.problem-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.problem-card:hover {
  border-color: var(--card-hover-border);
}

.stats-tracker {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.stat-pill, .score-badge {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.score-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
  z-index: 1000;
  font-weight: 500;
}

.score-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.score-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score-val {
  font-weight: 800;
  color: #38bdf8;
  font-size: 1.2rem;
  font-family: var(--font-mono);
}

.score-progress-bar {
  width: 140px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

.score-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-emerald));
  width: 0%;
  transition: width 0.3s ease;
}

.portal-bar-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

sub {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  bottom: -0.25em;
}

/* 22. Hero Block Variants */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  margin-bottom: 24px;
}

.hero-pre {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--accent-blue);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* 23. Homework & Preclass Drill Components */
.ref-banner {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-left: 4px solid var(--accent-blue);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 2rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.ref-banner strong { color: #fff; }

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin: 2.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.prob-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
  flex-wrap: wrap;
}

.prob-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.prob-badge {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.table-responsive {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 24. Chemistry Interactive Nomenclature & Drill Classes */
.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  justify-content: center;
}

.jump-chip {
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.jump-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.3);
}

.jump-chip.highlight {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
}

.section-block {
  margin-bottom: 40px;
  scroll-margin-top: 30px;
}

.question-card .card-top, .chem-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.topic-tag {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  color: #cbd5e1;
  font-family: var(--font-mono);
}

.prompt-text {
  font-size: 0.96rem;
  color: #e2e8f0;
  margin-bottom: 16px;
  line-height: 1.6;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

input.chem-input, select.chem-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s;
}

input.chem-input:focus, select.chem-select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Dropdown select options styling for high contrast in dark mode */
select option {
  background-color: #0f172a;
  color: #f1f5f9;
}

.subpart-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0;
}
