/* Mini-Kurse – Vollbild-Folien (Querformat) */

:root {
  --primary: #5C6BC0;
  --primary-dark: #3F51B5;
  --primary-light: #C5CAE9;
  --primary-lighter: #7986CB;
  --primary-bg: #E8EAF6;
  --success: #4CAF50;
  --error: #F44336;
  --warning: #FF9800;
  --bg: #1a1a2e;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --text-light: #999;
  --radius: 12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  font-size: 18px;
}

/* ── Folien-Container ───────────────────────── */

.slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide {
  display: none;
  position: absolute;
  top: 2vh; left: 2vw;
  width: 96vw;
  height: 96vh;
  border-radius: 16px;
  background: var(--card);
  padding: 48px 80px 80px;
  overflow-y: auto;
  animation: fadeIn 0.35s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.slide.active { display: flex; flex-direction: column; }

.slide .slide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Titelfolie ─────────────────────────────── */

.slide.title-slide {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-lighter));
  color: white;
  text-align: center;
  justify-content: center;
  align-items: center;
}

.slide.title-slide .slide-content { justify-content: center; align-items: center; }

.slide.title-slide h1 {
  font-size: 3.2em;
  color: white;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.slide.title-slide .subtitle {
  font-size: 1.4em;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
}

.slide.title-slide .badge {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 24px;
  border-radius: 30px;
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 24px;
  display: inline-block;
}

.slide.title-slide .meta {
  color: rgba(255,255,255,0.6);
  font-size: 0.95em;
}

/* ── Typografie ─────────────────────────────── */

.slide h1 {
  font-size: 2.2em;
  color: var(--primary-dark);
  margin-bottom: 8px;
  line-height: 1.2;
}

.slide h2 {
  font-size: 1.2em;
  color: var(--primary-dark);
  margin: 20px 0 8px 0;
}

.slide p { margin-bottom: 14px; }

.slide .subtitle {
  font-size: 1.15em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.slide ul, .slide ol { margin: 8px 0 14px 28px; }
.slide li { margin-bottom: 6px; }

/* ── Zwei-Spalten-Layout ────────────────────── */

.columns {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.columns .col { flex: 1; }

/* ── Code-Blöcke ────────────────────────────── */

code {
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Fira Code", "Source Code Pro", Consolas, monospace;
  font-size: 0.88em;
}

pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 18px 22px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 0.88em;
  line-height: 1.6;
}

pre code { background: none; padding: 0; color: inherit; }

.cmd { color: #66d9ef; }
.arg { color: #a6e22e; }
.cmt { color: #75715e; }
.str { color: #e6db74; }

/* ── Diagramme ──────────────────────────────── */

.diagram { text-align: center; margin: 20px 0; }
.diagram svg { max-width: 90%; height: auto; max-height: 50vh; margin: 0 auto; display: block; }

/* ── Info/Tipp-Boxen ────────────────────────── */

.info-box {
  background: var(--primary-bg);
  border-left: 4px solid var(--primary);
  padding: 14px 20px;
  border-radius: 0 10px 10px 0;
  margin: 16px 0;
  font-size: 0.95em;
}

.info-box.analogy {
  background: #FFF3E0;
  border-left-color: var(--warning);
}

.info-box .icon { font-size: 1.2em; margin-right: 8px; }

/* ── Zurück-zur-Übersicht-Button ────────────── */

.back-link {
  position: fixed;
  top: calc(2vh + 14px);
  left: calc(2vw + 18px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.92);
  color: #333;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.2s, box-shadow 0.2s;
}

.back-link:hover { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.back-link .back-arrow { font-size: 1rem; }

/* ── Navigation (fest am unteren Rand) ──────── */

.nav-bar {
  position: fixed;
  bottom: 2vh;
  left: 2vw;
  right: 2vw;
  display: flex;
  align-items: center;
  padding: 14px 40px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid #eee;
  border-radius: 0 0 16px 16px;
  z-index: 100;
  gap: 12px;
}

.nav-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-btn:hover { background: var(--primary-dark); }
.nav-btn:disabled { background: #ccc; cursor: not-allowed; }

.nav-btn.secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.nav-btn.secondary:hover { background: var(--primary-light); }
.nav-btn.secondary:disabled { border-color: #ccc; color: #ccc; }

.progress-dots { display: flex; gap: 10px; order: 1; }

.btn-prev { order: 3; }
.btn-next { order: 4; }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
  transition: all 0.3s;
}

.dot.active { background: var(--primary); transform: scale(1.2); }
.dot.done { background: var(--success); }

.slide-counter {
  color: var(--text-light);
  font-size: 0.85em;
  font-weight: 600;
  order: 2;
  margin-right: auto;
}

/* ── Quiz ───────────────────────────────────── */

.quiz-question { margin-bottom: 24px; }

.quiz-question h3 {
  font-size: 1em;
  margin-bottom: 10px;
  color: var(--text);
}

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

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8f8f8;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.92em;
}

.quiz-option:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-bg); }
.quiz-option.correct { border-color: var(--success); background: #E8F5E9; }
.quiz-option.wrong { border-color: var(--error); background: #FFEBEE; }
.quiz-option input[type="radio"] { display: none; }

.quiz-radio {
  width: 18px; height: 18px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.quiz-option.selected .quiz-radio { border-color: var(--primary); }
.quiz-option.selected .quiz-radio::after {
  content: ""; width: 8px; height: 8px;
  background: var(--primary); border-radius: 50%;
  position: absolute; top: 3px; left: 3px;
}
.quiz-option.correct .quiz-radio { border-color: var(--success); }
.quiz-option.correct .quiz-radio::after { background: var(--success); }

.quiz-result {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
  margin-top: 16px;
  display: none;
}

.quiz-result.show { display: block; }
.quiz-result .score { font-size: 1.8em; font-weight: 700; }
.quiz-result.good { background: #E8F5E9; }
.quiz-result.good .score { color: var(--success); }
.quiz-result.ok { background: #FFF3E0; }
.quiz-result.ok .score { color: var(--warning); }
.quiz-result.bad { background: #FFEBEE; }
.quiz-result.bad .score { color: var(--error); }

/* ── Interaktive Übungen ───────────────────── */

.exercise-box {
  background: var(--primary-bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}

.exercise-title {
  font-size: 0.95em;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.exercise-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.exercise-code {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: "Fira Code", "Source Code Pro", Consolas, monospace;
  font-size: 0.88em;
  white-space: nowrap;
}

.exercise-blank {
  background: rgba(255,255,255,0.15);
  border: 2px dashed rgba(255,255,255,0.4);
  border-radius: 4px;
  color: #f8f8f2;
  font-family: inherit;
  font-size: inherit;
  padding: 2px 6px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.exercise-blank::placeholder { color: rgba(255,255,255,0.3); }
.exercise-blank:focus { border-color: var(--primary-lighter); background: rgba(255,255,255,0.2); }
.exercise-blank.correct { border-color: var(--success); background: rgba(76,175,80,0.25); border-style: solid; }
.exercise-blank.wrong { border-color: var(--error); background: rgba(244,67,54,0.15); border-style: solid; }

.exercise-hint {
  font-size: 0.8em;
  color: var(--text-muted);
  font-style: italic;
}

.exercise-feedback {
  font-size: 1.1em;
  font-weight: 700;
  min-width: 18px;
}

.exercise-feedback.correct { color: var(--success); }
.exercise-feedback.wrong { color: var(--error); }

/* ── CTA ────────────────────────────────────── */

.cta-box {
  text-align: center;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  color: white;
  margin-top: 20px;
}

.cta-box h2 { color: white; margin-bottom: 10px; }
.cta-box p { color: rgba(255,255,255,0.85); margin-bottom: 16px; }

.cta-btn {
  display: inline-block;
  background: white;
  color: var(--primary-dark);
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s;
}

.cta-btn:hover { transform: translateY(-2px); }

/* ── Responsive ─────────────────────────────── */

@media (max-width: 900px) {
  .slide { padding: 32px 32px 80px; }
  .slide h1 { font-size: 1.6em; }
  .slide.title-slide h1 { font-size: 2.2em; }
  .columns { flex-direction: column; gap: 20px; }
  pre { font-size: 0.8em; padding: 14px; }
  .nav-bar { padding: 10px 20px; }
}

@media (max-height: 600px) {
  .slide { padding: 24px 48px 70px; }
  .slide h1 { font-size: 1.5em; }
  .info-box { padding: 10px 14px; font-size: 0.88em; }
  pre { padding: 12px; font-size: 0.82em; }
}

/* ── Print ──────────────────────────────────── */

@media print {
  html, body { overflow: visible; height: auto; }
  .slide {
    display: block !important;
    position: relative;
    height: auto;
    min-height: 100vh;
    page-break-after: always;
    box-shadow: none;
  }
  .nav-bar { display: none; }
}
