:root {
  /* Surface Colors — Apple-inspired warm off-white system */
  --bg-body: hsl(0, 0%, 96%);
  /* #F5F5F5 — Apples "Page" Grau */
  --bg-card: hsl(0, 0%, 100%);
  /* Reines Weiß für Cards (Tiefenkontrast) */
  --bg-sidebar: hsl(0, 0%, 94%);
  /* Etwas dunkler für Sidebar-Abgrenzung */
  --bg-glass: rgba(255, 255, 255, 0.65);
  /* Glassmorphism-Basis */

  /* Text Colors */
  --text-main: hsl(0, 0%, 12%);
  /* Fast Schwarz — klarer als vorher */
  --text-muted: hsl(0, 0%, 45%);

  /* Borders & Shadows */
  --border: rgba(0, 0, 0, 0.08);
  /* Sehr subtiler Border */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.13), 0 8px 20px rgba(0, 0, 0, 0.08);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;

  /* Brand Colors — derived from hue */
  --primary-hue: 220;
  --primary: hsl(var(--primary-hue), 80%, 55%);
  --accent: hsl(200, 80%, 50%);
}


/* Dark Theme overrides */
body.dark-mode {
  --bg-body: hsl(0, 0%, 8%);
  /* Sehr dunkel — modernes "True Dark" */
  --bg-card: hsl(0, 0%, 13%);
  /* Cards deutlich heller als Body */
  --bg-sidebar: hsl(0, 0%, 10%);
  --bg-glass: rgba(25, 25, 25, 0.70);
  --text-main: hsl(0, 0%, 92%);
  --text-muted: hsl(0, 0%, 58%);
  --border: rgba(255, 255, 255, 0.09);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.40), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.50), 0 8px 20px rgba(0, 0, 0, 0.30);
}

html.dark-mode-preload,
html.dark-mode-preload body {
  background-color: hsl(0, 0%, 8%);
  color: hsl(0, 0%, 92%);
}

/* Syntax Highlighting Tokens (JS Specific) */
.token-comment {
  color: #6a9955;
  font-style: italic;
}

.token-string {
  color: #ce9178;
}

.token-keyword {
  color: #c586c0;
  font-weight: bold;
}

.token-type {
  color: #4ec9b0;
}

.token-annotation {
  color: #dcdcaa;
}

/* Dark Mode Syntax */
body.dark-mode .token-keyword {
  color: #569cd6;
}

/* Light Mode Syntax */
body:not(.dark-mode) .token-keyword {
  color: #0000ff;
}

body:not(.dark-mode) .token-string {
  color: #a31515;
}

body:not(.dark-mode) .token-comment {
  color: #008000;
}

body:not(.dark-mode) .token-type {
  color: #2b91af;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

/* Layout */
.app-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 60px 1fr;
  min-height: 100vh;
}

.app-container.no-sidebar {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}



/* Top Navigation Bar */
.top-bar {
  grid-column: 1 / -1;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-md);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  height: 80px;
}

.brand-area {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-right: auto;
  text-decoration: none;
}

/* Header Grid Layout */
.header-content {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 400px) 1fr;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  justify-self: start;
}

.header-center {
  width: 100%;
  display: flex;
  justify-content: center;
  justify-self: center;
}

.header-right {
  justify-self: end;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: var(--spacing-md);
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-sidebar);
}

.brand {
  display: none;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: var(--primary);
  color: hsl(0, 0%, 8%);
}

.nav-links a.active.read-page::after {
  color: white;
}

/* Main Content */
.main-content {
  padding: var(--spacing-lg);
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
}

header {
  margin-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--spacing-md);
}

h1 {
  font-size: 1.875rem;
  margin: 0 0 var(--spacing-xs) 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.375rem;
  margin-top: var(--spacing-lg);
  color: var(--text-main);
}

/* Components */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 0 0 20px hsla(var(--primary-hue), 80%, 60%, 0.3);
  border-color: var(--primary);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  background: hsla(var(--primary-hue), 80%, 60%, 0.1);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.card h3 {
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--text-main);
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Tag Cards — Glassmorphism */
.tag-card {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  position: relative;
  overflow: hidden;
}

/* Dezenter Farbstreifen oben — jetzt als Gradient mit transparentem Ausblenden */
.tag-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.8;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tag-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: hsla(var(--primary-hue), 60%, 60%, 0.30);
}

.tag-card h2 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-size: 1.5rem;
  color: var(--text-main);
  border-bottom: 2px solid hsla(var(--primary-hue), 80%, 60%, 0.1);
  padding-bottom: 0.5rem;
}

.tag-card h2+.tag-item .tag-title {
  margin-top: 0;
  align-items: center;
}

