/* ============================================
   DESIGN SYSTEM – Kurs-Unterseiten
   Dark, elegant, warm
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1f2a45;
  --accent-gold: #d4a843;
  --accent-teal: #2dd4bf;
  --text-primary: #f0ece4;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(212, 168, 67, 0.15);
  --glow-gold: rgba(212, 168, 67, 0.3);
  --glow-teal: rgba(45, 212, 191, 0.3);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --nav-height: 64px;
  --panel-width: 420px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #e6be5a;
}

a:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

img {
  display: block;
  max-width: 100%;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: #e6be5a;
  color: var(--bg-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--glow-gold);
}

.btn-outline {
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 168, 67, 0.08);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

/* ============================================
   NAVIGATION (Shared)
   ============================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-brand:hover {
  color: var(--accent-gold);
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.nav-back:hover {
  color: var(--accent-gold);
}

.nav-back svg {
  width: 16px;
  height: 16px;
}

/* --- Progress Bar (visual only) --- */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-teal));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   OVERVIEW PAGE – Hero & Grid
   ============================================ */
.overview-hero {
  padding: 80px 0 48px;
  text-align: center;
}

.overview-hero h1 {
  margin-bottom: 16px;
}

.overview-hero .subtitle {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 0 48px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(212, 168, 67, 0.1);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* --- Course Grid --- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  padding-bottom: 80px;
}

/* --- Course Card --- */
.course-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  transition: all 0.4s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.course-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-subtle);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 40px var(--glow-gold);
  background: var(--bg-card-hover);
}

.course-card:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Card Image / Gradient Placeholder */
.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-image-bg {
  width: 100%;
  height: 100%;
  transition: opacity 0.4s ease;
}

.course-card:hover .card-image-bg {
  opacity: 0.85;
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(8px);
  color: var(--accent-gold);
  border: 1px solid var(--border-subtle);
}

/* Card Body */
.card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  margin-bottom: 10px;
  transition: color var(--transition);
}

.course-card:hover .card-body h3 {
  color: var(--accent-gold);
}

.card-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 20px;
}

/* Card Meta */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  margin-top: auto;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Card Footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.card-price {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.card-price.free {
  color: var(--accent-teal);
}

.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-link:hover,
.course-card:hover .card-link {
  color: var(--accent-gold);
}

.card-link .arrow {
  transition: transform var(--transition);
}

.course-card:hover .card-link .arrow {
  transform: translateX(4px);
}

/* ============================================
   KURS DETAIL PAGE
   ============================================ */
.kurs-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.kurs-page .site-nav {
  flex-shrink: 0;
}

.kurs-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* --- Network Canvas --- */
#network-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--bg-primary);
}

#network-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Ambient Particles --- */
.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.12);
  pointer-events: none;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(40px); opacity: 0; }
}

/* --- Node Pulse Animation --- */
@keyframes node-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

/* --- Network Legend --- */
.network-legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
  z-index: 10;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.main { background: var(--accent-gold); }
.legend-dot.sub { background: var(--accent-teal); }
.legend-dot.deep { background: var(--text-muted); }

/* --- Network Hint --- */
.network-hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
  color: var(--text-muted);
  z-index: 10;
  opacity: 1;
  transition: opacity 1s ease;
  pointer-events: none;
}

.network-hint.hidden {
  opacity: 0;
}

/* ============================================
   SIDE PANEL
   ============================================ */
.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--panel-width);
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  z-index: 20;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.side-panel.open {
  transform: translateX(0);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}

/* Panel Header */
.panel-header {
  padding: 24px 24px 0;
  position: relative;
  flex-shrink: 0;
}

.panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.panel-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.panel-close:focus-visible {
  outline: 2px solid var(--accent-gold);
}

.node-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.node-type-badge.main {
  background: rgba(212, 168, 67, 0.15);
  color: var(--accent-gold);
}

.node-type-badge.sub {
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent-teal);
}

