/* ==========================================================================
   ODPRTO. — MASTER DESIGN SYSTEM (100% WIRED TO WIREFRAME DESIGN)
   Harmonična barvna paleta:
   - Primarna: #00B856 (Čista smaragdno zelena)
   - Sekundarna: #38BDF8 (Svetlo modra)
   - Akcent: #F59E0B (Topla jantarna)
   - Ozadje strani: #F8FAFC (Sveža svetlo siva)
   - Površina kartic: #FFFFFF (Čisto bela)
   - Besedilo: #0F172A (Globoka temna)
   - Besedilo sekundarno: #64748B (Nevtralna siva)
   - Obrobe: #E2E8F0
   ========================================================================== */

:root {
  /* Barve */
  --primary: #00B856;
  --primary-hover: #009e49;
  --primary-light: #f0fdf4;
  --primary-border: #bbf7d0;
  --primary-dark: #047857;

  --secondary: #38bdf8;
  --secondary-light: #f0f9ff;
  --secondary-border: #e0f2fe;

  --accent-amber: #f59e0b;
  --accent-amber-light: #fffbeb;
  --accent-amber-border: #fef3c7;

  --accent-blue: #3b82f6;
  --accent-blue-light: #eff6ff;
  --accent-blue-border: #dbeafe;

  --accent-purple: #8b5cf6;
  --accent-purple-light: #f5f3ff;
  --accent-purple-border: #ede9fe;

  --accent-teal: #0d9488;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --bg-page: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-hover: #cbd5e1;

  /* Polmeri */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-pill: 9999px;

  /* Sence */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.09);

  /* Spacing Tokens */
  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-s: 16px;
  --space-m: 20px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Tipografija */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Temni način */
[data-theme="dark"], body.dark-theme {
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --bg-page: #0b1120;
  --surface: #131d33;
  --surface-hover: #1e293b;
  --border: #1e293b;
  --border-light: #182238;
  --border-hover: #334155;
  --primary-light: rgba(0, 184, 86, 0.12);
  --primary-border: rgba(0, 184, 86, 0.3);
  --secondary-light: rgba(56, 189, 248, 0.12);
  --secondary-border: rgba(56, 189, 248, 0.3);
  --accent-amber-light: rgba(245, 158, 11, 0.12);
  --accent-amber-border: rgba(245, 158, 11, 0.3);
  --accent-blue-light: rgba(59, 130, 246, 0.12);
  --accent-blue-border: rgba(59, 130, 246, 0.3);
  --accent-purple-light: rgba(139, 92, 246, 0.12);
  --accent-purple-border: rgba(139, 92, 246, 0.3);
}

body.font-size-s { font-size: 14px; }
body.font-size-m { font-size: 16px; }
body.font-size-l { font-size: 18px; }

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }

/* Modal Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   KOMPOZICIJA (Layout Primitives)
   -------------------------------------------------------------------------- */
.wrapper {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3.5vw, 36px);
}

.wrapper-narrow { max-width: 900px; }
.wrapper-center { max-width: 480px; }

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}
.stack-3xs { gap: var(--space-3xs); }
.stack-2xs { gap: var(--space-2xs); }
.stack-xs  { gap: var(--space-xs); }
.stack-s   { gap: var(--space-s); }
.stack-m   { gap: var(--space-m); }
.stack-l   { gap: var(--space-l); }
.stack-xl  { gap: var(--space-xl); }
.stack-2xl { gap: var(--space-2xl); }

.cluster {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s);
}
.cluster-xs { gap: var(--space-xs); }
.cluster-s  { gap: var(--space-s); }
.cluster-m  { gap: var(--space-m); }
.cluster-l  { gap: var(--space-l); }

.repel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-l);
}
.grid-auto-sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: var(--space-m);
}
.grid-auto-lg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--space-l);
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}
.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-l);
}
.grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-m);
}
.grid-sidebar {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

/* --------------------------------------------------------------------------
   TIPOGRAFIJA & OSNOVNI SLOGI
   -------------------------------------------------------------------------- */
.text-hero { font-size: clamp(34px, 4.4vw, 54px); font-weight: 800; line-height: 1.12; }
.text-title-xl { font-size: 28px; font-weight: 800; }
.text-title-l { font-size: 22px; font-weight: 700; }
.text-title-m { font-size: 18px; font-weight: 700; }
.text-title-s { font-size: 15px; font-weight: 700; }

.text-body-l { font-size: 17px; line-height: 1.7; }
.text-body-m { font-size: 15px; line-height: 1.6; }
.text-body-s { font-size: 13.5px; line-height: 1.55; }
.text-caption { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }

.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-subtle { color: var(--text-subtle) !important; }
.text-main { color: var(--text-main) !important; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }

/* --------------------------------------------------------------------------
   GUMBI (.btn)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 184, 86, 0.28);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 184, 86, 0.35);
}

.btn-outline {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  border-color: var(--text-muted);
  background-color: var(--surface-hover);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* --------------------------------------------------------------------------
   KARTICE (.card)
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Pastelne barvne kartice za predmete (po wireframe slikah) */
.card-subject-math {
  background: #f0fdf4;
  border-color: #dcfce7;
}
.card-subject-prog {
  background: #f0f9ff;
  border-color: #e0f2fe;
}
.card-subject-sci {
  background: #f0fdf9;
  border-color: #ccfbf1;
}
.card-subject-hist {
  background: #fffbeb;
  border-color: #fef3c7;
}
.card-subject-econ {
  background: #fff7ed;
  border-color: #ffedd5;
}
.card-subject-psych {
  background: #faf5ff;
  border-color: #f3e8ff;
}

/* --------------------------------------------------------------------------
   ZAVIHKI (.tab-group & .tab-item)
   -------------------------------------------------------------------------- */
.tab-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tab-item {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-item:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.tab-item.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 184, 86, 0.2);
}

