/* Minimalistic Theme & Tokens */
:root {
  --bg-app: #090d16;
  --bg-sidebar: #090d16;
  --bg-content: #090d16;
  --bg-card: #111827;
  --bg-card-hover: rgba(30, 41, 59, 0.25);
  
  --border: #1e293b;
  --border-hover: #334155;
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --scrollbar-thumb: #1e293b;
  --scrollbar-track: #090d16;
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* Application Layout (3-Column Flex Grid) */
.app-layout {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ---------------------------------------------------- */
/* COLUMN 1: SIDEBAR                                    */
/* ---------------------------------------------------- */
.sidebar {
  width: 260px;
  border-right: 1px solid var(--border);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 16px;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, border-right 0.3s ease;
}

.sidebar.collapsed {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
  border-right: 1px solid transparent;
}

.sidebar-brand {
  margin-bottom: 28px;
  padding-left: 8px;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.sidebar-expand-btn {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 20;
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-expand-btn:hover {
  background-color: var(--border);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.sidebar-expand-btn.hidden {
  display: none;
}

.sidebar-brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-tag {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  scrollbar-width: none; /* Hide scrollbar in sidebar navigation */
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0 8px 8px 8px;
}

.nav-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--border);
  color: var(--text-main);
  font-weight: 500;
}

.nav-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav-item.locked:hover {
  background-color: transparent;
  color: var(--text-secondary);
}

/* Status Dots in Sidebar */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex-shrink: 0;
}

.status-dot.completed {
  background-color: var(--accent-green);
}

.status-dot.active-dot {
  background-color: var(--accent-blue);
}

.status-dot.locked {
  background-color: var(--text-muted);
}

.sidebar-progress {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-bar-container {
  height: 4px;
  width: 100%;
  background-color: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--accent-green);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ---------------------------------------------------- */
/* COLUMN 2: SCROLLABLE CONTENT                         */
/* ---------------------------------------------------- */
.content-panel {
  flex: 1;
  background-color: var(--bg-content);
  padding: 40px 48px;
  overflow-y: auto;
  min-width: 0;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

/* Fallback for WebKit browsers */
.content-panel::-webkit-scrollbar {
  width: 6px;
}
.content-panel::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
.content-panel::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

/* Content Sections Toggling */
.content-section {
  display: none;
  flex-direction: column;
  max-width: 680px;
  margin: 0 auto;
  animation: fade-in 0.2s ease-out;
}

.content-section.active {
  display: flex;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.category-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

/* Markdown and Lesson Styling */
.markdown-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.markdown-body p {
  margin-bottom: 18px;
}

.markdown-body p.lead {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.5;
}

.markdown-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 28px;
  margin-bottom: 12px;
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 18px;
  padding-left: 20px;
}

.markdown-body li {
  margin-bottom: 8px;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
}

.math-inline {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #38bdf8;
}

/* Tip Cards (Tips Section) */
.tip-card {
  display: flex;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background-color: rgba(255, 255, 255, 0.01);
  transition: border-color 0.15s ease;
}

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

.tip-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-blue);
  width: 28px;
  height: 28px;
  background-color: rgba(37, 99, 235, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-content h3 {
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}

.tip-content p {
  font-size: 13.5px;
  margin-bottom: 0 !important;
}

/* Callout Boxes (Highlights/Hacks) */
.highlight-box, .hack-box {
  border-left: 3px solid var(--border);
  padding: 14px 18px;
  background-color: var(--bg-card);
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
}

.highlight-box p, .hack-box p {
  margin-bottom: 0;
  font-size: 13.5px;
}

.hack-box {
  border-color: var(--accent-blue);
  background-color: rgba(37, 99, 235, 0.02);
}

.hack-box h4 {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.hack-box ol {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 13px;
}

/* Guided Example Steps */
.lesson-part {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding-top: 24px;
}

.instruction-lead {
  font-size: 15px;
  color: var(--text-main);
}

.example-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.step {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background-color: rgba(255, 255, 255, 0.01);
  transition: all 0.2s ease;
}

.step.active {
  border-color: var(--accent-blue);
  background-color: rgba(37, 99, 235, 0.03);
}

.step.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.step p {
  font-size: 13.5px;
  margin-bottom: 0;
}

.explain-text {
  margin-top: 8px !important;
  color: var(--text-secondary);
}

.step-action-btn {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  transition: var(--border);
}

.step-action-btn:hover:not(:disabled) {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.step-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Test Tabs */
.test-desc {
  margin-bottom: 20px;
}

.test-tab-headers {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 24px;
  margin-bottom: 20px;
}

.test-tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 0;
  position: relative;
  transition: color 0.15s ease;
}

.test-tab-btn:hover {
  color: var(--text-main);
}

.test-tab-btn.active {
  color: var(--text-main);
  font-weight: 600;
}

.test-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-blue);
}

.test-tab-panel {
  display: none;
}

.test-tab-panel.active {
  display: block;
}

/* MCQ Question Block */
.question-container {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.question-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.question-prompt {
  font-size: 14.5px;
  color: var(--text-main);
  margin-bottom: 16px !important;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13.5px;
  background-color: rgba(255, 255, 255, 0.01);
}

.option-item:hover {
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.02);
}

.option-item input[type="radio"] {
  margin-top: 4px;
  cursor: pointer;
}

.option-item.selected {
  border-color: var(--accent-blue);
  background-color: rgba(37, 99, 235, 0.03);
}

.option-item.correct {
  border-color: var(--accent-green) !important;
  background-color: rgba(22, 163, 74, 0.04) !important;
  color: #4ade80;
}

.option-item.incorrect {
  border-color: var(--accent-red) !important;
  background-color: rgba(220, 38, 38, 0.04) !important;
  color: #f87171;
}

.question-footer {
  display: flex;
  gap: 8px;
}

.verify-btn {
  background-color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  color: var(--text-main);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.verify-btn:hover {
  background-color: var(--accent-blue-hover);
}

.show-hack-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.show-hack-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.next-btn {
  align-self: flex-start;
  background-color: var(--border);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.15s ease;
}

.next-btn:hover {
  background-color: var(--border-hover);
  border-color: var(--border-hover);
}

/* Feedback message and explanations */
.feedback-msg {
  margin-top: 14px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 4px;
  line-height: 1.4;
}

.feedback-msg.correct {
  background-color: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: #4ade80;
}

.feedback-msg.incorrect {
  background-color: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #f87171;
}

.feedback-msg.hidden, .hack-explanation.hidden {
  display: none;
}

.hack-explanation {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.01);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  animation: slide-down 0.2s ease-out;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hack-explanation p {
  margin-bottom: 8px;
}

.hack-explanation p:last-child {
  margin-bottom: 0;
}

.hack-explanation strong {
  color: var(--text-main);
}

/* Locked subtopic views */
.locked-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.locked-icon {
  margin-bottom: 16px;
  color: var(--border-hover);
  animation: pulse-lock 3s infinite alternate;
}

@keyframes pulse-lock {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}

.locked-body h3 {
  margin-top: 0 !important;
  color: var(--text-secondary) !important;
  font-size: 16px;
  margin-bottom: 6px;
}

.locked-body p {
  font-size: 13px;
  max-width: 280px;
  text-align: center;
}

/* ---------------------------------------------------- */
/* COLUMN 3: PERSISTENT CALCULATOR                      */
/* ---------------------------------------------------- */
.calculator-panel {
  width: 25%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background-color: #000;
  border-left: 1px solid var(--border);
  height: 100%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-left 0.3s ease;
}

.calculator-panel.collapsed {
  width: 0 !important;
  border-left: none;
  overflow: hidden;
}

.calculator-panel.dragging {
  transition: none; /* remove lag when dragging resizer */
}

/* Calculator Header (Dark theme style) */
.calc-header-v2 {
  height: 42px;
  background-color: #1a1a1a;
  border-bottom: 1px solid #2d2d2d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  user-select: none;
}

.calc-header-title {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.calc-close-btn {
  background: none;
  border: none;
  color: #888888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.calc-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Floating expand button when calculator is collapsed */
.calc-expand-btn {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 20;
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}

.calc-expand-btn:hover {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--text-main);
}

.calc-expand-btn.hidden {
  display: none;
}

/* Resizer Bar Styling */
.resizer {
  width: 6px;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  cursor: col-resize;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
  z-index: 15;
}

.resizer:hover, .resizer.dragging {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.resizer.hidden {
  display: none;
}



.calculator-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
}

#calculator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------- */
/* RESPONSIVE VIEWS (MOBILE STACKING)                  */
/* ---------------------------------------------------- */
@media (max-width: 1024px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
  }

  .sidebar.collapsed {
    width: 100%;
    height: 0;
    padding: 0;
    overflow: hidden;
    border: none;
  }
  
  .sidebar-brand {
    margin-bottom: 12px;
  }
  
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .nav-group {
    flex-direction: row;
    gap: 6px;
  }
  
  .nav-group-title {
    display: none; /* Hide header text in small screens to save space */
  }
  
  .nav-item {
    width: auto;
    padding: 6px 12px;
  }
  
  .sidebar-progress {
    display: none; /* Hide progress bar in mobile to save space */
  }
  
  .content-panel {
    height: auto;
    min-height: 70vh;
    flex: none;
    overflow: visible;
    padding: 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .calculator-panel {
    width: 100%;
    height: 60vh;
    min-height: 480px;
    flex-shrink: 0;
    border-left: none;
  }

  .calculator-panel.collapsed {
    width: 100% !important;
    height: 0;
    min-height: 0;
  }

  .resizer {
    display: none;
  }
}

/* ==========================================================================
   NESTED SIDEBAR SUB-NAVIGATION
   ========================================================================== */
.subnav-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.subnav-items {
  display: none; /* Hidden unless parent subnav-container is active */
  flex-direction: column;
  gap: 4px;
  padding-left: 16px;
  margin: 4px 0 8px 12px;
  border-left: 1px solid var(--border);
}

.subnav-container.active .subnav-items {
  display: flex;
}

.subnav-item {
  padding: 6px 12px;
  font-size: 12px !important;
  color: var(--text-secondary);
  border-radius: 4px;
}

.subnav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.02);
}

.subnav-item.active {
  color: var(--text-main) !important;
  background-color: var(--border) !important;
  font-weight: 500;
}

/* ==========================================================================
   COMPACT GUIDED EXAMPLE WIZARD
   ========================================================================== */
.ge-tabs, .quiz-difficulty-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 20px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.ge-tab-btn, .quiz-diff-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.ge-tab-btn:hover, .quiz-diff-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

.ge-tab-btn.active, .quiz-diff-btn.active {
  color: var(--text-main);
  background-color: var(--border);
}

.quiz-player-card, .quiz-summary-card {
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.01);
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ge-panel {
  display: none;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 12px;
}

.ge-panel.active {
  display: block;
}

.ge-question {
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.ge-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ge-step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.005);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ge-step-item:hover {
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.02);
}

.ge-step-item.completed {
  border-color: rgba(22, 163, 74, 0.55);
  background-color: rgba(22, 163, 74, 0.04);
}

.ge-step-item.completed .ge-plot-btn {
  background-color: var(--accent-green);
}

.ge-step-text {
  flex: 1;
  color: var(--text-secondary);
}

.ge-step-text strong {
  color: var(--text-main);
}

.ge-plot-btn {
  background-color: var(--accent-blue);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ge-plot-btn:hover {
  opacity: 0.9;
}

.ge-plot-btn code {
  background-color: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  padding: 1px 3px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: 4px;
}

.quiz-player-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/* ==========================================================================
   QUIZ PLAYER SYSTEM
   ========================================================================== */
.quiz-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.quiz-q-num {
  font-weight: 500;
  color: var(--text-main);
}

.quiz-qid {
  font-size: 11px;
  color: var(--text-muted);
}

.quiz-progress-bar-container {
  width: 100%;
  height: 4px;
  background-color: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.quiz-progress-bar-fill {
  height: 100%;
  background-color: var(--accent-blue);
  width: 0;
  transition: width 0.3s ease;
}

.quiz-player-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
}

.quiz-prompt {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
}

/* Collapsible Accordions (Hint & Hack) */
.quiz-collapsibles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.quiz-collapsible-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.quiz-collapsible-header {
  width: 100%;
  background: rgba(255, 255, 255, 0.005);
  border: none;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-family: inherit;
  text-align: left;
}

.quiz-collapsible-header:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.quiz-collapsible-header .chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.quiz-collapsible-header.expanded .chevron {
  transform: rotate(180deg);
}

.quiz-collapsible-content {
  padding: 16px;
  border-top: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.quiz-collapsible-content.hidden {
  display: none;
}

.hint-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.hack-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.hack-text p {
  margin: 0 0 8px 0;
}

.hack-text p:last-child {
  margin-bottom: 0;
}

.quiz-nav-buttons {
  display: flex;
  gap: 8px;
}

/* Quiz Summary Card */
.quiz-summary-card {
  align-items: center;
  text-align: center;
  padding: 40px 24px;
}

.quiz-summary-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(34, 197, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.quiz-score-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 300px;
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.quiz-summary-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

/* Curriculum content */
.module-overview-grid,
.method-list,
.translation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 26px;
}

.overview-card,
.method-card,
.translation-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background-color: rgba(255, 255, 255, 0.01);
}

.overview-card strong,
.method-card strong,
.translation-grid strong {
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
}

.overview-card span,
.method-card p,
.translation-grid code {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
}

.decision-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 18px 0 26px;
}

.decision-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.decision-table th,
.decision-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.decision-table th {
  color: var(--text-main);
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.02);
}

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

.decision-table td:first-child {
  color: var(--text-main);
  width: 38%;
}

.fact-list {
  border-left: 2px solid var(--border);
  padding-left: 22px !important;
}

.fact-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 18px 0 22px;
  overflow: hidden;
}