.tag-title {
  font-family: monospace;
  font-size: 1.25rem;
  color: var(--main);
  background: hsla(280, 80%, 60%, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 15px;
  margin-bottom: var(--spacing-xs);
}

.tag-description {
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.categoryLink {
  color: var(--primary);
  /* Use primary instead of custom variable to simplify */
  font-weight: bold;
  text-decoration: none;
}

.categoryLink:hover {
  text-decoration: underline;
}

/* 
   ========================================
   Focus Mode (Blur Effect)
   ========================================
   Scoped to pages with .tag-title (Content Pages) to exclude Overview.
*/

/* Blur siblings when a card is hovered */
.section-grid:has(.tag-title):has(.tag-card:hover)>.tag-card:not(:hover) {
  filter: blur(4px);
  opacity: 0.6;
  transform: scale(0.99);
  transition: all 0.4s ease;
}

/* Highlight the hovered card */
.section-grid:has(.tag-title)>.tag-card:hover {
  transform: scale(1.03) translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 10;
  border-color: var(--primary);
  opacity: 1;
  filter: none;
}

/* Smooth transition */
.tag-card,
h1,
h2,
p {
  transition: all 0.4s ease;
}

/* Visual Polish */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}

#progress-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(var(--primary-hue), 80%, 60%, 0.5);
}

/* Code Blocks */
pre {
  background-color: #1e1e1e;
  color: #d4d4d4;
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  margin-top: var(--spacing-sm);
  position: relative;
}

.code-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ccc;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

pre:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

code {
  font-family: 'Fira Code', Consolas, monospace;
}

/* Search */
.search-input-header {
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-body);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.1rem;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-input-header:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px hsla(var(--primary-hue), 80%, 60%, 0.15);
}

.search-input-header:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px hsla(var(--primary-hue), 80%, 60%, 0.15);
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-top: 5px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--bg-body);
}

.result-tag {
  font-family: monospace;
  font-weight: bold;
  color: var(--primary);
  background: hsla(var(--primary-hue), 80%, 60%, 0.1);
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
}

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

/* Interactive Control inputs */
.interactive-control {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-body);
  color: var(--text-main);
}

/* Theme Toggle - Premium Neumorphic Design */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch-v2 {
  position: relative;
  display: inline-block;
  width: 140px;
  height: 44px;
}

.theme-switch-v2 input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-ui {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-body);
  border-radius: 34px;
  transition: .4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border: 1px solid var(--border);
  box-shadow: inset 4px 4px 10px rgba(0,0,0,0.05), 
              inset -4px -4px 10px rgba(255,255,255,0.8);
}

body.dark-mode .switch-ui {
  box-shadow: inset 4px 4px 10px rgba(0,0,0,0.5), 
              inset -2px -2px 8px rgba(255,255,255,0.05);
}

html[lang="ro"] .theme-switch-v2 {
  .label-text {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
}

.label-text {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  transition: .4s;
  user-select: none;
  z-index: 1;
}

.label-text.light {
  opacity: 1;
}

.label-text.dark {
  opacity: 0.3;
}

input:checked + .switch-ui .label-text.light {
  opacity: 0.3;
}

input:checked + .switch-ui .label-text.dark {
  opacity: 1;
  color: var(--primary);
}

.thumb {
  position: absolute;
  content: "";
  height: 36px;
  width: 36px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

body.dark-mode .thumb {
  background-color: #333;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.5);
}

input:checked + .switch-ui .thumb {
  transform: translateX(94px);
}

.thumb .icon {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: .4s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb .icon.sun {
  color: #f39c12;
  opacity: 1;
  transform: scale(1);
}

.thumb .icon.moon {
  color: #f1c40f;
  opacity: 0;
  transform: scale(0.5) rotate(-45deg);
}

input:checked + .switch-ui .thumb .icon.sun {
  opacity: 0;
  transform: scale(0.5) rotate(45deg);
}

input:checked + .switch-ui .thumb .icon.moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.thumb svg {
  width: 20px;
  height: 20px;
}

/* =========================================
   Burger Menu Button 
   ========================================= */
.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  color: var(--text-main);
  z-index: 1000;
  /* keep above overlay if needed */
}

.menu-btn:hover {
  background-color: var(--bg-body);
}

.menu-btn svg {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  transition: transform 0.3s ease-in-out;
}

/* Burger Animation Lines */
.menu-btn line {
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

.menu-btn.active .line-top {
  transform: translateY(6px) rotate(45deg);
}

.menu-btn.active .line-mid {
  opacity: 0;
}

.menu-btn.active .line-bot {
  transform: translateY(-6px) rotate(-45deg);
}

/* =========================================
   Side Menu Drawer (Slide-out panel) 
   ========================================= */
.side-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: transparent;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  /* Transition to blur */
  z-index: 2000;
  display: none;
  /* toggled via JS */
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.side-menu-overlay.visible {
  display: block;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.side-menu-panel {
  position: fixed;
  top: 0;
  right: -320px;
  /* Hidden offscreen */
  width: 320px;
  max-width: 80vw;
  height: 100vh;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2001;
}

.side-menu-panel.visible {
  transform: translateX(-100%);
  /* Slide in */
}

/* Inner Layout of Side Menu */
.side-menu-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side-menu-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-main);
}

.close-menu-btn,
.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.close-menu-btn:hover,
.icon-btn:hover {
  background-color: var(--bg-body);
  color: var(--text-main);
}

.close-menu-btn svg,
.icon-btn svg {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.side-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.settings-item {
  width: 100%;
  padding: 15px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.2s, padding-left 0.2s;
}

.settings-item:hover {
  background-color: var(--bg-body);
  color: var(--primary);
  padding-left: 25px;
}

.settings-item .menu-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}

.settings-item:hover .menu-icon {
  color: var(--primary);
}

.settings-item .chevron {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.settings-footer {
  padding: 15px 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  text-align: center;
}

.side-menu-info {
  padding: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Color Picker adjustments inside drawer */
.color-picker-container {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.color-picker-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}

.color-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
}

.color-swatch:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-sm);
}

.color-swatch.active {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text-main);
}

