/* ================================================================
   enhancements.css — 50 CSS improvements for RoboCAD Academy
   Loaded after styles.css and animations.css
   ================================================================ */

/* ===== 1. Custom Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(226, 162, 71, 0.2);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(226, 162, 71, 0.35); }
* { scrollbar-width: thin; scrollbar-color: rgba(226, 162, 71, 0.2) var(--bg); }

/* ===== 2. Text Selection ===== */
::selection {
  background: rgba(226, 162, 71, 0.25);
  color: var(--text);
}

/* ===== 3. Focus-Visible Outlines ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible { outline-offset: 2px; }

/* ===== 4. Enhanced Code Blocks ===== */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(226, 162, 71, 0.08);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(226, 162, 71, 0.12);
}

pre {
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  position: relative;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.7;
}

body.light-theme code {
  background: rgba(226, 162, 71, 0.06);
}

/* ===== 5. Enhanced Tables ===== */
.info-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.info-table thead th {
  background: rgba(226, 162, 71, 0.08);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.info-table tbody tr {
  transition: background var(--dur-fast, 250ms) ease;
}

.info-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.info-table tbody tr:hover {
  background: rgba(226, 162, 71, 0.06);
}

.info-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

body.light-theme .info-table thead th { background: rgba(226, 162, 71, 0.05); }
body.light-theme .info-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.02); }
body.light-theme .info-table tbody tr:hover { background: rgba(226, 162, 71, 0.04); }

/* ===== 6. Scroll-Offset for Anchors ===== */
:target { scroll-margin-top: 80px; }
[id] { scroll-margin-top: 80px; }

/* ===== 7. Print Styles ===== */
@media print {
  nav, footer, .back-to-top, .keyboard-hint, .ambient-orbs, .model-hint,
  .circuit-divider, .breadcrumb, .module-nav-bottom, .complete-btn,
  .reading-progress, #progress-bar { display: none !important; }

  body, body.light-theme {
    background: #fff !important;
    color: #111 !important;
  }

  .module-page { padding-top: 20px !important; }

  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a { color: #111 !important; text-decoration: underline; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; color: #666; }

  .concept-block, .tip-box, .formula-box {
    border: 1px solid #ccc !important;
    background: #f8f8f8 !important;
    break-inside: avoid;
  }

  model-viewer { display: none !important; }
  .model-viewer-wrap::after {
    content: '[3D Model - view online]';
    display: block;
    text-align: center;
    padding: 40px;
    background: #f0f0f0;
    color: #666;
  }
}

/* ===== 8. Link Hover Transitions ===== */
.module-page a:not(.btn):not(.back-link):not(.breadcrumb a) {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.3s var(--ease, ease);
}

.module-page a:not(.btn):not(.back-link):not(.breadcrumb a):hover {
  background-size: 100% 1px;
}

/* ===== 9. Enhanced List Styling ===== */
.content-section ul:not(.experiment-tasks):not(.feature-list):not(.nav-links),
.concept-block ul {
  list-style: none;
  padding-left: 0;
}

.content-section ul:not(.experiment-tasks):not(.feature-list):not(.nav-links) li,
.concept-block ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.content-section ul:not(.experiment-tasks):not(.feature-list):not(.nav-links) li::before,
.concept-block ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.content-section ol {
  padding-left: 24px;
}

.content-section ol li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.content-section ol li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* ===== 10. Blockquote Styling ===== */
blockquote {
  border-left: 4px solid var(--accent);
  margin: 24px 0;
  padding: 16px 24px;
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

blockquote strong { color: var(--text); font-style: normal; }

/* ===== 11. HR/Divider Variants ===== */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 32px 0;
}

.divider-accent {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ===== 12. Enhanced Search Input ===== */
input[type="text"],
input[type="search"],
.glossary-search input {
  background: var(--surface) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

input[type="text"]:focus,
input[type="search"]:focus,
.glossary-search input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(226, 162, 71, 0.1) !important;
  outline: none !important;
}

/* ===== 13. Loading Spinner ===== */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

/* ===== 14. Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeletonWave 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; width: 80%; margin-bottom: 10px; }
.skeleton-heading { height: 24px; width: 60%; margin-bottom: 16px; }
.skeleton-card { height: 180px; }

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

/* ===== 15. Gradient Text Utility ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: linear-gradient(135deg, var(--yellow), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== 16. Card Variants ===== */
.card-raised {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-flat {
  background: var(--surface);
  border: none;
}

.card-outlined {
  background: transparent;
  border: 1.5px solid var(--border);
}

/* ===== 17. Badge Variants ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34, 211, 160, 0.2); }
.badge-warning { background: rgba(251, 191, 36, 0.1); color: var(--yellow); border: 1px solid rgba(251, 191, 36, 0.2); }
.badge-danger  { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.2); }
.badge-info    { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(226, 162, 71, 0.2); }

/* ===== 18. Pulsing Active Dot ===== */
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 160, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(34, 211, 160, 0); }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulseDot 2s infinite;
}

/* ===== 19. Custom Checkbox ===== */
.custom-check {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.custom-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.custom-check:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== 20. Image/Model Zoom on Hover ===== */
.zoom-on-hover {
  overflow: hidden;
  border-radius: var(--radius);
}

.zoom-on-hover > img,
.zoom-on-hover > model-viewer {
  transition: transform 0.5s var(--ease, ease);
}

.zoom-on-hover:hover > img,
.zoom-on-hover:hover > model-viewer {
  transform: scale(1.05);
}

/* ===== 21. Text Truncation ===== */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 22. Scroll Shadows ===== */
.scroll-shadow {
  overflow: auto;
  background:
    linear-gradient(var(--bg-card) 30%, transparent),
    linear-gradient(transparent, var(--bg-card) 70%) 0 100%,
    radial-gradient(farthest-side at 50% 0, rgba(0,0,0,0.15), transparent),
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,0.15), transparent) 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 40px, 100% 40px, 100% 12px, 100% 12px;
  background-attachment: local, local, scroll, scroll;
}