/* --------------------------------------------------------------------------
   ZNAČKE IN STATUSI (.badge)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-emerald { background: var(--primary-light); color: #15803d; border: 1px solid var(--primary-border); }
.badge-blue { background: var(--secondary-light); color: #0369a1; border: 1px solid var(--secondary-border); }
.badge-amber { background: var(--accent-amber-light); color: #b45309; border: 1px solid var(--accent-amber-border); }
.badge-subtle { background: var(--bg-page); color: var(--text-subtle); border: 1px solid var(--border); }
.badge-purple { background: var(--accent-purple-light); color: #6d28d9; border: 1px solid var(--accent-purple-border); }

/* --------------------------------------------------------------------------
   STATISTIČNI BLOKI (.stat-tile)
   -------------------------------------------------------------------------- */
.stat-tile {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2xs);
}
.stat-tile-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

/* --------------------------------------------------------------------------
   VNOSNA POLJA (.input-group)
   -------------------------------------------------------------------------- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.input-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14.5px;
  background-color: var(--bg-page);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}
.input-control:focus {
  border-color: var(--primary);
  background-color: var(--surface);
}

/* --------------------------------------------------------------------------
   HARMONIKA (.accordion)
   -------------------------------------------------------------------------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.accordion-header {
  width: 100%;
  padding: 18px 24px;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.accordion-body {
  padding: 0 24px 20px;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   NAVBAR (.app-nav)
   -------------------------------------------------------------------------- */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}
[data-theme="dark"] .app-nav {
  background: rgba(19, 29, 51, 0.96);
}

.nav-link-btn {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-link-btn:hover, .nav-link-btn.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* --------------------------------------------------------------------------
   POGLEDI (.app-view)
   -------------------------------------------------------------------------- */
.app-view {
  min-height: calc(100vh - 68px);
  padding-top: 96px;
  padding-bottom: var(--space-3xl);
  display: none;
  animation: fadeIn 0.25s ease forwards;
}
.app-view.active-view {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   HERO SEKCIJA
   -------------------------------------------------------------------------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-3xl);
  align-items: center;
  padding: var(--space-xl) 0;
}

.hero-art-box {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 60% 40%, rgba(0, 184, 86, 0.12) 0%, rgba(56, 189, 248, 0.06) 50%, transparent 70%);
  border-radius: var(--radius-2xl);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
}

.hero-main-img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--radius-2xl);
  object-fit: cover;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-main-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(0, 184, 86, 0.14);
}

.floating-pill {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  animation: float 4s ease-in-out infinite;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.floating-pill:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.pill-pos-1 { top: 6%; left: -4%; animation-delay: 0s; }
.pill-pos-2 { bottom: 6%; right: -4%; animation-delay: 1.5s; }
.pill-pos-3 { top: 12%; right: -6%; animation-delay: 2.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --------------------------------------------------------------------------
   SUBJECT HUB & RAZVRŠČANJE PO RAZREDIH / TEMATIKAH
   -------------------------------------------------------------------------- */
.sort-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
}
.sort-switcher-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-switcher-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 184, 86, 0.3);
}

.hub-grade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-s);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.hub-grade-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.hub-grade-card.level-os {
  border-left: 4px solid var(--primary);
}
.hub-grade-card.level-ss {
  border-left: 4px solid #0284c7;
}
.hub-grade-card.level-faks {
  border-left: 4px solid #8b5cf6;
}

.hub-resource-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 2px solid var(--primary-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-s);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.hub-resource-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   2-STOLPČNA LEKCIJA & ASIDE (WIREFRAME 03 / 04 / LEKCIJA)
   -------------------------------------------------------------------------- */
.lesson-2col-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: start;
}