/* Demo Specifics (Structure Pages) */
.demo-sidebar {
  width: 30%;
  padding: 10px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background-color: var(--bg-body);
  border-radius: 4px;
  opacity: 0.5;
  transition: width 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
  cursor: help;
  white-space: nowrap;
  overflow: hidden;
}

.demo-sidebar:hover {
  width: 50%;
  opacity: 1;
  box-shadow: var(--shadow-md);
}

.demo-area {
  background-color: var(--bg-body);
  border: 1px dashed var(--border);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  margin-top: var(--spacing-sm);
}

/* --- QUIZ STYLES --- */
.quiz-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.score-board {
  display: flex;
  justify-content: space-between;
  background: var(--bg-card);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: var(--spacing-lg);
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: var(--shadow-sm);
}

.score-board span {
  color: var(--primary);
}

.question-card {
  background: var(--bg-card);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-lg);
  --backdrop-filter: blur(10px);
}

.option-btn {
  background: var(--bg-body);
  border: 2px solid var(--border);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-main);
  transition: all 0.2s;
  text-align: left;
}

.option-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.option-btn:disabled {
  cursor: default;
  transform: none;
  opacity: 0.8;
}

.option-btn.correct {
  background-color: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  border-color: #2ecc71;
}

.option-btn.wrong {
  background-color: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border-color: #e74c3c;
}

.next-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: var(--spacing-lg);
  display: none;
  transition: transform 0.2s;
}

.next-btn:hover {
  transform: scale(1.05);
}

.next-btn.visible {
  display: inline-block;
  animation: fadeInUp 0.3s ease;
}

.question-text {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-lg);
  color: var(--text-main);
}

.question-tag {
  display: inline-block;
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.1);
  background: var(--bg-body);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
  box-shadow: 0 0 15px rgba(var(--primary-rgb, 59, 130, 246), 0.2);
}

.options-grid {
  display: grid;
  gap: var(--spacing-md);
}

.bookmark-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.bookmark-btn:hover,
.bookmark-btn.active {
  background-color: var(--accent);
  color: white;
}

.marked-list {
  text-align: left;
  margin-top: var(--spacing-md);
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
}

.marked-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.marked-item:last-child {
  border-bottom: none;
}

.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .header-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 0.5rem;
  }

  .header-left {
    justify-self: center;
    justify-content: center;
  }

  .header-center {
    justify-self: stretch;
  }

  .header-right {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .top-bar {
    position: relative;
    padding: var(--spacing-sm);
    flex-direction: column;
    gap: var(--spacing-sm);
    height: auto;
  }

  .brand-area {
    width: 100%;
    justify-content: space-between;
  }

  .sidebar {
    height: auto;
    position: static;
    top: 0;
  }
}

/* --- Progress Tracking Buttons --- */
.learn-status-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.learn-status-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.1);
  transform: translateY(-1px);
}

.learn-status-btn.learned {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb, 59, 130, 246), 0.3);
}

.learn-status-btn .check-icon {
  transition: transform 0.2s;
}

.learn-status-btn.learned .check-icon {
  transform: scale(1.2);
}

html.app-loading body {
  opacity: 0;
}

html.app-ready body {
  opacity: 1;
  transition: opacity 180ms ease-out;
}

main {
    animation: pageFadeIn 0.64s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}