@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Sidebar (Dark Mode) */
  --sidebar-bg: #090e17;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #ffffff;
  --sidebar-accent: #38bdf8;
  --sidebar-active-bg: rgba(56, 189, 248, 0.15);

  /* Main Content (Light Mode) */
  --bg-color: #f1f5f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 10px 40px -10px rgba(0,0,0,0.06);
  --accent-main: #0284c7;
  --good: #10b981;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-main);
  background: var(--bg-color);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, .eyebrow, .meta-pill, .button {
  font-family: var(--font-heading);
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 1.5rem;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  color: white;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.sidebar__brand strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
}
.sidebar__brand span {
  font-size: 0.8rem;
  color: var(--sidebar-text);
}

.sidebar__nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar__group {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.6);
}

.sidebar__link {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.sidebar__link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--sidebar-text-hover);
  transform: translateX(4px);
}

.sidebar__link.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-accent);
  font-weight: 500;
  border-left: 3px solid var(--sidebar-accent);
}

/* Main Content */
.main-content {
  position: relative;
  padding: 3rem 4rem;
  overflow-x: hidden;
}

.main-content__background {
  position: fixed;
  top: 0; left: 280px; right: 0; bottom: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.15), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.1), transparent 40%),
    #f8fafc;
}

/* Typography & General Classes */
.eyebrow {
  color: var(--accent-main);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: #0f172a;
}
h2 { font-size: 2rem; font-weight: 600; margin: 0 0 0.5rem; }
h3 { font-size: 1.4rem; font-weight: 600; margin: 0 0 0.5rem; }

.lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.7;
}

/* Components */
.meta-pill {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-main);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}
.button--primary {
  background: #0f172a;
  color: white;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}
.button--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3); }
.button--ghost {
  background: white;
  border: 1px solid #cbd5e1;
  color: #334155;
}
.button--ghost:hover { background: #f8fafc; border-color: #94a3b8; transform: translateY(-2px); }

/* Grids & Layout Shell */
.shell {
  max-width: 1080px;
  margin: 0 auto;
}

.section { margin-bottom: 5rem; }
.section__header { margin-bottom: 2rem; }
.chapter-grid, .process-grid, .resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Hero / Masthead */
.hero, .chapter-masthead {
  margin-bottom: 4rem;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.05);
}

.home-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.home-hero__aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cover-card {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 35px -5px rgba(0,0,0,0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: white;
}
.cover-card img {
  width: 100%;
  height: auto;
  display: block;
}
.cover-card figcaption {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.home-note {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(129, 140, 248, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}
.home-note__title {
  font-weight: 700;
  color: var(--accent-main);
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
}
.home-note__text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.hero__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.hero__actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-top: 2rem;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 999px;
  transition: width 0.1s ease;
}

/* Grids */
.section { margin-bottom: 5rem; }
.section__header { margin-bottom: 2rem; }
.chapter-grid, .process-grid, .resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Cards */
.chapter-card, .process-card, .resource-link-card, .chapter, .block {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: block;
}

.chapter-card:hover, .resource-link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
  border-color: rgba(255,255,255,0.9);
}

.chapter-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.chapter-card__number {
  font-size: 2rem;
  font-weight: 700;
  color: #cbd5e1;
  font-family: var(--font-heading);
}
.chapter-card h3 { margin: 0 0 0.5rem; }
.chapter-card p { color: var(--text-muted); margin: 0 0 1.5rem; line-height: 1.5; }
.chapter-card__foot {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--accent-main);
  font-weight: 500;
}

.process-card__number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

