/* Avatar Picker Styles */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 8px;
  margin: 10px 0 16px 0;
  max-width: 320px;
}
.avatar-option {
  font-size: 1.7rem;
  background: var(--color-surface-soft, #ecf0f1);
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.avatar-option.selected,
.avatar-option:focus {
  border-color: var(--color-accent, #3498db);
  box-shadow: 0 0 0 2px var(--color-accent, #3498db33);
}
.avatar-option[aria-selected="true"] {
  background: var(--color-accent, #3498db);
  color: #fff;
}
/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║                        CRITICAL THINKING PRACTICE                        ║
   ║                            STYLESHEET v2.0                               ║
   ╚══════════════════════════════════════════════════════════════════════════╝

   TABLE OF CONTENTS
   =================
   Use Ctrl+F (Cmd+F) to jump to any section using the markers below:
   
   1. [BASE]          - Foundational styles (reset, typography, layout)
   2. [BUTTONS]       - All button styles and variants
   3. [ARGUMENTS]     - Argument displays, premises, conclusions
   4. [FEEDBACK]      - Feedback boxes, explanations, hints
   5. [PAGES]         - Page-specific styles (home, tutorial, reference, etc.)
   6. [LESSONS]       - Complete lessons module (nav, content, quizzes, overrides)
   7. [MATCHING]      - Matching exercise styles
   8. [NOTATION]      - Notation overlay and tooltips
   9. [DARK-MODE]     - All dark mode theme variations
   10. [RESPONSIVE]   - Mobile and tablet breakpoints
   11. [ACCESSIBILITY] - Focus states and reduced motion
   12. [PRINT]        - Print-friendly styles
   13. [UTILITIES]    - Helper classes and animations

   ============================================================================ */


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [BASE] - FOUNDATIONAL STYLES                                           ║
   ║  Reset, typography, layout containers, and core page structure          ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

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

:root {
  --color-bg-start: #2c3e50;
  --color-bg-end: #34495e;
  --color-surface: #ffffff;
  --color-surface-muted: #f8f9fa;
  --color-surface-soft: #ecf0f1;
  --color-surface-subtle: #f5f7fa;
  --color-border: #e5e7eb;
  --color-border-strong: #ddd;
  --color-text: #333;
  --color-text-muted: #666;
  --color-primary: #2c3e50;
  --color-primary-dark: #34495e;
  --color-accent: #3498db;
  --color-accent-dark: #2d89c5;
  --color-success: #10b981;
  --color-success-dark: #059669;
  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-focus: #3b82f6;
  --color-info: #2196f3;
  --color-attention-bg: #fff3cd;
  --color-attention-border: #ffc107;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-end) 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.header--home {
  position: relative;
}

.header-actions {
  position: absolute;
  top: 0;
  right: 0;
}

.settings-toggle {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2em;
  transition: all 0.3s;
}

.settings-toggle:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.settings-panel {
  position: absolute;
  top: 92px;
  right: 20px;
  width: min(340px, 90vw);
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  z-index: 1500;
}

.settings-panel.hidden {
  display: none;
}

.settings-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.settings-title {
  font-weight: 700;
  color: var(--color-primary);
}

.settings-close {
  background: transparent;
  border: none;
  font-size: 1.1em;
  cursor: pointer;
  color: var(--color-text-muted);
}

.settings-actions {
  display: grid;
  gap: 10px;
}

.settings-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
}

.settings-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.settings-range {
  width: 100%;
  accent-color: var(--color-accent);
  margin-bottom: 2px;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.header p {
  font-size: 1.1em;
  opacity: 0.9;
  font-style: italic;
}

.stats-bar {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.stat-timer {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 2px solid #dc2626;
  border-radius: 12px;
  padding: 8px;
  animation: pulse 1s ease-in-out infinite;
}

.stat-timer .stat-value {
  color: #991b1b;
  font-weight: bold;
  font-size: 2em;
}

.stat-timer .stat-label {
  color: #991b1b;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.progress-panel {
  background: white;
  border-radius: 15px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-profile {
  display: flex;
  align-items: center; /* Changes from column to row for a modern horizontal layout */
  gap: 12px;
}

.progress-avatar {
  width: 52px; /* Increased size */
  height: 52px; /* Increased size */
  border-radius: 50%;
  background: var(--color-surface-soft);
  border: 2px solid var(--color-accent); /* Adds a modern pop of color */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Adds depth */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em; /* Much larger icon/emoji */
  font-weight: 700;
  transition: transform 0.3s ease;
}

.progress-avatar:hover {
  transform: scale(1.05);
}

.progress-name {
  font-size: 1.15em; /* Increased size */
  font-weight: 700; /* Bolder weight */
  color: var(--color-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em; /* Slight letter spacing for a polished look */
}

.progress-title {
  font-weight: 700;
  color: var(--color-primary);
}

.progress-xp {
  color: var(--color-text-muted);
  font-size: 0.95em;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-success));
  width: 0%;
  transition: width 0.35s ease;
}

.level-up-toast {
  margin-bottom: 16px;
  background: #ecfdf3;
  border: 2px solid var(--color-success);
  color: #065f46;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  animation: toastPop 0.3s ease-out;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: var(--color-primary);
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.9em;
  margin-top: 5px;
}

.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.5s;
}

.app-error {
  background: #fee2e2;
  border: 2px solid var(--color-danger);
  color: #7f1d1d;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
}

.section-title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--color-text);
}

.section-title--spacious {
  margin-bottom: 30px;
}

.section-subtitle {
  margin-top: 30px;
  margin-bottom: 15px;
}

.section-heading {
  margin-top: 20px;
  margin-bottom: 15px;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 5px;
}

.section-heading--spaced {
  margin-top: 40px;
}


/* ──────────────────────────────────────────────────────────────────────────
   ACTION SECTIONS
   ────────────────────────────────────────────────────────────────────────── */

.tutorial-actions {
  text-align: center;
  margin-top: 30px;
  gap: 15px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.tutorial-actions .btn {
  padding: 12px 20px;
  background: white;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: none;
}

.tutorial-actions .btn:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

.tutorial-actions .btn-danger {
  border-color: var(--color-danger);
  color: var(--color-danger-dark);
}

.tutorial-actions .btn-danger:hover {
  background: var(--color-danger);
  color: white;
}

.tutorial-actions .btn-success {
  border-color: var(--color-success);
  color: var(--color-success-dark);
}

.tutorial-actions .btn-success:hover {
  background: var(--color-success);
  color: white;
}

.insights-actions {
  text-align: center;
  margin-top: 30px;
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 40px;
}

.empty-state--compact {
  padding: 12px 0;
}

.difficulty-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.difficulty-btn {
  padding: 10px 20px;
  border: 2px solid var(--color-primary);
  background: white;
  color: var(--color-primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: all 0.3s;
}

.difficulty-btn:hover {
  background: var(--color-surface-soft);
}

.difficulty-btn.active {
  background: var(--color-primary);
  color: white;
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [ARGUMENTS] - ARGUMENT DISPLAY COMPONENTS                              ║
   ║  Premises, conclusions, and argument formatting                         ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

.argument {
  background: var(--color-surface-muted);
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 25px;
  border-left: 4px solid var(--color-primary);
}

.premise {
  margin: 8px 0;
  font-size: 1.1em;
  color: var(--color-text);
}

.conclusion {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid var(--color-border-strong);
  font-size: 1.1em;
  color: var(--color-text);
  font-weight: 600;
}

.conclusion::before {
  content: "∴ ";
  color: var(--color-primary);
  font-weight: bold;
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [BUTTONS] - BUTTON COMPONENTS & STYLES                                 ║
   ║  All button types, states, and variants                                 ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

.button-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.btn {
  padding: 15px 40px;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 5px;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-success {
  background: #2ecc71;
  color: white;
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 5px;
}

.btn-success:hover {
  background: #27b762;
}


.btn-next {
  background: var(--color-primary);
  color: white;
}

.btn-next:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background: var(--color-danger-dark);
}

.btn-hint {
  background: var(--color-warning);
  color: white;
}

.btn-hint:hover {
  background: var(--color-warning-dark);
  transform: translateY(-2px);
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [FEEDBACK] - FEEDBACK & EXPLANATION COMPONENTS                         ║
   ║  Feedback boxes, explanations, counterexamples, hints                   ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

.feedback {
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
}

.feedback.correct {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: var(--color-success);
  display: block;
  color: #065f46;
}

.feedback.incorrect {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: var(--color-danger);
  display: block;
  color: #991b1b;
}

.timed-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: opacity, transform;
}

.timed-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.timed-feedback.correct {
  background: var(--color-success);
  color: white;
}

.timed-feedback.incorrect {
  background: var(--color-danger);
  color: white;
}

.feedback h3 {
  margin-bottom: 10px;
  font-size: 1.3em;
}

.feedback.correct h3 {
  color: var(--color-success-dark);
}

.feedback.incorrect h3 {
  color: var(--color-danger-dark);
}

.feedback-title {
  font-weight: bold;
  font-size: 1.15em;
  margin-bottom: 10px;
}

.feedback.correct .feedback-title {
  color: #065f46;
}

.feedback.incorrect .feedback-title {
  color: #991b1b;
}

.feedback-explanation {
  font-size: 0.95em;
  line-height: 1.5;
  opacity: 0.9;
}

.explanation {
  background: var(--color-surface-muted);
  border-left: 4px solid var(--color-accent);
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
  line-height: 1.6;
  color: var(--color-text);
}

.counterexample {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  border-left: 4px solid var(--color-danger);
}

.counterexample h4 {
  color: var(--color-danger-dark);
  margin-bottom: 10px;
}

.truth-value {
  font-family: 'Courier New', monospace;
  background: #f3f4f6;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.hidden {
  display: none;
}



@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.notation {
  position: relative;
  display: inline-block;
  cursor: help;
  color: var(--color-primary);
  font-weight: 600;
  padding: 0 2px;
  border-bottom: 1px dotted var(--color-primary);
}

.notation .tooltip {
  visibility: hidden;
  width: 280px;
  background-color: #1f2937;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  margin-left: -140px;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 0.85em;
  font-weight: normal;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
}

.notation .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

.notation:hover .tooltip {
  visibility: visible;
  opacity: 1;
}




/* Mode Selection Cards */
.mode-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.mode-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid var(--color-border);
  will-change: transform;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.mode-card:hover::before {
  transform: scaleX(1);
}

.mode-card:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.mode-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(44, 62, 80, 0.15);
  border-color: var(--color-primary);
}

/* Mode Card Variants */
.mode-card--symbolic::before {
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.mode-card--natural::before {
  background: linear-gradient(90deg, #f093fb, #f5576c);
}

.mode-card--mixed::before {
  background: linear-gradient(90deg, #4facfe, #00f2fe);
}

.mode-card--timed::before {
  background: linear-gradient(90deg, #fa709a, #fee140);
}

.mode-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
}

.mode-icon {
  font-size: 3.5em;
  margin: 0;
  line-height: 1;
}

.mode-badge {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-badge--challenge {
  background: linear-gradient(135deg, #fa709a, #fee140);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.mode-card h3 {
  color: var(--color-text);
  margin: 0;
  font-size: 1.6em;
  font-weight: 700;
}

.mode-description {
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
  font-size: 0.95em;
}

.mode-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0;
}

.mode-feature {
  background: var(--color-surface-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.mode-example {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 16px;
  border-radius: 12px;
  margin: 0;
  border-left: 4px solid var(--color-primary);
  text-align: left;
  flex-grow: 1;
}

.example-label {
  font-size: 0.75em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.example-content {
  font-family: 'Courier New', monospace;
  color: var(--color-text);
  line-height: 1.8;
  font-size: 0.9em;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.premise {
  padding-left: 8px;
}

.conclusion {
  padding-left: 8px;
  font-weight: 700;
}

.symbolic-ex {
  display: block;
  padding: 4px 8px;
  background: white;
  border-radius: 4px;
  margin: 2px 0;
}

.symbolic-ex.premise,
.symbolic-ex.conclusion {
  padding-left: 8px;
}

.natural-ex {
  display: block;
  padding: 4px 8px;
  background: white;
  border-radius: 4px;
  margin: 2px 0;
}

.example-name {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.difficulty-levels {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
  text-align: center;
}

.level-beginner {
  background: linear-gradient(135deg, #d4fc79, #96e6a1);
  color: #2d5016;
}

.level-intermediate {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  color: #6c5ce7;
}

.level-advanced {
  background: linear-gradient(135deg, #fd79a8, #e84393);
  color: white;
}

.mode-stats {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  padding: 12px;
  background: var(--color-surface-muted);
  border-radius: 10px;
  margin: 0;
  font-size: 0.85em;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--color-text-muted);
}

.stat-item strong {
  font-size: 1.4em;
  color: var(--color-primary);
  font-weight: 800;
}

.mode-btn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0;
  will-change: transform;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.mode-btn:active {
  transform: translateY(0);
}

.mode-btn--challenge {
  background: linear-gradient(135deg, #fa709a, #fee140);
  box-shadow: 0 4px 12px rgba(250, 112, 154, 0.3);
}

.mode-btn--challenge:hover {
  box-shadow: 0 6px 20px rgba(250, 112, 154, 0.4);
}


.back-btn,
.back-lessons-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.back-btn:hover,
.back-lessons-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.question-type-label {
  text-align: center;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.multiple-choice-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.choice-btn {
  padding: 15px 20px;
  font-size: 1em;
  font-weight: 600;
  border: 2px solid var(--color-primary);
  background: white;
  color: var(--color-text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  will-change: transform;
}

.choice-btn:hover {
  background: var(--color-surface-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.choice-btn.correct {
  background: #d1fae5;
  border-color: var(--color-success);
  color: var(--color-success-dark);
}

.choice-btn.incorrect {
  background: #fee2e2;
  border-color: var(--color-danger);
  color: var(--color-danger-dark);
}

.choice-btn.disabled {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

.validity-label {
  font-weight: 700;
  display: inline-block;
  margin-right: 8px;
}

.validity-label.valid {
  color: var(--color-success-dark);
}

.validity-label.invalid {
  color: var(--color-danger-dark);
}

.argument-type-label {
  font-weight: 700;
}

.argument-type-label.valid {
  color: var(--color-success-dark);
}

.argument-type-label.invalid {
  color: var(--color-danger-dark);
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [PAGES] - PAGE-SPECIFIC STYLES                                         ║
   ║  Home, Tutorial, Reference, Dictionary, Insights pages                  ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ──────────────────────────────────────────────────────────────────────────
   HOME / STARTING PAGE
   ────────────────────────────────────────────────────────────────────────── */

.resource-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid var(--color-border);
}

.resource-btn {
  padding: 12px 20px;
  background: white;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  will-change: transform, background, color;
}

.resource-btn:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#motionToggle {
  transition: all 0.3s ease;
  font-weight: 700;
}


/* ──────────────────────────────────────────────────────────────────────────
   TUTORIAL PAGE
   ────────────────────────────────────────────────────────────────────────── */

.tutorial-section {
  margin-bottom: 30px;
  padding: 20px;
  background: var(--color-surface-muted);
  border-radius: 10px;
}

.tutorial-section h3 {
  color: var(--color-primary);
  margin-bottom: 15px;
}

.tutorial-section p {
  line-height: 1.8;
  margin-bottom: 10px;
  color: var(--color-text);
}

.tutorial-section ul {
  margin-left: 25px;
  line-height: 1.8;
}

.teaching-moment {
  background: var(--color-attention-bg);
  border: 3px solid var(--color-attention-border);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

.teaching-moment h4 {
  color: #856404;
  margin-bottom: 15px;
}

.teaching-moment ul {
  margin-left: 20px;
  line-height: 1.8;
}

.tutorial-important {
  background: var(--color-attention-bg);
  border-left: 4px solid var(--color-attention-border);
  padding: 15px;
  margin: 15px 0;
  border-radius: 5px;
}

.tutorial-explanation {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-top: 15px;
}


/* ──────────────────────────────────────────────────────────────────────────
   REFERENCE PAGE
   ────────────────────────────────────────────────────────────────────────── */

.reference-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-border);
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--color-text-muted);
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  will-change: color;
}

.tab-btn:hover {
  color: var(--color-primary);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.reference-content {
  max-height: 600px;
  overflow-y: auto;
  padding: 10px;
}


.reference-loading,
.reference-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 20px 10px;
}

.dictionary-loading {
  text-align: center;
  color: var(--color-text-muted);
  padding: 20px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-border);
  color: transparent;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150px;
  width: 150px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { left: -150px; }
  100% { left: 100%; }
}

.insights-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
  padding: 10px;
}

.insight-stat,
.insight-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-stat:hover,
.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.stat-label,
.insight-label {
  display: block;
  font-size: 0.85em;
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value,
.insight-value {
  display: block;
  font-size: 2em;
  font-weight: bold;
  color: #0c4a6e;
}

.insights-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.insights-section {
  margin-top: 10px;
}

.recent-unlocks {
  display: grid;
  gap: 10px;
}

.recent-unlock-item {
  background: var(--color-surface-muted);
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.recent-unlock-title {
  font-weight: 600;
  color: var(--color-primary);
}

.insight-card {
  background: linear-gradient(135deg, var(--color-surface-muted) 0%, #e9ecef 100%);
  padding: 25px;
  border-radius: 10px;
  text-align: center;
}

.insight-label {
  color: var(--color-text-muted);
  font-size: 0.9em;
  margin-bottom: 10px;
}

.insight-value {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--color-primary);
}

/* Mastery Page Header */
.mastery-page-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--color-border);
}

.section-description {
  font-size: 1em;
  color: var(--color-text-muted);
  margin-top: 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Section Headers with Icons */
.section-header {
  margin-bottom: 20px;
}

.section-header .section-subtitle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3em;
  margin-bottom: 6px;
}

.section-icon {
  font-size: 1.2em;
}

.section-hint {
  font-size: 0.9em;
  color: var(--color-text-muted);
  margin: 0;
  padding-left: 42px;
}

.form-performance-section {
  margin-bottom: 40px;
}

.form-mastery-section {
  margin-top: 40px;
}

.section-subtitle {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.form-performance-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.form-performance-item {
  background: white;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 0;
  border: 2px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Loading Skeleton */
.loading-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.skeleton-card {
  height: 140px;
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #f8f8f8 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 12px;
  border: 2px solid var(--color-border);
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Empty State Enhancement */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 2px dashed var(--color-border);
}

.empty-state-icon {
  font-size: 3em;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state-text {
  font-size: 1.1em;
  color: var(--color-text-muted);
  font-weight: 500;
}

.form-performance-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--color-accent);
}

.achievements-summary {
  text-align: center;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.achievements-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.achievements-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  background: white;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text-muted);
}

.filter-btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.achievements-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  color: var(--color-text-muted);
  font-weight: 600;
}

.sort-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid var(--color-border);
}

.achievements-list {
  display: grid;
  gap: 12px;
}

.achievement-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

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

.achievement-card.locked {
  opacity: 0.6;
  background: var(--color-surface-muted);
}

.achievement-card.unlocked {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #22c55e;
}

.achievement-icon {
  font-size: 2.5em;
  flex-shrink: 0;
}

.achievement-info {
  flex: 1;
  min-width: 0;
}

.achievement-info h4 {
  margin: 0 0 6px 0;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1em;
}

.achievement-info p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95em;
}

.achievement-status {
  font-size: 1.8em;
  color: #22c55e;
  flex-shrink: 0;
}

.achievement-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  color: var(--color-text-muted);
}

.achievement-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-warning), var(--color-success));
  width: 0%;
  transition: width 0.35s ease;
}

.form-mastery-container {
  display: block;
  margin-bottom: 20px;
  max-height: none;
  overflow-y: visible;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
}

.form-performance-container {
  display: block;
  margin-bottom: 20px;
}

.mastery-item {
  background: white;
  border-radius: 10px;
  padding: 16px 20px;
  border: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mastery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-accent);
}

.mastery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mastery-subtitle {
  color: var(--color-text-muted);
  font-size: 0.9em;
  font-weight: 600;
  white-space: nowrap;
}

.mastery-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--color-surface-soft);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.mastery-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-warning), var(--color-success));
  width: 0%;
  transition: width 0.35s ease;
}

.performance-item {
  background: var(--color-surface-muted);
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.performance-name {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1em;
  flex: 1;
}

.performance-stats {
  display: flex;
  gap: 15px;
  align-items: center;
  text-align: right;
}

.performance-accuracy {
  font-size: 1.2em;
  font-weight: bold;
}

/* Form Performance Cards */
/* Form Performance Cards - Enhanced */
.form-performance-card {
  background: white;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 14px;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.form-performance-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--color-border);
  transition: background 0.3s ease;
}

.form-performance-card.excellent::before {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.form-performance-card.good::before {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.form-performance-card.average::before {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.form-performance-card.needs-work::before {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.form-performance-card.developing::before {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
}

.form-performance-card:hover {
  transform: translateX(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-color: var(--color-accent);
}

.form-performance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.form-performance-title {
  font-weight: 700;
  color: var(--color-text);
  font-size: 1.05em;
  flex: 1;
}

.form-performance-accuracy {
  font-weight: 800;
  font-size: 1.3em;
  margin-left: 12px;
}

.form-performance-card.excellent .form-performance-accuracy {
  color: #16a34a;
}

.form-performance-card.good .form-performance-accuracy {
  color: #2563eb;
}

.form-performance-card.average .form-performance-accuracy {
  color: #d97706;
}

.form-performance-card.needs-work .form-performance-accuracy {
  color: #dc2626;
}

.form-performance-card.developing .form-performance-accuracy {
  color: #0369a1;
}

.form-performance-progress {
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-primary) 100%);
  border-radius: 10px;
  transition: width 0.6s ease;
}

.form-performance-card.excellent .progress-fill {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.form-performance-card.good .progress-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.form-performance-card.average .progress-fill {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.form-performance-card.needs-work .progress-fill {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.form-performance-card.developing .progress-fill {
  background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%);
}

.form-performance-meta {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.9em;
}

/* Mastery Header */
.mastery-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.mastery-header h3 {
  margin: 0 0 16px 0;
  font-size: 1.4em;
  font-weight: 700;
}

.mastery-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.mastery-stat {
  background: rgba(255, 255, 255, 0.15);
  padding: 12px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.mastery-stat-label {
  display: block;
  font-size: 0.85em;
  opacity: 0.9;
  margin-bottom: 6px;
}

.mastery-stat-value {
  display: block;
  font-size: 1.5em;
  font-weight: 700;
}

/* Mastery Tiers */
.mastery-tier {
  margin-bottom: 24px;
}

.mastery-tier-title {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #f3f4f6;
}

.mastery-tier-title.tier-excellent {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
}

.mastery-tier-title.tier-good {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
}

.mastery-tier-title.tier-average {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.mastery-tier-title.tier-needs-work {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.mastery-tier-title.tier-developing {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0f172a;
}

.mastery-tier-subtitle {
  margin: 0 0 12px 0;
  font-size: 0.9em;
  color: var(--color-text-muted);
}

/* Form Mastery Items - Enhanced */
.form-mastery-item {
  background: white;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 8px;
  border: 2px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.form-mastery-item:hover {
  transform: translateX(4px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.form-mastery-item.tier-excellent {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.form-mastery-item.tier-good {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.form-mastery-item.tier-average {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.form-mastery-item.tier-needs-work {
  border-color: #fca5a5;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.form-mastery-item.tier-developing {
  border-color: #7dd3fc;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.form-mastery-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.form-mastery-rank {
  font-weight: 800;
  font-size: 0.85em;
  color: var(--color-text-muted);
  min-width: 32px;
}

.form-mastery-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95em;
}

.form-mastery-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-mastery-score {
  font-weight: 800;
  font-size: 1.15em;
}

.form-mastery-hint {
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
  font-size: 0.85em;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}

.form-mastery-item.tier-excellent .form-mastery-score {
  color: #16a34a;
}

.form-mastery-item.tier-good .form-mastery-score {
  color: #2563eb;
}

.form-mastery-item.tier-average .form-mastery-score {
  color: #d97706;
}

.form-mastery-item.tier-needs-work .form-mastery-score {
  color: #dc2626;
}

.form-mastery-item.tier-developing .form-mastery-score {
  color: #0f172a;
}

.form-mastery-count {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.9em;
}

/* Profile History Items (Lesson Stats) */
.profile-history-item {
  background: white;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  border: 2px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.profile-history-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--color-accent);
}

.profile-history-item.completed {
  border-color: #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.profile-history-item.in-progress {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.profile-history-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 1em;
  text-transform: capitalize;
}

.profile-history-meta {
  font-weight: 600;
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-history-item.completed .profile-history-meta {
  color: #16a34a;
}

.profile-history-item.in-progress .profile-history-meta {
  color: #d97706;
}
.performance-accuracy.high { color: var(--color-success); }
.performance-accuracy.medium { color: var(--color-warning); }
.performance-accuracy.low { color: var(--color-danger); }

.performance-accuracy.high {
  color: var(--color-success);
}

.performance-accuracy.medium {
  color: var(--color-warning);
}

.performance-accuracy.low {
  color: var(--color-danger);
}

.performance-count {
  color: var(--color-text-muted);
  font-size: 0.9em;
  font-weight: 600;
  min-width: 50px;
}
.mastery-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Dark mode overrides */
body.dark-mode .mastery-item {
  background: #132544;
  border-color: #1f3352;
}
body.dark-mode .performance-name { color: #e94560; }
body.dark-mode .mastery-subtitle { color: #cbd5f5; }

#timed-mode-display {
  display: flex;
  justify-content: space-around;
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.timed-stat {
  text-align: center;
}

.leaderboard-container {
  max-height: 500px;
  overflow-y: auto;
}

.leaderboard-container ol {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.leaderboard-panel {
  background: var(--color-surface-muted);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--color-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.leaderboard-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.leaderboard-subtitle {
  color: var(--color-text-muted);
  font-size: 0.9em;
}

.leaderboard-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.leaderboard-note {
  color: var(--color-text-muted);
  font-size: 0.85em;
}

#timedLeaderboardList li,
#accuracyLeaderboardList li {
  background: var(--color-surface-muted);
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--color-border);
}

.leaderboard-rank {
  font-weight: 700;
  color: var(--color-primary);
  margin-right: 10px;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-score {
  font-weight: 700;
  color: var(--color-primary);
}

.leaderboard-meta {
  color: var(--color-text-muted);
  font-size: 0.85em;
}

.profile-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6em;
  border: 2px solid var(--color-border);
}

.profile-name {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.2em;
}

.profile-card {
  background: var(--color-surface-muted);
  border-radius: 12px;
  padding: 22px 24px 20px 24px;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  box-sizing: border-box;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px 0 rgba(44,62,80,0.06);
}

.profile-card h3 {
  margin-bottom: 6px;
  font-size: 1.18em;
  color: var(--color-primary);
  font-weight: 700;
  align-self: flex-start;
}

.profile-card .profile-label {
  margin-top: 2px;
  margin-bottom: 0;
}

.profile-card .profile-input {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  font-size: 1em;
}

.profile-card .avatar-picker {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-soft);
  padding: 4px 2px;
}

.profile-card .btn-primary {
  align-self: stretch;
  margin-top: 10px;
  min-width: 0;
  width: 100%;
  font-size: 1em;
  padding: 10px 0;
  box-shadow: 0 2px 8px 0 rgba(44,62,80,0.04);
}

@media (max-width: 600px) {
  .profile-card {
    padding: 14px 4vw 16px 4vw;
  }
  .profile-card .avatar-picker {
    max-width: 100%;
  }
}


.profile-wide {
  margin-top: 16px;
}

.profile-wide .recent-unlocks {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.profile-label {
  font-weight: 600;
  color: var(--color-text-muted);
}

.profile-input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid var(--color-border);
}

.profile-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.profile-stat {
  font-weight: 600;
  color: var(--color-text);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-stat:last-child {
  border-bottom: none;
}

.profile-stat span {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1em;
}

.profile-history {
  margin-top: 8px;
}

.profile-history-list {
  margin: 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: 0.95em;
  display: grid;
  gap: 8px;
}

.profile-history-list .mastery-item,
.profile-history-list .lesson-stat-item {
  background: white;
  border-radius: 8px;
  padding: 14px;
  border: 2px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s ease;
}

.profile-history-list .mastery-item:hover,
.profile-history-list .lesson-stat-item:hover {
  border-color: var(--color-accent);
}
}

.dictionary-search {
  margin-bottom: 20px;
}

.dictionary-search input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-size: 1em;
}

.dictionary-search input:focus {
  outline: none;
  border-color: var(--color-primary);
}


/* ──────────────────────────────────────────────────────────────────────────
   DICTIONARY PAGE
   ────────────────────────────────────────────────────────────────────────── */

.dictionary-content {
  max-height: 600px;
  overflow-y: auto;
}

.dictionary-entry {
  background: var(--color-surface-muted);
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 10px;
  border-left: 4px solid var(--color-primary);
}

.dictionary-entry.fallacy {
  border-left-color: var(--color-danger);
}

.dictionary-term {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.dictionary-definition {
  line-height: 1.8;
  color: var(--color-text);
}

.dictionary-example {
  margin-top: 10px;
  padding: 10px;
  background: white;
  border-radius: 5px;
  font-style: italic;
  color: var(--color-text-muted);
}

/* Dark mode styles */
body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e0e0e0;
}

body.dark-mode .card {
  background: #0f3460;
  color: #e0e0e0;
}

body.dark-mode .settings-toggle {
  border-color: #e0e0e0;
}

body.dark-mode .settings-panel {
  background: #0f3460;
  color: #e0e0e0;
}

body.dark-mode .settings-title {
  color: #e0e0e0;
}

body.dark-mode .stats-bar {
  background: #0f3460;
}

body.dark-mode .progress-panel {
  background: #0f3460;
}

body.dark-mode .progress-avatar {
  background: #16213e;
  border-color: #2b3b55;
}

body.dark-mode .progress-bar {
  background: #1f2f4a;
  border-color: #2a3a55;
}

body.dark-mode .progress-xp {
  color: #cbd5f5;
}

body.dark-mode .level-up-toast {
  background: #0f3a2c;
  color: #d1fae5;
  border-color: #34d399;
}

body.dark-mode .stat-value {
  color: #e94560;
}

body.dark-mode .stat-label {
  color: #bbb;
}

body.dark-mode .mastery-item {
  background: #132544;
  border-color: #1f3352;
}

body.dark-mode .mastery-subtitle {
  color: #cbd5f5;
}

body.dark-mode .argument {
  background: #16213e;
  color: #e0e0e0;
  border-left-color: #e94560;
}

body.dark-mode .premise,
body.dark-mode .conclusion {
  color: #e0e0e0;
}

body.dark-mode .feedback.correct {
  background: #1e4d2b;
  border-color: var(--color-success);
  color: #d1fae5;
}

body.dark-mode .feedback.incorrect {
  background: #4d1e1e;
  border-color: var(--color-danger);
  color: #fee2e2;
}

body.dark-mode .mode-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .mode-card:focus {
  outline-color: var(--color-focus);
}

body.dark-mode .mode-card:hover {
  border-color: var(--color-accent);
}

body.dark-mode .mode-card h3 {
  color: #e2e8f0;
}

body.dark-mode .mode-description {
  color: #94a3b8;
}

body.dark-mode .mode-feature {
  background: #334155;
  color: #cbd5e1;
}

body.dark-mode .mode-example {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-left-color: var(--color-accent);
}

body.dark-mode .example-label {
  color: #94a3b8;
}

body.dark-mode .example-content {
  color: #e2e8f0;
}

body.dark-mode .symbolic-ex,
body.dark-mode .natural-ex {
  background: #0f172a;
}

body.dark-mode .example-name {
  color: var(--color-accent);
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .level-beginner {
  background: linear-gradient(135deg, #14532d, #166534);
  color: #86efac;
}

body.dark-mode .level-intermediate {
  background: linear-gradient(135deg, #78350f, #92400e);
  color: #fcd34d;
}

body.dark-mode .level-advanced {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  color: #fca5a5;
}

body.dark-mode .mode-stats {
  background: #0f172a;
}

body.dark-mode .stat-item {
  color: #94a3b8;
}

body.dark-mode .stat-item strong {
  color: var(--color-accent);
}

body.dark-mode .choice-btn {
  background: #16213e;
  color: #e0e0e0;
  border-color: #e94560;
}

body.dark-mode .choice-btn:hover {
  background: #1a1a2e;
}

body.dark-mode .dictionary-entry,
body.dark-mode .performance-item,
body.dark-mode .insight-card,
body.dark-mode .tutorial-section {
  background: #16213e;
  color: #e0e0e0;
}

body.dark-mode .leaderboard-panel,
body.dark-mode .recent-unlock-item,
body.dark-mode .profile-card {
  background: #16213e;
  border-color: #2b3b55;
  color: #e0e0e0;
}

body.dark-mode .achievement-card {
  background: #16213e;
  border-color: #2b3b55;
}

body.dark-mode .dictionary-search input {
  background: #16213e;
  color: #e0e0e0;
  border-color: #e94560;
}

body.dark-mode .filter-btn,
body.dark-mode .sort-select,
body.dark-mode .profile-input {
  background: #16213e;
  color: #e0e0e0;
  border-color: #2b3b55;
}

body.dark-mode .filter-btn.active {
  border-color: #e94560;
  color: #e94560;
}

body.dark-mode .dictionary-entry {
  border-left-color: #e94560;
}

body.dark-mode .dictionary-entry.fallacy {
  border-left-color: #ff6b6b;
}

body.dark-mode .app-error {
  background: #4d1e1e;
  border-color: var(--color-danger);
  color: #fee2e2;
}

body.dark-mode .dictionary-term,
body.dark-mode .performance-name {
  color: #e94560;
}

body.dark-mode .achievement-title {
  color: #e94560;
}

body.dark-mode .recent-unlock-title,
body.dark-mode .profile-stat {
  color: #e94560;
}

body.dark-mode .profile-history-list {
  color: #cbd5f5;
}

body.dark-mode .profile-avatar {
  background: #16213e;
  border-color: #2b3b55;
}

body.dark-mode .profile-name {
  color: #e94560;
}

body.dark-mode .skeleton,
body.dark-mode .skeleton-card {
  background: linear-gradient(
    90deg,
    #2a2a2a 0%,
    #3a3a3a 50%,
    #2a2a2a 100%
  );
  border-color: #444;
}

body.dark-mode .empty-state {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
}

body.dark-mode .empty-state-text {
  color: #94a3b8;
}

body.dark-mode .form-performance-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .form-performance-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .form-performance-title {
  color: #e2e8f0;
}

body.dark-mode .form-performance-meta {
  color: #94a3b8;
}

body.dark-mode .progress-bar {
  background: #334155;
}

body.dark-mode .mastery-header {
  background: linear-gradient(135deg, #4c1d95 0%, #581c87 100%);
}

body.dark-mode .form-mastery-item {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .form-mastery-item:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .form-mastery-item.tier-excellent {
  border-color: #166534;
  background: linear-gradient(135deg, #14532d 0%, #052e16 100%);
}

body.dark-mode .form-mastery-item.tier-good {
  border-color: #1e40af;
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
}

body.dark-mode .form-mastery-item.tier-average {
  border-color: #92400e;
  background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
}

body.dark-mode .form-mastery-item.tier-needs-work {
  border-color: #991b1b;
  background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
}

body.dark-mode .form-mastery-item.tier-developing {
  border-color: #0369a1;
  background: linear-gradient(135deg, #164e63 0%, #083344 100%);
}

body.dark-mode .form-mastery-name {
  color: #e2e8f0;
}

body.dark-mode .form-mastery-rank,
body.dark-mode .form-mastery-count {
  color: #94a3b8;
}

body.dark-mode .mastery-tier-title {
  background: #334155;
  color: #e2e8f0;
}

body.dark-mode .mastery-tier-title.tier-excellent {
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
  color: #86efac;
}

body.dark-mode .mastery-tier-title.tier-good {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #93c5fd;
}

body.dark-mode .mastery-tier-title.tier-average {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
  color: #fcd34d;
}

body.dark-mode .mastery-tier-title.tier-needs-work {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  color: #fca5a5;
}

body.dark-mode .mastery-tier-title.tier-developing {
  background: linear-gradient(135deg, #164e63 0%, #0369a1 100%);
  color: #7dd3fc;
}

body.dark-mode .mastery-tier-subtitle {
  color: #94a3b8;
}

body.dark-mode .form-mastery-hint {
  border-top-color: #475569;
}

body.dark-mode .mastery-stat {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .section-description {
  color: #94a3b8;
}

body.dark-mode .section-hint {
  color: #94a3b8;
}

body.dark-mode .teaching-moment {
  background: #2d2416;
  border-color: var(--color-warning);
}

body.dark-mode .teaching-moment h4 {
  color: #fbbf24;
}

body.dark-mode .modal-card {
  background: #0f3460;
  color: #e0e0e0;
}

body.dark-mode .modal-input {
  background: #16213e;
  color: #e0e0e0;
  border-color: #2b3b55;
}

body.dark-mode .modal-message {
  color: #cbd5f5;
}

body.dark-mode .achievement-toast {
  background: #0f3a2c;
  border-color: #34d399;
}

body.dark-mode .achievement-toast-title,
body.dark-mode .achievement-toast-name {
  color: #d1fae5;
}


/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Focus styles for accessibility */
button:focus,
input:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

body.dark-mode button:focus,
body.dark-mode input:focus {
  outline-color: #e94560;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

body.reduced-motion .achievement-confetti {
  display: none;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes toastPop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pulse {
  animation: pulse 0.35s ease;
}

/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [LESSONS] - LESSONS MODULE STYLES                                      ║
   ║  Navigation, content, quizzes, and lesson-specific overrides            ║
   ╚══════════════════════════════════════════════════════════════════════════╝
   
   This section contains all styling for the lessons module.
   
   Structure:
   - Lesson-specific overrides (matching exercise colors)
   - .lessons-nav: Navigation buttons for lesson selection
   - .lesson-content: Main lesson container
   - .lesson-section: Content sections within lessons
   - .lesson-quiz-section: Quiz container styling
   
   See also:
   - [MATCHING] section for base matching exercise styles
   - Quiz styles within this section
   
   All lessons share these base styles for consistency.
   Divergence only where needed (e.g., matching vs multiple choice).
   ============================================================================ */

/* ──────────────────────────────────────────────────────────────────────────
   LESSON-SPECIFIC OVERRIDES
   ────────────────────────────────────────────────────────────────────────── */

/* Lessons 5, 6, 7: Universal Green Styling for Matching Exercises
   Note: Lesson 3 uses color-coded labels via data-value attributes */
.matching-exercise .match-label:not([data-value="fulfilled"]):not([data-value="broken"]):not([data-value="vacuous3"]):not([data-value="vacuous4"]) {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}

.matching-exercise .check-matching {
  background: var(--color-success);
  color: #fff;
}

.matching-exercise .check-matching:hover {
  background: var(--color-success-dark);
}


/* ──────────────────────────────────────────────────────────────────────────
   LESSON NAVIGATION
   ────────────────────────────────────────────────────────────────────────── */

.lessons-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--color-surface-muted);
  border-radius: 10px;
}

.lessons-intro-section {
  margin-bottom: 30px;
}

.lessons-nav-group {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  padding: 8px;
  background: var(--color-surface-soft);
  border-radius: 6px;
}

.lessons-nav-group--spaced {
  margin: 16px 0 8px 0;
}

.lessons-nav-title {
  color: var(--color-primary);
  font-size: 0.9em;
}

.lesson-btn--full {
  grid-column: 1 / -1;
}

.dictionary-title {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

.lessons-intro {
  font-size: 1.08em;
  line-height: 1.6;
  margin-bottom: 10px;
}

.lessons-intro-highlight {
  color: var(--color-primary);
  font-weight: 600;
}

.lessons-how {
  background: var(--color-surface-soft);
  border-left: 4px solid var(--color-primary);
  padding: 12px 18px;
  border-radius: 7px;
  margin-bottom: 10px;
}

.lessons-how-title {
  font-size: 1.05em;
  color: var(--color-primary);
}

.lessons-how-list {
  margin: 8px 0 0 18px;
  padding: 0;
}

.lessons-how-note {
  display: block;
  margin-top: 8px;
  color: var(--color-text-muted);
  font-size: 0.98em;
}

.lesson-btn {
  padding: 12px 16px;
  border: 2px solid var(--color-primary);
  background: white;
  color: var(--color-primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
  transition: all 0.3s;
  text-align: left;
}

.lesson-btn:hover {
  background: var(--color-surface-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.lesson-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: #1a252f;
}

.lesson-nav-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.lesson-nav-btn {
  flex: 1;
  border: 2px solid var(--color-primary);
  background: white;
  color: var(--color-primary);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.lesson-nav-btn:hover {
  background: var(--color-surface-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.lesson-nav-btn--next {
  border-color: #111;
  color: #111;
}

.lesson-nav-btn--next:hover {
  background: rgba(17, 17, 17, 0.08);
}

.lesson-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
}

.lesson-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--color-primary);
}

.lesson-header h3 {
  font-size: 1.8em;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.lesson-subtitle {
  font-size: 1.1em;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.lesson-goal {
  font-size: 0.95em;
  color: #555;
  padding: 12px;
  background: #e3f2fd;
  border-left: 4px solid var(--color-info);
  border-radius: 4px;
}

.lesson-section {
  margin: 25px 0;
  padding: 20px;
  background: #f5f7fa;
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
}

.lesson-section h4 {
  color: var(--color-primary);
  font-size: 1.2em;
  margin-bottom: 15px;
  margin-top: 0;
}


.truth-values-label {
  margin-top: 10px;
}

.quiz-feedback-text {
  margin: 0;
}

.quiz-feedback-text--correct {
  color: #27ae60;
}

.quiz-feedback-text--incorrect {
  color: #e74c3c;
}

.lesson-section ul {
  margin-left: 20px;
}

.lesson-section li {
  margin: 8px 0;
  line-height: 1.6;
}

/* Prevent awkward word breaks in lesson content */
.lesson-section,
.lesson-section p,
.or-type p {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

/* Quiz styles */
.lesson-quiz-section {
  background: var(--color-attention-bg);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--color-attention-border);
  margin: 25px 0;
}

.lesson-quiz-section h4 {
  color: #856404;
  margin-top: 0;
}

.lesson-quiz-item {
  background: white;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid var(--color-border-strong);
}

.quiz-question {
  font-family: inherit;
  font-size: 1em;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 15px;
}

.lesson-quiz-section .argument,
.lesson-quiz-section .premise,
.lesson-quiz-section .conclusion {
  font-family: inherit;
  font-size: 1em;
  font-weight: 500;
}

/* ========================================
   QUIZ STYLES
   ======================================== 
   
   Quiz styles are shared across all lesson quizzes.
   Includes:
   - Multiple choice buttons (.quiz-option)
   - Feedback displays (.quiz-feedback)
   - Quiz container (.lesson-quiz-section)
   - Question display (.quiz-question)
   
   Used in all lesson quiz sections for consistent UX.
   ======================================== */

.quiz-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.quiz-option {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #95a5a6;
  background: white;
  color: var(--color-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  transition: all 0.3s;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--color-accent);
  background: var(--color-surface-soft);
  transform: translateY(-2px);
}

.quiz-option:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.quiz-option.correct-answer {
  background: #27ae60;
  color: white;
  border-color: #27ae60;
}

#lesson8-next {
  margin-top: 12px;
}

.quiz-feedback {
  padding: 16px 20px;
  border-radius: 12px;
  margin-top: 16px;
  font-size: 0.95em;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
}

.quiz-feedback.success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: #27ae60;
  color: #155724;
}

.quiz-feedback.error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-color: #e74c3c;
  color: #721c24;
}

.quiz-feedback p {
  margin: 0;
}

.quiz-feedback strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05em;
}

/* Quiz Summary and Reset */
.quiz-summary {
  margin: 30px 0 20px;
  padding: 25px;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.quiz-summary-header h3 {
  margin: 0 0 20px;
  color: #0369a1;
  font-size: 1.5em;
}

.quiz-summary-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stat-label {
  font-size: 0.9em;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: #0f172a;
}

.stat-correct {
  color: #16a34a;
}

.stat-incorrect {
  color: #dc2626;
}

.quiz-summary button {
  margin-top: 10px;
}

.quiz-score-text {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 15px;
}

.quiz-score-percent {
  color: var(--color-accent);
  font-size: 1.4em;
}

.quiz-reset-btn {
  background: white;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 8px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.quiz-reset-btn:hover {
  background: var(--color-primary);
  color: white;
}

body.dark-mode .quiz-reset-btn {
  background: transparent;
  color: white;
  border-color: var(--color-accent);
}

body.dark-mode .quiz-reset-btn:hover {
  background: var(--color-accent);
  color: white;
}

.lesson-status-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: 600;
  text-transform: uppercase;
  vertical-align: middle;
}

.lesson-status-tag.completed {
  background: #dcfce7;
  color: #166534;
}

.lesson-status-tag.in-progress {
  background: #fef9c3;
  color: #854d0e;
}

.lesson-status-tag.not-started {
  background: #f1f5f9;
  color: #475569;
}

body.dark-mode .lesson-status-tag.completed {
  background: #064e3b;
  color: #34d399;
}

body.dark-mode .lesson-status-tag.in-progress {
  background: #713f12;
  color: #facc15;
}

body.dark-mode .lesson-status-tag.not-started {
  background: #1e293b;
  color: #94a3b8;
}

/* Comparison box for lesson content */
.comparison-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.comparison-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid var(--color-surface-soft);
}

.comparison-item h4 {
  color: var(--color-primary);
  font-size: 1em;
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid #95a5a6;
  padding-bottom: 8px;
}

.comparison-item p {
  font-size: 0.92em;
  line-height: 1.5;
}

/* Truth table styles */
.truth-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.truth-table--compact {
  width: 60%;
  margin: 8px auto;
}

.tooltip .truth-table {
  background-color: var(--color-surface-muted);
  color: var(--color-text);
}

.truth-table thead {
  background: var(--color-primary);
  color: white;
}

.truth-table th,
.truth-table td {
  padding: 12px;
  text-align: center;
  border: 1px solid var(--color-surface-soft);
}

.truth-table tbody tr:nth-child(even) {
  background: var(--color-surface-muted);
}

.truth-table tbody tr:hover {
  background: #e8f4f8;
}

.truth-table td {
  font-weight: 500;
}

/* Important boxes */
.lesson-important {
  background: #e7f3ff;
  border-left: 4px solid var(--color-info);
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  font-size: 0.95em;
}

.lesson-feedback {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 20px;
  border-radius: 8px;
  margin: 25px 0;
  font-size: 0.95em;
  line-height: 1.6;
}


/* Or comparison */
.or-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.or-type {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid var(--color-surface-soft);
}

.or-type h4 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 12px;
}

.or-type p {
  font-size: 0.92em;
  line-height: 1.6;
  margin: 8px 0;
}


/* Argument display within lessons */
.lesson-content .argument {
  background: white;
  padding: 15px;
  border-left: 4px solid var(--color-primary);
  border-radius: 6px;
  margin: 15px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
}

.lesson-content .premise,
.lesson-content .conclusion {
  padding: 8px;
  margin: 5px 0;
  display: block;
}

.lesson-content .conclusion {
  font-weight: bold;
  color: var(--color-primary);
  border-top: 2px solid var(--color-surface-soft);
  padding-top: 12px;
}

.lesson-content .conclusion::before {
  content: none;
}



/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [MATCHING] - MATCHING EXERCISE STYLES                                  ║
   ║  Drag-and-drop matching quiz components for lessons                     ║
   ╚══════════════════════════════════════════════════════════════════════════╝
   
   Matching exercises appear in multiple lessons:
   - Lesson 3: Truth table matching (uses color-coded labels)
   - Lesson 5: Contrapositive matching (green labels)
   - Lesson 6: Negation matching (green labels)
   - Lesson 7: Translation matching (green labels)
   
   Base styles provide the structure and behavior.
   Color overrides in [LESSONS] section provide unified green styling.
   ============================================================================ */

.matching-exercise {
  margin: 20px 0;
}

.match-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--color-surface-muted);
  border-radius: 8px;
  justify-content: center;
}

/* Base match label styling - provides fallback blue theme */
.match-label {
  padding: 10px 15px;
  background: white;
  border: 2px solid var(--color-accent);
  border-radius: 5px;
  cursor: move;
  user-select: none;
  transition: all 0.3s;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--color-primary);
}

.match-label:hover {
  background: #e3f2fd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.match-label.selected {
  background: var(--color-accent);
  color: white;
  outline: 3px solid #f39c12;
  outline-offset: 2px;
  transform: scale(1.05);
}

/* Lesson 3 specific: Color-coded labels for truth table rows */
.match-label[data-value="fulfilled"] {
  background: #27ae60;
  border-color: #27ae60;
  color: white;
}

.match-label[data-value="broken"] {
  background: #e74c3c;
  border-color: #e74c3c;
  color: white;
}

.match-label[data-value="vacuous3"],
.match-label[data-value="vacuous4"] {
  background: #9b59b6;
  border-color: #9b59b6;
  color: white;
}


.match-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  margin: 15px 0;
  padding: 15px;
  background: white;
  border: 2px solid var(--color-surface-soft);
  border-radius: 8px;
  transition: all 0.3s;
}


.match-dropzone {
  min-width: 140px;
  min-height: 40px;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--color-surface-muted);
  border: 2px dashed #bdc3c7;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  cursor: pointer;
}

.match-dropzone:hover {
  border-color: var(--color-accent);
  background: #e3f2fd;
}

.match-dropzone.active {
  border-color: var(--color-accent);
  background: #e3f2fd;
}

.match-dropzone .match-label {
  cursor: default;
  font-size: 0.85em;
  padding: 0.4rem 0.7rem;
  margin: 0;
}

.check-matching {
  margin-top: 20px;
  padding: 12px 30px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
}

.check-matching:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}


.match-item.correct {
  border-color: #27ae60;
  background: #d4edda;
}

.match-item.incorrect {
  border-color: #e74c3c;
  background: #fadbd8;
}

/* Dark mode matching exercise */
body.dark-mode .match-labels {
  background: var(--color-primary-dark);
}

body.dark-mode .match-label {
  background: var(--color-primary);
  border-color: #5dade2;
  color: var(--color-surface-soft);
}

body.dark-mode .match-label.selected {
  background: #5dade2;
  color: var(--color-primary);
}

body.dark-mode .match-item {
  background: var(--color-primary);
  border-color: #555;
  color: var(--color-surface-soft);
}

body.dark-mode .match-dropzone {
  background: var(--color-primary-dark);
  border-color: #7f8c8d;
}

body.dark-mode .match-dropzone:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

body.dark-mode .match-dropzone.active {
  border-color: #f39c12;
  background-color: rgba(243, 156, 18, 0.15);
}

body.dark-mode .check-matching {
  background: #4a5568;
}

body.dark-mode .check-matching:hover {
  background: #5a6a7a;
}


body.dark-mode .match-item.correct {
  background: #1e5631;
  border-color: #52b788;
}

body.dark-mode .match-item.incorrect {
  background: #5c1e24;
  border-color: #e74c3c;
}


/* Dark mode for lessons */
body.dark-mode .lesson-btn {
  background: var(--color-primary-dark);
  color: white;
  border-color: var(--color-primary);
}

body.dark-mode .lesson-btn:hover {
  background: #405d7e;
  border-color: var(--color-accent);
}

body.dark-mode .lesson-btn.active {
  background: var(--color-accent);
  color: white;
}

body.dark-mode .lesson-content {
  background: var(--color-primary);
  color: white;
}

body.dark-mode .lesson-section {
  background: var(--color-primary-dark);
  color: white;
  border-left-color: var(--color-accent);
}

body.dark-mode .lesson-section h4 {
  color: var(--color-surface-soft);
}

body.dark-mode .lesson-quiz-section {
  background: #3f3f1f;
  color: white;
  border-left-color: #f39c12;
}

body.dark-mode .lesson-quiz-section h4 {
  color: #f39c12;
}

body.dark-mode .lesson-quiz-item {
  background: var(--color-primary-dark);
  color: white;
  border-color: #555;
}

body.dark-mode .quiz-question {
  color: var(--color-surface-soft);
}

body.dark-mode .quiz-option {
  background: var(--color-primary-dark);
  color: var(--color-surface-soft);
  border-color: #555;
}

body.dark-mode .quiz-option:hover:not(:disabled) {
  background: #3f5a7f;
  border-color: var(--color-accent);
}

body.dark-mode .comparison-item {
  background: var(--color-primary-dark);
  border-color: #555;
  color: white;
}

body.dark-mode .comparison-item h4 {
  color: var(--color-surface-soft);
  border-bottom-color: #555;
}

body.dark-mode .truth-table {
  background: var(--color-primary-dark);
  color: white;
}

body.dark-mode .truth-table thead {
  background: #1a252f;
  color: white;
}

body.dark-mode .truth-table td {
  border-color: #555;
}

body.dark-mode .truth-table tbody tr:nth-child(even) {
  background: #3f4f63;
}

body.dark-mode .truth-table tbody tr:hover {
  background: #455a72;
}

body.dark-mode .lesson-important {
  background: #1f3f5f;
  color: white;
  border-left-color: var(--color-accent);
}

body.dark-mode .lesson-feedback {
  background: #1f3f1f;
  color: white;
  border-left-color: #27ae60;
}


body.dark-mode .or-type {
  background: var(--color-primary-dark);
  border-color: #555;
  color: white;
}

body.dark-mode .or-type h4 {
  color: var(--color-surface-soft);
}


body.dark-mode .lesson-content .argument {
  background: var(--color-primary-dark);
  border-left-color: var(--color-accent);
  color: white;
}

/* Notation Overlay Styles */
#notationPage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 2000;
}

#notationPage.hidden {
  display: none !important;
}

.notation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.notation-modal {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 40px;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: white;
  border-radius: 14px;
  padding: 28px 30px;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: slideUp 0.3s ease-out;
}

.modal-header h2 {
  margin-bottom: 6px;
  color: var(--color-primary);
}

.modal-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 18px;
}

.modal-body {
  display: grid;
  gap: 8px;
}

.modal-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid var(--color-border);
  font-size: 1em;
}

.modal-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.modal-message {
  margin-top: 10px;
  color: var(--color-text-muted);
  min-height: 18px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.achievement-toast {
  position: fixed;
  left: 20px;
  right: 20px;
  top: 20px;
  background: #ecfdf3;
  border: 2px solid var(--color-success);
  border-radius: 14px;
  padding: 14px 18px;
  z-index: 2200;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: toastPop 0.25s ease-out;
}

.achievement-toast.hidden {
  display: none;
}

.achievement-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.achievement-toast-icon {
  font-size: 1.6em;
}

.achievement-toast-title {
  font-weight: 700;
  color: #065f46;
}

.achievement-toast-name {
  font-weight: 600;
  color: #065f46;
}

.achievement-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.confetti {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 14px;
  opacity: 0.85;
  animation: confettiFall 1.6s ease-in infinite;
}

.confetti:nth-child(1) { left: 10%; background: #f87171; animation-delay: 0s; }
.confetti:nth-child(2) { left: 25%; background: #f59e0b; animation-delay: 0.2s; }
.confetti:nth-child(3) { left: 45%; background: #34d399; animation-delay: 0.4s; }
.confetti:nth-child(4) { left: 60%; background: #60a5fa; animation-delay: 0.1s; }
.confetti:nth-child(5) { left: 75%; background: #a78bfa; animation-delay: 0.3s; }
.confetti:nth-child(6) { left: 90%; background: #f472b6; animation-delay: 0.5s; }

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(140px) rotate(180deg); opacity: 0; }
}

.notation-modal h2 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 30px;
  font-size: 1.8em;
}

.notation-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.notation-close:hover {
  color: var(--color-primary);
}

.notation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.notation-card {
  border: 2px solid var(--color-surface-soft);
  border-radius: 8px;
  padding: 20px;
  background: var(--color-surface-muted);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
/* Flex column for notation content */
.notation-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.notation-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
  transform: translateY(-2px);
}

.notation-symbol {
  font-size: 3em;
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 15px;
  font-weight: bold;
}

.notation-content h3 {
  color: var(--color-primary-dark);
  margin: 0 0 10px 0;
  font-size: 1.1em;
}

.notation-content p {
  color: #555;
  margin: 8px 0;
  line-height: 1.6;
  font-size: 0.95em;
}

.notation-truth-table {
  margin: 15px 0;
  display: flex;
  justify-content: center;
}

.mini-truth-table {
  border-collapse: collapse;
  margin: 10px auto;
  background: white;
}

.mini-truth-table--compact {
  width: 50%;
  margin: 8px auto;
}

.mini-truth-table th,
.mini-truth-table td {
  border: 1px solid #bbb;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.9em;
  color: var(--color-text);
}

.mini-truth-table th {
  background: var(--color-border);
  font-weight: bold;
}

.notation-example {
  background: var(--color-attention-bg);
  padding: 12px;
  border-radius: 4px;
  border-left: 4px solid var(--color-attention-border);
  margin: auto 0 0 0 !important;
  font-size: 0.9em;
  color: var(--color-text);
}

/* Dark mode styles for notation */
body.dark-mode .notation-modal {
  background: var(--color-primary);
  color: var(--color-surface-soft);
}

body.dark-mode .notation-modal h2 {
  color: var(--color-surface-soft);
}

body.dark-mode .notation-close {
  color: #bdc3c7;
}

body.dark-mode .notation-close:hover {
  color: var(--color-surface-soft);
}

body.dark-mode .notation-card {
  background: var(--color-primary-dark);
  border-color: #555;
}

body.dark-mode .notation-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

body.dark-mode .notation-symbol {
  color: var(--color-surface-soft);
}

body.dark-mode .notation-content h3 {
  color: var(--color-surface-soft);
}

body.dark-mode .notation-content p {
  color: #bdc3c7;
}

body.dark-mode .mini-truth-table th {
  background: #555;
  color: var(--color-surface-soft);
}

body.dark-mode .mini-truth-table th,
body.dark-mode .mini-truth-table td {
  border-color: #555;
  color: var(--color-surface-soft);
}

body.dark-mode .notation-example {
  background: #455a64;
  border-left-color: #8bc34a;
  color: var(--color-surface-soft);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [RESPONSIVE] - MOBILE & TABLET BREAKPOINTS                             ║
   ║  Responsive design for various screen sizes                             ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ========== MOBILE RESPONSIVE STYLES ========== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    max-width: 100%;
  }

  .header h1 {
    font-size: 1.8em;
  }

  .header p {
    font-size: 1em;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5em;
  }

  .card {
    padding: 20px;
    border-radius: 10px;
  }

  .mode-selection {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mode-card {
    padding: 20px;
    gap: 14px;
  }

  .mode-card-header {
    flex-direction: column;
    gap: 8px;
  }

  .mode-icon {
    font-size: 3em;
  }

  .mode-card h3 {
    font-size: 1.4em;
  }

  .mode-features {
    gap: 6px;
  }

  .mode-feature {
    font-size: 0.75em;
    padding: 5px 10px;
  }

  .mode-stats {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .example-content {
    font-size: 0.85em;
  }

  .difficulty-levels {
    gap: 4px;
  }

  .level {
    font-size: 0.8em;
    padding: 5px 10px;
  }

  .resource-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .settings-panel {
    top: 80px;
    right: 10px;
    width: min(320px, 95vw);
  }

  .resource-btn {
    padding: 10px 15px;
    font-size: 0.9em;
  }

  .difficulty-selector {
    flex-direction: column;
    gap: 8px;
  }

  .multiple-choice-container {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    padding: 12px 25px;
    font-size: 1em;
  }

  .difficulty-btn {
    width: 100%;
    padding: 12px;
  }

  .argument {
    padding: 15px;
    font-size: 1em;
  }

  .choice-btn {
    padding: 12px;
    font-size: 0.95em;
  }

  .insights-summary {
    grid-template-columns: 1fr;
  }

  .lessons-nav {
    grid-template-columns: 1fr;
  }

  .comparison-box {
    grid-template-columns: 1fr;
  }

  .or-comparison {
    grid-template-columns: 1fr;
  }

  .quiz-buttons {
    flex-direction: column;
  }

  .lesson-btn {
    padding: 12px;
    font-size: 0.95em;
  }

  .lesson-content {
    padding: 20px;
  }

  .insights-summary {
    grid-template-columns: 1fr;
  }

  .tutorial-section {
    padding: 15px;
  }

  /* Mastery & Performance responsive */
  .form-performance-container {
    grid-template-columns: 1fr;
  }

  .loading-skeleton {
    grid-template-columns: 1fr;
  }

  .mastery-overview {
    grid-template-columns: 1fr;
  }

  .section-hint {
    padding-left: 0;
    text-align: center;
  }

  .section-header .section-subtitle {
    justify-content: center;
    text-align: center;
  }

  .form-performance-card {
    margin-bottom: 12px;
  }

  .empty-state {
    padding: 40px 20px;
  }

  .empty-state-icon {
    font-size: 2.5em;
  }

  .notation-modal {
    max-width: 95vw;
    max-height: 90vh;
    padding: 20px;
    overflow-y: auto;
  }

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

  .notation-symbol {
    font-size: 2em;
  }

  .truth-table {
    font-size: 0.85em;
    overflow-x: auto;
  }

  .reference-content {
    max-height: 400px;
  }

  .reference-tabs {
    flex-direction: column;
    gap: 5px;
  }

  .tab-btn {
    width: 100%;
  }

  .notation .tooltip {
    width: 200px;
    margin-left: -100px;
    font-size: 0.75em;
  }

  .match-item {
    grid-template-columns: 1fr;
  }

  .match-dropzone {
    min-width: 100%;
  }

  /* Make tables scrollable on mobile */
  .truth-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5em;
  }

  .stat-value {
    font-size: 1.3em;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9em;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .mode-card {
    padding: 20px;
    gap: 12px;
  }

  .mode-card-header {
    flex-direction: column;
    gap: 6px;
  }

  .mode-icon {
    font-size: 2.5em;
  }

  .mode-card h3 {
    font-size: 1.3em;
  }

  .mode-badge {
    font-size: 0.7em;
  }

  .mode-features {
    flex-direction: column;
    gap: 4px;
  }

  .mode-feature {
    font-size: 0.7em;
    padding: 4px 8px;
    width: 100%;
  }

  .mode-stats {
    padding: 10px;
  }

  .stat-item strong {
    font-size: 1.2em;
  }

  .mode-btn {
    padding: 12px 24px;
    font-size: 0.95em;
  }

  .resource-buttons {
    grid-template-columns: 1fr;
  }

  .feedback {
    font-size: 0.9em;
  }

  .quiz-option {
    width: 100%;
  }
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [PRINT] - PRINT-FRIENDLY STYLES                                        ║
   ║  Optimized styles for printing lessons and reference materials         ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* ========== PRINT STYLES ========== */
@media print {
  /* Hide interactive elements */
  button,
  .back-btn,
  .resource-buttons,
  .difficulty-selector,
  .stats-bar,
  .hidden,
  .notation-close,
  #timed-mode-display,
  #timed-feedback,
  #nextButton,
  #multipleChoiceButtons,
  .mode-selection,
  .quiz-buttons,
  .lesson-btn,
  .tab-btn {
    display: none !important;
  }

  /* Reset page styling for print */
  body {
    background: white;
    color: black;
    padding: 0;
    margin: 0;
  }

  .container {
    max-width: 100%;
  }

  .header {
    color: black;
    margin-bottom: 20px;
    border-bottom: 2px solid black;
    padding-bottom: 10px;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }

  /* Make content readable */
  .lesson-content,
  .tutorial-section,
  .dictionary-content,
  .reference-content {
    font-size: 11pt;
    line-height: 1.5;
  }

  /* Format arguments nicely */
  .argument {
    border: 2px solid black;
    padding: 15px;
    background: #f9f9f9;
    page-break-inside: avoid;
  }

  .premise {
    border-left: 3px solid var(--color-text);
    padding-left: 10px;
    margin: 5px 0;
  }

  .conclusion {
    border-left: 3px solid #000;
    padding-left: 10px;
    margin-top: 10px;
    font-weight: bold;
  }

  /* Format feedback for print */
  .feedback {
    border: 2px solid var(--color-text);
    padding: 15px;
    page-break-inside: avoid;
  }

  /* Format reference items */
  .dictionary-entry {
    page-break-inside: avoid;
    margin-bottom: 15px;
    border-left: 3px solid var(--color-text);
    padding-left: 10px;
  }

  /* Truth tables */
  .truth-table,
  .mini-truth-table {
    border: 1px solid black;
    page-break-inside: avoid;
  }

  .truth-table th,
  .truth-table td,
  .mini-truth-table th,
  .mini-truth-table td {
    border: 1px solid black;
    padding: 5px;
  }

  /* Add page breaks between major sections */
  .lesson-section,
  .tutorial-section {
    page-break-after: auto;
    page-break-inside: avoid;
  }

  /* Print URLs for reference */
  a[href]:not([href^="#"])::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  /* Notation tooltips - show inline for print */
  .notation .tooltip {
    position: static !important;
    display: inline !important;
    opacity: 1 !important;
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 2px 5px;
    margin-left: 5px;
    font-size: 0.85em;
  }

  /* Page headers/footers */
  @page {
    margin: 2cm;
  }

  /* Add document title to each page */
  .header h1::after {
    content: " - Critical Thinking Practice";
  }
}


/* ╔══════════════════════════════════════════════════════════════════════════╗
   ║  [UTILITIES] - HELPER CLASSES & ANIMATIONS                              ║
   ║  Progress indicators, completion badges, and utility classes            ║
   ╚══════════════════════════════════════════════════════════════════════════╝ */

/* Lesson progress indicators */
.lesson-btn.completed {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: white;
  border-color: #27ae60;
}

.lesson-btn.completed:hover {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.lesson-btn.in-progress {
  background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
  color: #2c3e50;
  border-color: #f39c12;
}

.lesson-btn.in-progress:hover {
  background: linear-gradient(135deg, #f39c12 0%, #d4ac0d 100%);
}

.lesson-btn.in-progress .completion-badge {
    color: #2c3e50;
}

.completion-badge {
  display: inline-block;
  margin-left: 10px;
  font-weight: bold;
  font-size: 1.2em;
  color: white;
}

/* Explanation panel (dark mode) */
body.dark-mode .explanation {
  background: var(--color-primary-dark);
  border-left-color: #5dade2;
  color: var(--color-surface-soft);
}


/* 
   PROFILE PAGE
    */

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.profile-avatar-large {
  font-size: 4rem;
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  background: #f5f5f5;
  margin-bottom: 0.5rem;
}

.profile-name-large {
  font-size: 2.2rem;
  font-weight: bold;
  color: #2c3e50;
  text-align: center;
  letter-spacing: 0.02em;
}

