/* ============================================
   CSS VARIABLEN - HIER FARBEN ANPASSEN
   ============================================ */
:root {
  /* Hauptfarben */
  --primary-color: #1e3a5f;
  --primary-light: #2563eb;
  --primary-dark: #1e40af;
  
  /* Feedback-Farben */
  --success-color: #22c55e;
  --success-light: #dcfce7;
  --error-color: #ef4444;
  --error-light: #fee2e2;
  
  /* Neutrale Farben */
  --text-color: #333;
  --text-light: #666;
  --background: #f5f5f5;
  --white: #fff;
  --border-color: #ddd;
  
  /* Schatten */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ============================================
   RESET & BASIS
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;

}

.logo:hover {
  background-color: var(--success-light);
}

.header-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
}

.score-display {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

#score-points {
  font-weight: 600;
  color: var(--primary-color);
}

/* ============================================
   HERO BEREICH
   ============================================ */
.hero {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}

.hero-title {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.1em;
}

/* ============================================
   CONTAINER & CONTENT
   ============================================ */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.content-box {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.intro-text {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* ============================================
   SEITEN-NAVIGATION
   ============================================ */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ============================================
   MODUS-AUSWAHL (STARTSEITE)
   ============================================ */
.mode-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.mode-card {
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.mode-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.mode-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.mode-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ============================================
   ROTER BEREICH (FALSCHE FRAGEN)
   ============================================ */
.wrong-questions-box {
  background: var(--error-light);
  border: 2px solid var(--error-color);
}

.wrong-questions-box h3 {
  color: var(--error-color);
}

.wrong-summary {
  background: var(--error-light);
  border: 2px solid var(--error-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}

.wrong-summary-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--error-color);
  font-weight: 600;
}

/* ============================================
   PRÜFUNGS-ANMELDUNG
   ============================================ */
.registration-box {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-light);
}

.form-group input.error {
  border-color: var(--error-color);
}

.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: block;
}

.exam-info {
  background: var(--background);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.exam-info h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.exam-info ul {
  margin-left: 1.25rem;
  color: var(--text-light);
}

.exam-info li {
  margin-bottom: 0.5rem;
}

/* ============================================
   FORTSCHRITTSBALKEN
   ============================================ */
.progress-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--success-color));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  min-width: 45px;
  text-align: right;
}

/* ============================================
   FRAGE-BEREICH
   ============================================ */
.question-number {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

#question-text {
  color: var(--primary-color);
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ============================================
   FRAGE-BILD
   ============================================ */
.question-image-container {
  display: none;
  margin-bottom: 1.5rem;
  text-align: center;
}

.question-image-container.visible {
  display: block;
}

.question-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* ============================================
   ANTWORT-OPTIONEN
   ============================================ */
.exercise-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.exercise-option {
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
}

.exercise-option:hover:not(.disabled) {
  border-color: var(--primary-light);
  background: rgba(37, 99, 235, 0.05);
}

.exercise-option.correct {
  border-color: var(--success-color);
  background: var(--success-light);
}

.exercise-option.incorrect {
  border-color: var(--error-color);
  background: var(--error-light);
}

.exercise-option.show-correct {
  border-color: var(--success-color);
  background: var(--success-light);
}

.exercise-option.selected {
  border-color: var(--primary-light);
  background: rgba(37, 99, 235, 0.1);
}

.exercise-option.disabled {
  cursor: default;
  opacity: 0.8;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary-light);
  color: var(--white);
  border-color: var(--primary-light);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--text-light);
  border-color: var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.btn-danger {
  background: var(--error-color);
  color: var(--white);
  border-color: var(--error-color);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-full {
  width: 100%;
}

.quiz-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   ERGEBNIS-ANZEIGE
   ============================================ */
.result-display {
  text-align: center;
  margin: 2rem 0;
}

.result-score {
  font-size: 4rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.result-label {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.result-percentage {
  font-size: 2rem;
  font-weight: 700;
  color: var(--success-color);
  text-align: center;
  margin-bottom: 1rem;
}

.result-percentage.result-passed {
  color: var(--success-color);
}

.result-percentage.result-failed {
  color: var(--error-color);
}

.result-message {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--background);
  border-radius: 8px;
}

/* ============================================
   URKUNDE
   ============================================ */
.certificate-container {
  margin: 2rem 0;
  text-align: center;
}

#certificate-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

/* ============================================
   NICHT BESTANDEN
   ============================================ */
.failed-message {
  background: var(--error-light);
  border: 2px solid var(--error-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}

.failed-message p {
  color: var(--error-color);
  margin-bottom: 0.5rem;
}

.failed-message p:last-child {
  margin-bottom: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--white);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* ============================================
   HILFKLASSEN
   ============================================ */
.hidden {
  display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 1rem;
  }
  
  .content-box {
    padding: 1.25rem;
  }
  
  .mode-selection {
    grid-template-columns: 1fr;
  }
  
  .quiz-buttons {
    flex-direction: column;
  }
  
  .quiz-buttons .btn {
    width: 100%;
  }
  
  .result-score {
    font-size: 3rem;
  }
}

/* ============================================
   MEHRFACHAUSWAHL
   ============================================ */
.multi-select-hint {
  background: #e0f2fe;
  border: 2px solid #0ea5e9;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #0369a1;
  font-size: 0.9rem;
  text-align: center;
}

.exercise-option.selected-multi {
  border-color: var(--primary-light);
  background: rgba(37, 99, 235, 0.15);
  border-width: 3px;
}

.exercise-option.selected-multi::before {
  content: "✓ ";
  color: var(--primary-light);
  font-weight: bold;
}

.exercise-option.missed {
  border-color: #f59e0b;
  background: #fef3c7;
}

.exercise-option.missed::after {
  content: " ← Diese Antwort fehlte!";
  color: #d97706;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-secondary {
  background: #0ea5e9;
  color: var(--white);
  border-color: #0ea5e9;
}

.btn-secondary:hover {
  background: #0284c7;
  border-color: #0284c7;
}
