/* DaF Sprachdiagnostik v2 – Hauptstylesheet */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

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

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

/* Layout */
.container { max-width: 800px; margin: 0 auto; padding: 0 1rem; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 800px; margin: 0 auto; padding: 0 1rem;
}
.logo { font-size: 1.1rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.logo span { color: var(--text-muted); font-weight: 400; }

/* Progress bar */
.progress-bar {
  background: var(--border);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: #eff6ff; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* Lückentext */
.lueckentext-container {
  font-size: 1.05rem;
  line-height: 2.2;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin: 1rem 0;
}
.luecke-wrapper {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin: 0 2px;
}
.luecke-input {
  display: inline-block;
  width: 90px;
  border: none;
  border-bottom: 2px solid var(--primary);
  background: transparent;
  padding: 2px 4px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.luecke-input:focus { border-bottom-color: var(--primary-dark); }
.luecke-input.korrekt { border-bottom-color: var(--success); background: #f0fdf4; }
.luecke-input.falsch { border-bottom-color: var(--danger); background: #fef2f2; }
.luecke-nr {
  font-size: 0.65rem;
  color: var(--text-muted);
  vertical-align: super;
  margin-left: 1px;
}

/* Skill-Profil */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.skill-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.skill-item-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.4rem;
}
.skill-item-titel { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.skill-item-niveau { font-size: 0.7rem; color: var(--text-muted); }
.skill-bar { background: var(--border); height: 6px; border-radius: 3px; overflow: hidden; }
.skill-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.skill-bar-fill.hoch { background: var(--success); }
.skill-bar-fill.mittel { background: var(--warning); }
.skill-bar-fill.niedrig { background: var(--danger); }
.skill-prozent { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; text-align: right; }

/* Empfehlungen */
.empfehlung-card {
  border-left: 4px solid var(--primary);
  background: #eff6ff;
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.empfehlung-card.hoch { border-left-color: var(--danger); background: #fef2f2; }
.empfehlung-card.mittel { border-left-color: var(--warning); background: #fffbeb; }
.empfehlung-titel { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.empfehlung-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.empfehlung-beschreibung { font-size: 0.85rem; color: var(--text); }

/* Niveau-Badge */
.niveau-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
}

/* Alerts */
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* Spinner */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modul-Fortschritt */
.modul-steps {
  display: flex; gap: 0.5rem; margin: 1.5rem 0;
  overflow-x: auto; padding-bottom: 0.5rem;
}
.modul-step {
  flex: 1; min-width: 80px;
  text-align: center;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
}
.modul-step.aktiv { background: var(--primary); color: white; border-color: var(--primary); }
.modul-step.fertig { background: #f0fdf4; border-color: #bbf7d0; color: var(--success); }

/* Responsive */
@media (max-width: 600px) {
  .lueckentext-container { padding: 1rem; font-size: 0.95rem; }
  .skill-grid { grid-template-columns: 1fr 1fr; }
  .card { padding: 1rem; }
}