/* Chapter Specific */
.chapter__head {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
.chapter__title {
  color: #0f172a;
  font-size: 1.5rem;
}
.chapter__count {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.stack { display: grid; gap: 1.5rem; }

.block {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: white;
}
.block--html { padding: 2rem; }
.prose {
  max-width: 65ch;
  margin: 0 auto;
}
.prose p { margin: 0 0 1rem; }
.prose a { color: var(--accent-main); text-decoration: underline; text-underline-offset: 3px; }
.prose h4, .prose h5 { margin: 1.5rem 0 0.5rem; }

/* Interactive Blocks */
.callout {
  background: #f8fafc;
  border-left: 4px solid var(--accent-main);
  padding: 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
}
.callout__title {
  color: var(--accent-main);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.token {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.choice-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.5rem; }
.choice {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
}
.choice--correct {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
}
.choice__marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
}
.choice--correct .choice__marker {
  background: var(--good);
  border-color: var(--good);
}

.quiz__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.quiz__badge {
  background: #f1f5f9;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tilteksten-section {
  display: grid;
  gap: 1.5rem;
}

.tilteksten__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.tilteksten__header .meta-pill {
  flex-shrink: 0;
}

.tilteksten__intro {
  margin: 0;
  max-width: 68ch;
  color: var(--text-muted);
}

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

.practice-card {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px -20px rgba(15, 23, 42, 0.28);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.practice-card.is-correct {
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: 0 18px 28px -20px rgba(16, 185, 129, 0.35);
}

.practice-card.is-wrong {
  border-color: rgba(239, 68, 68, 0.24);
}

.practice-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.practice-card__label {
  margin: 0;
  color: var(--accent-main);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.practice-card__prompt {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.practice-options {
  display: grid;
  gap: 0.6rem;
}

.practice-choice {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.practice-choice:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.practice-choice.is-selected {
  border-color: var(--accent-main);
  background: rgba(2, 132, 199, 0.06);
}

.practice-choice.is-correct {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.practice-choice.is-wrong {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.practice-answer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.practice-input {
  flex: 1 1 180px;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.9rem 1rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.practice-input:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.practice-check {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: #0f172a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.practice-check:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -12px rgba(15, 23, 42, 0.6);
}

.practice-check:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.practice-feedback {
  margin: 0;
  min-height: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.practice-feedback.is-correct {
  color: var(--good);
}

.practice-feedback.is-wrong {
  color: #dc2626;
}

.match-grid {
  display: grid;
  gap: 0.75rem;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.match-row.is-correct {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.06);
}

.match-row.is-wrong {
  border-color: rgba(239, 68, 68, 0.25);
}

.match-row__term {
  font-weight: 600;
  color: #0f172a;
}

.match-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  padding: 0.8rem 0.9rem;
}

.match-select:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.order-list {
  display: grid;
  gap: 0.65rem;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: grab;
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.order-item:hover {
  transform: translateY(-1px);
  border-color: #94a3b8;
}

.order-item.is-dragging {
  opacity: 0.65;
  transform: scale(0.99);
}

.order-item__handle {
  color: var(--accent-main);
  font-weight: 700;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.order-item__text {
  color: #0f172a;
  font-weight: 500;
}

.order-actions {
  display: flex;
  justify-content: flex-start;
}

.media-card {
  padding: 0;
  overflow: hidden;
}
.media-card img { width: 100%; height: auto; display: block; }
.media-card figcaption { padding: 1rem 1.5rem; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid #f1f5f9; }

/* Responsive */
@media (max-width: 1024px) {
  .app-layout { grid-template-columns: 240px 1fr; }
  .main-content { padding: 2rem; }
}
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; display: flex; flex-direction: column; }
  .sidebar {
    height: auto;
    position: relative;
    padding: 1.5rem;
  }
  .sidebar__brand { margin-bottom: 1.5rem; }
  .main-content { padding: 1.5rem; }
}

/* Animations */
.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Video Card */
.video-card { display: grid; gap: 0.85rem; }
.video-card__frame {
  position: relative; border-radius: 16px; overflow: hidden; display: block; aspect-ratio: 16 / 9;
  background: #cbd5e1; text-decoration: none;
}
.video-card__frame img { width: 100%; height: 100%; object-fit: cover; }
.video-card__play {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 1; padding: 0.42rem 0.75rem;
  border-radius: 999px; background: rgba(15, 23, 42, 0.82); color: white;
  font-size: 0.8rem; font-weight: 650; text-transform: uppercase;
}
.video-card__body strong { font-size: 1rem; line-height: 1.35; }
.video-card__meta { color: var(--text-muted); font-size: 0.95rem; }

/* Timeline */
.timeline { display: grid; gap: 0.75rem; }
.timeline__row { display: grid; gap: 0.75rem; }
.timeline__item {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0.8rem;
  padding: 1rem; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0;
}
.timeline__date { color: var(--accent-main); font-weight: 700; font-size: 0.93rem; }
.timeline__item h4 { margin: 0; font-size: 1rem; }
.timeline__item p { margin: 0.35rem 0 0; color: var(--text-muted); }

/* Interactive Horizontal Timeline */
.interactive-timeline-wrapper {
  margin: 3rem 0;
  padding-bottom: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-main) transparent;
  -webkit-overflow-scrolling: touch;
}

.interactive-timeline-wrapper::-webkit-scrollbar {
  height: 8px;
}
.interactive-timeline-wrapper::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
}
.interactive-timeline-wrapper::-webkit-scrollbar-thumb {
  background: var(--accent-main);
  border-radius: 4px;
}

.interactive-timeline {
  display: flex;
  gap: 2rem;
  padding: 1rem 1rem 3.5rem 1rem; /* Bottom padding for line and dots */
  min-width: max-content;
  position: relative;
  align-items: flex-end;
}

/* The continuous line at the bottom */
.interactive-timeline::after {
  content: '';
  position: absolute;
  bottom: 1.5rem;
  left: 1rem;
  right: 1rem;
  height: 4px;
  background: #e2e8f0;
  z-index: 0;
  border-radius: 2px;
}

.timeline-node {
  scroll-snap-align: center;
  position: relative;
  z-index: 1;
  width: 320px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem; /* Space for the stem */
}

.timeline-node:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.08);
  border-color: var(--accent-main);
}

/* Dot on the line */
.timeline-node::after {
  content: '';
  position: absolute;
  bottom: -2.5rem; /* Center over the 1.5rem line */
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: white;
  border: 4px solid var(--accent-main);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
  transition: all 0.3s ease;
  z-index: 2;
}

/* Stem connecting card to dot */
.timeline-node::before {
  content: '';
  position: absolute;
  bottom: -2.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 2.1rem;
  background: #e2e8f0;
  transition: all 0.3s ease;
  z-index: -1;
}

.timeline-node:hover::after {
  background: var(--accent-main);
  transform: translateX(-50%) scale(1.2);
  box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.2);
}

.timeline-node:hover::before {
  background: var(--accent-main);
}

.timeline-node__year {
  color: var(--accent-main);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(2, 132, 199, 0.1);
  border-radius: 6px;
  align-self: flex-start;
}

.timeline-node__title {
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0.5rem 0 0;
  color: #0f172a;
}

.timeline-node__desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Details/Summary */
details { background: #f8fafc; border-radius: 8px; padding: 1rem; border: 1px solid #e2e8f0; }
summary { cursor: pointer; color: var(--accent-main); font-weight: 600; outline: none; }

.task-accordion {
  margin-bottom: 1rem;
  transition: all 0.2s ease-in-out;
}
.task-accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.task-accordion summary::-webkit-details-marker {
  display: none;
}
.task-accordion summary h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-main);
}
.task-accordion summary::after {
  content: "▼";
  font-size: 0.8rem;
  color: var(--accent-main);
  transition: transform 0.2s ease;
}
.task-accordion[open] summary::after {
  transform: rotate(180deg);
}
.task-accordion__content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-subtle);
}

/* Progress Sidebar */
.sidebar__link.completed {
  position: relative;
}
.sidebar__link.completed::after {
  content: "✅";
  position: absolute;
  right: 10px;
  font-size: 0.9rem;
}

/* KI Cards (Kapittel 10) */
.ki-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.ki-card {
  background: var(--surface-100);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ki-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.ki-card__icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.ki-card__title {
  margin: 0 0 0.5rem 0;
  color: var(--accent-main);
  font-size: 1.25rem;
}
.ki-card__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex: 1;
}
.ki-card__button {
  display: inline-block;
  text-align: center;
  background: var(--accent-main);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}
.ki-card__button:hover {
  background: var(--accent-dark);
}

/* Flashcards */
.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.flashcard {
  background-color: transparent;
  width: 100%;
  height: 150px;
  perspective: 1000px;
  cursor: pointer;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}
.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.flashcard-front {
  background-color: var(--surface-200);
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.1rem;
  border: 2px solid var(--accent-main);
}
.flashcard-back {
  background-color: var(--accent-main);
  color: white;
  transform: rotateY(180deg);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 2px dotted var(--accent-main);
  cursor: help;
  color: var(--accent-main);
  font-weight: 600;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--surface-100);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  font-size: 0.9rem;
  font-weight: 400;
}
.tooltip::before {
  content: "";
  position: absolute;
  bottom: 110%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--surface-100) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
}
.tooltip:hover::after, .tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Quizzes */
.quiz {
  background: var(--surface-100);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
}
.quiz__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.quiz__badge {
  background: var(--accent-main);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: bold;
}
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.choice {
  padding: 1rem;
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
}
.choice:hover {
  border-color: var(--accent-main);
  background: var(--surface-200);
}
.choice.selected {
  border-color: var(--accent-main);
  background: var(--accent-main);
  color: white;
}
.choice.correct-reveal {
  border-color: #10b981;
  background: #d1fae5;
  color: #065f46;
}
.choice.wrong-reveal {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}
.answer-note {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: #d1fae5;
  color: #065f46;
  border-radius: 8px;
  font-weight: 500;
}
.quiz.answered .answer-note {
  display: block;
}
/* Neural Network Simulator */
.nn-simulator {
  background-color: var(--surface-100);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.nn-simulator__controls {
  display: flex;
  gap: 1rem;
}

#nn-prompt-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--bg-main);
  color: var(--text-main);
}