.fact-table > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) 1.5fr;
  gap: 18px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.fact-table > div:last-child {
  border-bottom: none;
}

.fact-table strong {
  color: var(--text-main);
  font-weight: 600;
}

.action-grid,
.example-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.example-note {
  color: var(--text-secondary);
  font-size: 13px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.question-meta {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.question-meta {
  margin: -2px 0 10px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 26px;
}

.comparison-grid > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}

.comparison-grid strong {
  color: var(--text-main);
  font-size: 12px;
}

.comparison-grid code {
  width: fit-content;
}

.practice-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.practice-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background-color: rgba(255, 255, 255, 0.01);
}

.practice-card h3 {
  margin: 8px 0 16px;
  font-size: 14.5px;
  line-height: 1.55;
}

.difficulty-label {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.practice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.practice-options button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.practice-options button:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.practice-options button.selected {
  border-color: var(--accent-blue);
  background-color: rgba(37, 99, 235, 0.08);
  color: var(--text-main);
}

.check-practice-btn {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 7px 12px;
  background-color: var(--border);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.check-practice-btn:hover {
  border-color: var(--border-hover);
  background-color: var(--border-hover);
}

.practice-feedback {
  display: none;
  margin: 12px 0 0 !important;
  font-size: 12.5px;
}

.practice-feedback.visible {
  display: block;
}

.practice-feedback.correct {
  color: #4ade80;
}

.practice-feedback.incorrect {
  color: #f87171;
}

.calculator-error {
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-main);
  text-align: center;
  font-family: var(--font-sans);
}

.calculator-error span {
  max-width: 250px;
  color: var(--text-secondary);
  font-size: 12px;
}

@media (max-width: 720px) {
  .module-overview-grid,
  .method-list,
  .translation-grid,
  .practice-options {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fact-table > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .ge-step-item {
    align-items: stretch;
    flex-direction: column;
  }

  .ge-plot-btn {
    width: 100%;
  }
}