/* ===== 23. Sticky Section Headers ===== */
.content-section > h2 {
  position: sticky;
  top: 64px;
  z-index: 5;
  background: var(--bg);
  padding: 12px 0 8px;
  margin: 0 0 16px;
}

body.light-theme .content-section > h2 {
  background: var(--bg);
}

/* ===== 24. Enhanced Comparison Grid ===== */
.comparison-grid {
  gap: 16px;
}

.compare-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.3s var(--ease, ease),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.compare-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ===== 25. Module Difficulty Colors ===== */
.difficulty-beginner { color: #22c55e; }
.difficulty-intermediate { color: #f59e0b; }
.difficulty-advanced { color: #ef4444; }

/* ===== 26. Reading Progress Per Section ===== */
.section-progress-bar {
  height: 2px;
  background: var(--border);
  margin-top: 8px;
  border-radius: 100px;
  overflow: hidden;
}

.section-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 100px;
}

/* ===== 27. Search Highlight ===== */
.search-highlight {
  background: rgba(251, 191, 36, 0.25);
  padding: 1px 3px;
  border-radius: 3px;
}

/* ===== 28. Enhanced Workflow Steps ===== */
.workflow-step {
  border-left: 3px solid var(--border);
  padding-left: 20px;
  position: relative;
  transition: border-color 0.3s ease;
}

.workflow-step::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.workflow-step.active {
  border-left-color: var(--accent);
}

.workflow-step.active::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(226, 162, 71, 0.15);
}

.workflow-step.completed::before {
  border-color: var(--green);
  background: var(--green);
}

/* ===== 29. Card Flip Utility ===== */
.card-flip-container {
  perspective: 1000px;
  cursor: pointer;
}

.card-flip-inner {
  transition: transform 0.6s var(--ease, ease);
  transform-style: preserve-3d;
  position: relative;
}

.card-flip-container:hover .card-flip-inner,
.card-flip-container.flipped .card-flip-inner {
  transform: rotateY(180deg);
}

.card-flip-front, .card-flip-back {
  backface-visibility: hidden;
  position: absolute;
  inset: 0;
}

.card-flip-back {
  transform: rotateY(180deg);
}

/* ===== 30. Animated Gradient Border ===== */
@keyframes gradientBorderSpin {
  0%   { --angle: 0deg; }
  100% { --angle: 360deg; }
}

.gradient-border {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent), var(--green), var(--accent));
  background-size: 300% 300%;
  animation: gradientBorderShift 4s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes gradientBorderShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ===== 31. Glassmorphism Variants ===== */
.glass-card {
  background: rgba(14, 22, 38, 0.6);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

body.light-theme .glass-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
}

/* ===== 32. Prediction Prompt Enhancement ===== */
.prediction-prompt {
  border-radius: var(--radius);
  overflow: hidden;
}

.prediction-options button {
  transition: all 0.25s var(--ease, ease);
}

.prediction-options button:hover:not(.correct):not(.incorrect) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== 33. Reflection Block Enhancement ===== */
.reflection-block {
  border-radius: var(--radius);
  overflow: hidden;
}

.reflection-prompt textarea {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  border-radius: var(--radius-sm);
}