.nn-simulator__vis {
  background-color: #0f172a;
  border-radius: 8px;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.nn-svg {
  width: 100%;
  max-width: 500px;
  height: auto;
  overflow: visible;
}

.nn-node {
  fill: #334155;
  stroke: #475569;
  stroke-width: 3;
  transition: all 0.3s ease;
}

.nn-line {
  stroke: #334155;
  stroke-width: 3;
  fill: none;
  transition: stroke 0.3s ease;
}

.nn-simulator__panel {
  background-color: var(--bg-main);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-main);
}

#nn-status-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--accent-main);
}

#nn-status-desc {
  margin: 0;
  color: var(--text-muted);
}

/* State classes applied via JS */
.nn-node.active-in { fill: #3b82f6; stroke: #60a5fa; filter: url(#glow-blue); }
.nn-node.active-hidden { fill: #8b5cf6; stroke: #a78bfa; filter: url(#glow-blue); }
.nn-node.active-out-wrong { fill: #ef4444; stroke: #f87171; filter: url(#glow-red); }
.nn-node.active-out-right { fill: #22c55e; stroke: #4ade80; filter: url(#glow-green); }

/* SVG Animations */
@keyframes march-forward {
  to { stroke-dashoffset: -20; }
}
@keyframes march-backward {
  to { stroke-dashoffset: 20; }
}

.nn-line.animate-forward {
  stroke: #60a5fa;
  stroke-dasharray: 10 10;
  animation: march-forward 0.5s linear infinite;
}

.nn-line.animate-backward {
  stroke: #ef4444;
  stroke-dasharray: 10 10;
  animation: march-backward 0.5s linear infinite;
}

.nn-line.animate-success {
  stroke: #22c55e;
  stroke-dasharray: 10 10;
  animation: march-forward 0.5s linear infinite;
}

/* Global Header & Footer */
.global-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.global-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.global-header__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-main);
}
.global-header__back {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}
.global-header__back:hover {
  color: var(--accent-main);
}

.global-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.global-footer a {
  color: var(--accent-main);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