.node-type-badge.deep {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.panel-header h2 {
  font-size: 1.6rem;
  padding-right: 40px;
  margin-bottom: 12px;
}

.panel-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Panel Content */
.panel-content {
  padding: 20px 24px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Content Block (generic) --- */
.content-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.content-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.content-block-header svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

/* --- Video Block --- */
.video-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background var(--transition);
}

.video-item:hover {
  background: rgba(255,255,255,0.03);
}

.video-play-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.video-item:hover .video-play-icon {
  background: rgba(212, 168, 67, 0.2);
  box-shadow: 0 0 16px var(--glow-gold);
}

.video-play-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent-gold);
  margin-left: 2px;
}

.video-info {
  flex: 1;
}

.video-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.video-duration {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- PDF Block --- */
.pdf-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background var(--transition);
}

.pdf-item:hover {
  background: rgba(255,255,255,0.03);
}

.pdf-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-teal);
  letter-spacing: 0.05em;
}

.pdf-info {
  flex: 1;
}

.pdf-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pdf-size {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Text / Accordion Block --- */
.text-accordion {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.text-accordion:last-child {
  border-bottom: none;
}

.text-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition);
}

.text-toggle:hover {
  color: var(--accent-gold);
}

.text-toggle:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: -2px;
}

.text-toggle .chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
  opacity: 0.5;
  flex-shrink: 0;
}

.text-accordion.open .text-toggle .chevron {
  transform: rotate(180deg);
}

.text-body {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.text-accordion.open .text-body {
  max-height: 800px;
  padding: 0 16px 16px;
}

.text-body p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
}

/* --- Quiz Block --- */
.quiz-question {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.quiz-question:last-child {
  border-bottom: none;
}

.quiz-question-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 14px;
  font-weight: 500;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.quiz-option:hover:not(.answered) {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.quiz-option .radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.quiz-option.correct {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.3);
  color: var(--accent-teal);
}

.quiz-option.correct .radio-circle {
  border-color: var(--accent-teal);
  background: var(--accent-teal);
}

.quiz-option.correct .radio-circle::after {
  content: '✓';
  font-size: 0.7rem;
  color: var(--bg-primary);
  font-weight: 700;
}

.quiz-option.incorrect {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: rgba(239, 68, 68, 0.8);
}

.quiz-option.incorrect .radio-circle {
  border-color: rgba(239, 68, 68, 0.5);
}

.quiz-option.answered {
  pointer-events: none;
}

.quiz-feedback {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  display: none;
}

.quiz-feedback.correct {
  display: block;
  background: rgba(45, 212, 191, 0.08);
  color: var(--accent-teal);
}

.quiz-feedback.incorrect {
  display: block;
  background: rgba(239, 68, 68, 0.06);
  color: rgba(239, 68, 68, 0.8);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 32px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.04);
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent-gold);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .side-panel {
    width: 360px;
  }

  .network-legend {
    bottom: 16px;
    left: 16px;
    padding: 12px 16px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .overview-hero {
    padding: 60px 0 32px;
  }

  .filter-bar {
    padding: 0 0 32px;
  }

  /* Panel as bottom sheet on mobile */
  .side-panel {
    width: 100%;
    height: 75vh;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .side-panel.open {
    transform: translateY(0);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  }

  .network-legend {
    bottom: 12px;
    left: 12px;
    right: 12px;
    flex-direction: row;
    justify-content: center;
  }

  .network-hint {
    font-size: 0.75rem;
    padding: 8px 16px;
  }

  .progress-bar-container {
    display: none;
  }

  .nav-brand span {
    display: none;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .card-meta {
    gap: 10px;
  }

  .card-body {
    padding: 18px;
  }

  .panel-header h2 {
    font-size: 1.3rem;
  }
}

/* ============================================
   SCROLLBAR (Panel)
   ============================================ */
.side-panel::-webkit-scrollbar {
  width: 6px;
}

.side-panel::-webkit-scrollbar-track {
  background: transparent;
}

.side-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}

.side-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.course-card {
  animation: fade-in-up 0.5s ease both;
}

.course-card:nth-child(1) { animation-delay: 0.05s; }
.course-card:nth-child(2) { animation-delay: 0.1s; }
.course-card:nth-child(3) { animation-delay: 0.15s; }
.course-card:nth-child(4) { animation-delay: 0.2s; }