.code-snippet-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: var(--font-mono);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.65;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quiz-option-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s ease;
}
.quiz-option-pill:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* --------------------------------------------------------------------------
   DIDAKTIČNI BLOKI V UČBENIKU (.st-lead-card, .st-rule-box, ...)
   -------------------------------------------------------------------------- */
.st-lead-card {
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-xs);
}

.st-rule-box {
  border: 1px solid var(--primary-border);
  border-left: 5px solid var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  box-shadow: var(--shadow-xs);
}
.st-rule-box h4 {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.st-rule-box p {
  font-size: 15.5px;
  color: #064e3b;
  line-height: 1.75;
}

.st-example-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}
.st-example-box h4 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.st-example-problem {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  padding-bottom: var(--space-s);
  border-bottom: 1px solid var(--border-light);
  line-height: 1.6;
}

.st-practical-box {
  border: 1px solid var(--secondary-border);
  border-left: 5px solid #0284c7;
  border-radius: var(--radius-xl);
  background: #f0f9ff;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  box-shadow: var(--shadow-xs);
}
.st-practical-box h4 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0284c7;
}
.st-practical-problem {
  font-size: 15.5px;
  font-weight: 700;
  color: #0c4a6e;
  line-height: 1.65;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid rgba(2, 132, 199, 0.15);
}

.st-workbook-box {
  border: 2px dashed var(--primary);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}
.st-workbook-box h4 {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.st-workbook-prompt {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.65;
}
.st-workbook-input {
  width: 140px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  color: var(--text-main);
  outline: none;
}
.st-workbook-input:focus { border-color: var(--primary); }
.st-workbook-feedback {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
}
.st-workbook-feedback.correct {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.st-workbook-feedback.incorrect {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.st-sim {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}
.st-sim h4 {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.st-sim-prompt {
  font-size: 15px;
  color: var(--text-muted);
}
.sim-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-page);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}
.sim-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-height: 48px;
}
.sim-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 184, 86, 0.25);
  display: inline-block;
}
.sim-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sim-input, .sim-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  outline: none;
}
.sim-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
}
.sim-fb {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}
.sim-fb.ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.sim-fb.no {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* --------------------------------------------------------------------------
   STRUKTURIRAN UČBENIK (VIEWER & ASIDE)
   -------------------------------------------------------------------------- */
.st-view {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.st-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.st-sidebar {
  width: 340px;
  flex: 0 0 340px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.st-sidebar.collapsed {
  margin-left: -340px;
}
.st-sidebar-item {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}
.st-sidebar-item:hover, .st-sidebar-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.st-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 40px clamp(16px, 4vw, 48px) 80px;
}
.st-inner {
  max-width: 880px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* --------------------------------------------------------------------------
   BRILLIANT KORAČNI NAČIN (Step-by-Step Flow)
   -------------------------------------------------------------------------- */
.brilliant-progress {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: var(--space-s);
}
.brilliant-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-teal) 100%);
  border-radius: var(--radius-full);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.brilliant-card {
  animation: fadeInStep 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Math Hub Linear Rows */
.math-hub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.math-hub-row:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
.math-hub-row:hover h3 {
  color: var(--primary);
}
.math-hub-row.hub-resource-row {
  border-color: var(--accent-amber-border);
  background: var(--accent-amber-light);
}
.math-hub-row.hub-resource-row:hover {
  background: var(--surface-hover);
  border-color: var(--accent-amber);
}
.math-hub-row-action {
  transition: transform 0.15s ease;
}
.math-hub-row:hover .math-hub-row-action {
  transform: translateX(2px);
}

/* Chapter Overview Subpage (Linear Table of Contents) */
.chapter-group {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 20px 20px;
}
.toc-unit-list {
  gap: 6px;
}
.toc-unit-row {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.toc-unit-row:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateX(4px);
}
.toc-unit-row:hover .toc-unit-title {
  color: var(--primary);
}
.toc-unit-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.toc-unit-row:hover .toc-unit-num {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.toc-unit-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.15s ease;
}
.toc-unit-action {
  font-size: 13px;
  transition: transform 0.15s ease, color 0.15s ease;
}
.toc-unit-row:hover .toc-unit-action {
  color: var(--primary);
  transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   GLOBAL FOOTER
   -------------------------------------------------------------------------- */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-l);
  margin-top: var(--space-3xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: var(--space-xl);
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}
.footer-col h5 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}
.footer-col a {
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color 0.15s;
  cursor: pointer;
}
.footer-col a:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   MODERNE IKONE & TIPOGRAFIJA (.icon, .kbd-hint)
   -------------------------------------------------------------------------- */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}
.icon-fill {
  fill: currentColor;
  stroke: none;
}