.reflection-prompt textarea:focus {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ===== 34. Experiment Block Enhancement ===== */
.experiment-block {
  border-radius: var(--radius);
  overflow: hidden;
}

.experiment-tasks li {
  transition: all 0.25s var(--ease, ease);
  border-radius: var(--radius-sm);
}

.experiment-tasks li:hover {
  transform: translateX(4px);
}

.experiment-tasks li.checked {
  transform: translateX(0);
}

.experiment-progress-fill {
  transition: width 0.5s var(--ease, ease);
  border-radius: 100px;
}

/* ===== 35. Challenge Banner Enhancement ===== */
.challenge-banner {
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.challenge-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.04));
  pointer-events: none;
}

/* ===== 36. Module Completion Celebration (complete button) ===== */
.complete-btn {
  position: relative;
  overflow: hidden;
}

.complete-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.complete-btn:active::after {
  opacity: 1;
}

/* ===== 37. Enhanced Kolb Cycle Indicators ===== */
.kolb-cycle {
  border-radius: var(--radius);
}

.kolb-stage {
  transition: all 0.3s var(--ease, ease);
  cursor: pointer;
}

.kolb-stage:hover {
  transform: scale(1.05);
}

.kolb-stage.active {
  box-shadow: 0 0 0 3px rgba(226, 162, 71, 0.2);
}

.kolb-stage.done {
  opacity: 0.7;
}

/* ===== 38. Knowledge Check Enhancement ===== */
.knowledge-check {
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.kc-option {
  transition: all 0.25s var(--ease, ease);
  border-radius: var(--radius-sm);
}

.kc-option:hover:not(.kc-correct):not(.kc-incorrect):not([disabled]) {
  transform: translateX(4px);
  border-color: var(--accent);
}

/* ===== 39. Up-Next Suggestion Card ===== */
.up-next-card {
  background: linear-gradient(135deg, rgba(226, 162, 71, 0.06), rgba(34, 211, 160, 0.03));
  border: 1px solid rgba(226, 162, 71, 0.15);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.3s var(--ease, ease), box-shadow 0.3s var(--ease, ease);
}

.up-next-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(226, 162, 71, 0.1);
}

.up-next-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.up-next-title {
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.up-next-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.up-next-card:hover .up-next-arrow {
  transform: translateX(4px);
}

/* ===== 40. Related Modules Card ===== */
.related-modules {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.related-module-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.25s var(--ease, ease);
}

.related-module-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.related-module-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.7rem;
}

/* ===== 41. Achievement Badge ===== */
.achievement {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.02));
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.achievement-icon {
  font-size: 1.4rem;
}

.achievement-text {
  font-weight: 600;
  color: var(--yellow);
}

.achievement-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== 42. Streak Display ===== */
.streak-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
}

.streak-flame { color: #f59e0b; }
.streak-count { font-weight: 700; color: var(--text); }
.streak-label { color: var(--text-muted); }

/* ===== 43. Session Timer ===== */
.session-timer {
  position: fixed;
  top: 74px;
  right: 20px;
  background: rgba(14, 22, 38, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.session-timer:hover { opacity: 1; }

.session-timer .pulse-dot {
  width: 5px;
  height: 5px;
}

body.light-theme .session-timer {
  background: rgba(255, 255, 255, 0.85);
}

/* ===== 44. Command Palette ===== */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cmd-palette-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 520px;
  max-width: 90vw;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transform: scale(0.95) translateY(-10px);
  transition: transform 0.2s var(--ease, ease);
}

.cmd-palette-overlay.open .cmd-palette {
  transform: scale(1) translateY(0);
}

.cmd-palette-input {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
}

.cmd-palette-input::placeholder { color: var(--text-muted); }

.cmd-palette-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--text);
  font-size: 0.9rem;
}

.cmd-palette-item:hover,
.cmd-palette-item.selected {
  background: var(--accent-dim);
}

.cmd-palette-item-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 22px;
}

.cmd-palette-item-meta {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cmd-palette-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cmd-palette-footer kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

/* ===== 45. Settings Panel Improvements ===== */
.settings-group {
  margin-bottom: 32px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.settings-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== 46. Toggle Switch ===== */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s var(--ease, ease);
}

.toggle-switch:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch:checked::after {
  left: 22px;
  background: #fff;
}

/* ===== 47. Progress Ring ===== */
.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--surface);
  stroke-width: 4;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease, ease);
}

/* ===== 48. Error State ===== */
.error-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.error-state-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.error-state-text {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.error-state-desc {
  font-size: 0.85rem;
}

/* ===== 49. Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

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

.empty-state-text {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

/* ===== 50. High Contrast Mode ===== */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(255, 255, 255, 0.3);
    --text-muted: #a0b0d0;
    --surface: rgba(255, 255, 255, 0.08);
  }

  .module-card, .concept-block, .tip-box, .formula-box,
  .quiz-option, .kc-option, .glossary-item {
    border-width: 2px;
  }

  a { text-decoration: underline; }

  .ambient-orb { display: none; }
}