/* Tipkovnične bližnjice (KBD badges) */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  box-shadow: 0 1px 0 var(--border);
  line-height: 1;
  margin-left: 6px;
  text-transform: uppercase;
}
.btn:hover .kbd-hint {
  color: var(--text-main);
  border-color: var(--border-hover);
}
.btn-primary .kbd-hint {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   SPOTLIGHT COMMAND BAR (Ctrl+K)
   -------------------------------------------------------------------------- */
.spotlight-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  padding-inline: 16px;
}
.spotlight-container {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: spotlightIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes spotlightIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.spotlight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}
.spotlight-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  font-family: inherit;
}
.spotlight-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}
.spotlight-item:hover, .spotlight-item.selected {
  background: var(--primary-light);
  border-color: rgba(0, 184, 86, 0.3);
}
.spotlight-item:hover .spotlight-title, .spotlight-item.selected .spotlight-title {
  color: var(--primary);
}
.spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-page);
  border-top: 1px solid var(--border-light);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   FOKUSIRAN NAČIN (ZEN / FOCUS MODE)
   -------------------------------------------------------------------------- */
body.focus-mode .app-nav {
  display: none !important;
}
body.focus-mode #view-statistika {
  top: 0 !important;
  height: 100vh !important;
}
body.focus-mode .st-content {
  max-width: 900px;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   MODERNI INTERAKTIVNI SANDBOX (Hero Interactive Console)
   -------------------------------------------------------------------------- */
.sandbox-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-xl);
  max-width: 420px;
  margin-inline: auto;
  border-top: 3px solid var(--primary);
  backdrop-filter: blur(12px);
}
.sandbox-tabs {
  background: var(--bg-page);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  display: flex;
  gap: 4px;
}
.sandbox-tab-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sandbox-tab-btn:hover {
  color: var(--text-main);
}
.sandbox-tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.sandbox-pane {
  display: none;
}
.sandbox-pane.active {
  display: flex;
  flex-direction: column;
}
.sandbox-display-box {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
  font-size: 14px;
}
.sandbox-slider {
  accent-color: var(--primary);
  cursor: pointer;
  height: 6px;
  border-radius: 4px;
}
.dice-box {
  width: 52px;
  height: 52px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease;
}
.dice-box.pulse-roll {
  transform: rotate(20deg) scale(1.15);
}
.prob-bars-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  align-items: flex-end;
  height: 90px;
  padding: 8px;
  background: var(--bg-page);
  border-radius: var(--radius-md);
}
.prob-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.prob-bar-track {
  width: 100%;
  max-width: 18px;
  height: 55px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.prob-bar-fill {
  width: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   FORMULE & TABELE (.formula-card)
   -------------------------------------------------------------------------- */
.formula-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.formula-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.formula-math-display {
  padding: 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 15px;
  overflow-x: auto;
}

.hero-preview-math-box {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  color: var(--text-main);
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
}

/* --------------------------------------------------------------------------
   ODZIVNOST (Media Queries)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-xl); text-align: center; }
  .grid-sidebar { grid-template-columns: 1fr; }
  .grid-4col { grid-template-columns: repeat(2, 1fr); }
  .lesson-2col-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .st-sidebar { position: absolute; top: 0; bottom: 0; left: 0; z-index: 30; box-shadow: var(--shadow-lg); }
  .st-sidebar.collapsed { margin-left: -340px; }
}

@media (max-width: 768px) {
  .grid-2col, .grid-3col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-hamburger-btn { display: flex !important; }
  .nav-search-btn { min-width: auto; }
  .nav-search-btn span:last-child { display: none; }
  .st-content { padding: var(--space-l) var(--space-s) var(--space-2xl); }
  .hero-preview-card { max-width: 100%; }
  .spotlight-container { max-width: 100%; }
}

@media (max-width: 480px) {
  .grid-4col { grid-template-columns: 1fr; }
  .st-topbar { flex-wrap: wrap; gap: 8px; }
  .st-topbar .cluster:first-child { width: 100%; }
}

/* --------------------------------------------------------------------------
   DOSTOPNOST & PROFESIONALNA POLIŠA
   -------------------------------------------------------------------------- */

/* Skip-to-content link */
.sr-only:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-md);
  clip: unset;
  width: auto;
  height: auto;
}

/* Barvna oznaka besedila pri označevanju */
::selection {
  background: rgba(0, 184, 86, 0.2);
  color: var(--text-main);
}

/* Gladko drsenje stranske vrstice */
#st-chapter-list {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Zmanjšane animacije za uporabnike, ki to preferirajo */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Tiskanje — skrij nepotrebne elemente */
@media print {
  .app-nav, .st-sidebar, .st-topbar, #confetti-canvas,
  .app-footer, #mobile-drawer, #search-modal, #resources-modal,
  #toast-notification { display: none !important; }
  .st-content { max-width: 100%; padding: 0; }
  body { background: #fff; color: #000; }
}