/* ==========================================================================
   ZAP Swiss Gymi Coach — Modern Glassmorphic Stylesheet (Sonja Edition)
   ========================================================================== */

:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #131b2e;
  --bg-card: rgba(22, 33, 56, 0.75);
  --bg-card-hover: rgba(30, 45, 75, 0.9);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #e11d48; /* Swiss Red accent */
  --accent-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

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

:focus-visible {
  outline: 3px solid var(--border-focus) !important;
  outline-offset: 2px !important;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Header & Navbar */
header {
  background: rgba(10, 15, 29, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flag {
  font-size: 2.2rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 750;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Gamification HUD */
.gamification-hud {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hud-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
}

.hud-xp-container {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 140px;
}

.xp-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.hud-streak {
  font-weight: 700;
  color: #f59e0b;
}

.flame {
  font-size: 1.2rem;
}

.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.sound-toggle-btn.muted {
  opacity: 0.65;
}

.sound-toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.d-none {
  display: none !important;
}

/* Auth Widget */
.auth-widget {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-logged-out {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dev-auth-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-dev-auth {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dev-auth:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

.auth-logged-in {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.2rem 0.65rem 0.2rem 0.35rem;
}

.user-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-email-display {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(225, 29, 72, 0.2);
  border-color: var(--accent);
  color: #fff;
}

/* Sub-Navigation Tabs */
.sub-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1.5rem;
}

.nav-tabs {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #fff;
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid rgba(225, 29, 72, 0.4);
}

/* Main Content & Tabs */
main {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards & Layout */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Timer Box */
.timer-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.timer-box button {
  min-height: 40px;
  padding: 0.4rem 0.85rem;
}

.timer-display {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: monospace;
  color: #38bdf8;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(10, 15, 29, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
  background: transparent;
  color: #38bdf8;
  border-color: #38bdf8;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
}

/* Badges & Pills */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.badge-accent {
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.3);
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pill-btn.active, .pill-btn:hover {
  background: #38bdf8;
  color: #0a0f1d;
  font-weight: 700;
}

.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  margin-left: 0.35rem;
  transition: all 0.2s ease;
}

.pill-btn.active .pill-count,
.pill-btn:hover .pill-count {
  background: rgba(10, 15, 29, 0.45);
  color: #fff;
}

/* Evaluation Scorecard */
.result-box {
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.grade-badge {
  background: var(--gold-gradient);
  color: #0a0f1d;
  font-size: 1.25rem;
  font-weight: 850;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-sm);
}

.summary-lead {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

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

.pillar-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.pillar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.pillar-score {
  font-size: 1.2rem;
  font-weight: 800;
  color: #38bdf8;
  margin: 0.25rem 0 0.5rem;
}

.pillar-feedback {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Transparency Card & Hurdle Indicator */
.transparency-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
}

.transparency-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.95rem;
}

.hurdle-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hurdle-pill {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hurdle-pill.reached {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.hurdle-pill.close {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.hurdle-pill.pending {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.scoring-rationale-box {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid #38bdf8;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.improvement-lever-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(225, 29, 72, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #fef08a;
}

/* Pillar Card Header & Subcriteria */
.pillar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.subcriteria-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.subcriterion-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.subcriterion-chip.erfüllt {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.subcriterion-chip.teilweise {
  background: rgba(245, 158, 11, 0.15);
  color: #fde047;
  border-color: rgba(245, 158, 11, 0.3);
}

.subcriterion-chip.ausbaufähig {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.pillar-justification-section {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #cbd5e1;
}

.justification-heading {
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 0.25rem;
}

.justification-list,
.strengths-list,
.improvements-list {
  padding-left: 1.1rem;
  margin-top: 0.2rem;
}

.justification-list li,
.strengths-list li,
.improvements-list li {
  margin-bottom: 0.2rem;
}

.pillar-subheading {
  font-weight: 700;
  font-size: 0.8rem;
}

.strengths-list li {
  font-size: 0.8rem;
  color: #86efac;
}

.improvements-list li {
  font-size: 0.8rem;
  color: #fde047;
}

.spelling-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.spelling-box h4 {
  font-size: 0.9rem;
  color: #fca5a5;
  margin-bottom: 0.5rem;
}

.spelling-box ul {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: #fee2e2;
}

/* Quiz Card */
.quiz-card {
  background: rgba(10, 15, 29, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.quiz-question {
  font-size: 1.2rem;
  font-weight: 650;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.15rem;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-option-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  transform: translateX(2px);
}

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

.quiz-key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--accent);
  flex-shrink: 0;
  transition: all 0.2s;
}

.quiz-option-btn:hover .quiz-key-badge {
  background: var(--accent);
  color: #0b1120;
  border-color: var(--accent);
}

.quiz-feedback {
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
}

.quiz-feedback.correct,
.quiz-feedback.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: #6ee7b7;
}

.quiz-feedback.incorrect,
.quiz-feedback.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
}

.quiz-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.answer-comparison-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.badge-caution {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.25);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

/* Maths Trainer */
.math-problem-box {
  background: rgba(10, 15, 29, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.math-question {
  font-size: 1.35rem;
  font-weight: 750;
  color: #38bdf8;
}

.hints-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hint-card {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  color: #fde68a;
}

.scratchpad-box textarea {
  font-family: monospace;
}

.math-feedback {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.math-feedback.correct,
.math-feedback.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: #6ee7b7;
}

.math-feedback.incorrect,
.math-feedback.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
}

/* Badges & Profile Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #38bdf8;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.badge-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge-item .badge-icon {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
  line-height: 1;
}

.badge-item .badge-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.badge-item .badge-desc {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--text-secondary);
}

.badge-item.unlocked,
.badge-item.earned {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.badge-item.locked {
  opacity: 0.55;
  filter: grayscale(0.8);
  border-style: dashed;
}

.badge-status-tag {
  font-size: 0.7rem;
  margin-top: 0.4rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: inline-block;
}

.badge-item.unlocked .badge-status-tag {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-weight: 700;
}

/* Level Progress Bar & Milestones Ladder (Tab-Progress) */
.level-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f43f5e, #fbbf24);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.milestones-ladder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.25rem;
  position: relative;
}

.milestone-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  z-index: 2;
  transition: all 0.3s ease;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.milestone-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0.25rem 1.2rem 0.25rem;
  z-index: 1;
  transition: background 0.3s ease;
}

.milestone-step.step-completed .step-circle {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #fff;
}

.milestone-step.step-completed {
  color: #34d399;
}

.milestone-line.line-completed {
  background: #10b981;
}

.milestone-step.step-current .step-circle {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
  transform: scale(1.1);
}

.milestone-step.step-current {
  color: #fbbf24;
  font-weight: 750;
}

.milestone-step.step-locked {
  opacity: 0.45;
  filter: grayscale(0.8);
}

/* History Table */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Utilities */
.d-flex { display: flex; }
.d-flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1.25rem; }
.mb-4 { margin-bottom: 1.25rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* Photo Reviews Gallery & Cards */
.photo-reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.photo-review-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.photo-review-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.photo-review-card.active {
  border-color: var(--accent);
  background: rgba(225, 29, 72, 0.12);
  box-shadow: 0 0 15px rgba(225, 29, 72, 0.25);
}

.photo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.photo-card-id {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.photo-card-grade {
  font-weight: 700;
  font-size: 1rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.photo-card-grade.passed {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.photo-card-grade.failed {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.photo-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.photo-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.photo-card-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Subtabs */
.photo-review-tabs,
.math-workspace-tabs,
.essay-studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.subtab-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.subtab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.subtab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.photo-images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.photo-image-frame {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.photo-image-frame img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.photo-image-frame img:hover {
  opacity: 0.95;
}

.photo-image-caption {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  justify-content: space-between;
}

.formatted-text {
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.email-container, .corrected-container {
  background: rgba(15, 23, 42, 0.6);
  border-left: 4px solid var(--accent);
}

/* Subtab content visibility and scroll margins */
#photo-review-detail-box,
.photo-review-tabs,
.subtab-content,
#tab-photo-images {
  scroll-margin-top: 85px;
}

.subtab-content,
.essay-subtab-content {
  display: none;
}

.subtab-content.active,
.essay-subtab-content.active {
  display: block;
}

/* Interactive Photo Card Tag Buttons */
.photo-card-tag-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.photo-card-tag-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.photo-card-tag-btn.highlight-corrected {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.photo-card-tag-btn.highlight-corrected:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent);
  color: #ffffff;
}

.photo-card-tag-btn.highlight-email {
  border-color: rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.photo-card-tag-btn.highlight-email:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
}

.photo-card-footer {
  font-size: 0.78rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Photo Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.lightbox-close-btn {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-close-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.lightbox-caption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Markdown typography in reviews */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--text-primary);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.markdown-body h1 { font-size: 1.35rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.4rem; }
.markdown-body h2 { font-size: 1.15rem; }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body p { margin-bottom: 0.85rem; line-height: 1.65; }
.markdown-body hr { border: none; border-top: 1px solid var(--border-color); margin: 1.25rem 0; }
.markdown-body ul, .markdown-body ol { margin-left: 1.5rem; margin-bottom: 0.85rem; }
.markdown-body li { margin-bottom: 0.35rem; }
.markdown-body strong { color: #f8fafc; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border-color); padding: 0.5rem 0.75rem; text-align: left; }
.markdown-body th { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }

/* ==========================================================================
   ZAP Mathematics Hub — Langgymnasium Competency System & Diagnostics
   ========================================================================== */

.math-scorecard {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.math-scorecard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.scorecard-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.scorecard-flag-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.scorecard-heading {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: #f8fafc;
  margin: 0;
}

.scorecard-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.scorecard-badges-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.math-grade-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.math-grade-label,
.threshold-pills-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 600;
}

.math-grade-badge {
  font-size: 1.45rem;
  font-weight: 800;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
  min-width: 110px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.math-grade-badge.passed {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.math-grade-badge.failed {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.math-grade-badge.neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.threshold-pills-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.threshold-pills {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.threshold-pill {
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.threshold-pill.passed {
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
}

.threshold-pill.pending {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
}

.math-scorecard-status-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.math-scorecard-status-banner.passed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
}

.math-scorecard-status-banner.pending {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.25);
}

.math-scorecard-status-banner.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
}

.status-banner-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.status-banner-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e2e8f0;
}

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

.section-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-kpi-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.section-kpi-card.active {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.kpi-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-score-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.kpi-grade {
  font-size: 1.4rem;
  font-weight: 800;
  color: #38bdf8;
}

.kpi-accuracy {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.kpi-diag-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.kpi-diag-tag.done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* Tutor Advice Banner */
.tutor-advice-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.tutor-advice-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 750;
  color: #fbbf24;
  margin-bottom: 0.75rem;
}

.tutor-quote-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-style: italic;
  font-size: 0.92rem;
  color: #f1f5f9;
  margin-bottom: 0.6rem;
}

.tutor-rule-box {
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Section Switcher Pills */
.math-section-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.math-section-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.math-section-pill:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #fff;
  border-color: #38bdf8;
}

.math-section-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

/* Gotchas (ZAP Fallen) */
.gotchas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.gotcha-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gotcha-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gotcha-section {
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
}

.gotcha-trap {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--danger);
  color: #fecaca;
}

.gotcha-fix {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--success);
  color: #a7f3d0;
}

.gotcha-impact {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--warning);
  color: #fde68a;
  font-size: 0.82rem;
}

/* Example Exercises (Musteraufgaben) */
.example-exercises-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.example-exercise-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.example-exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.exercise-steps-box {
  background: rgba(10, 15, 29, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
}

.step-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.step-num {
  font-weight: 700;
  color: #38bdf8;
  min-width: 1.5rem;
}

.rubric-callout {
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #bae6fd;
  margin-top: 0.75rem;
}

/* Diagnostic Benchmark Questions */
.diagnostic-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.diagnostic-q-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.diagnostic-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.diagnostic-q-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 0.75rem;
}

.diagnostic-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 320px;
}

/* ==========================================================================
   ZAP Reading Comprehension (Textverständnis) Studio
   ========================================================================== */

.reading-workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 950px) {
  .reading-workspace {
    grid-template-columns: 1fr;
  }
}

.reading-text-pane {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-height: 750px;
  overflow-y: auto;
}

.reading-text-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.25rem;
}

.reading-text-author {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  display: block;
}

.reading-text-intro {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
}

.reading-lines-container {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.reading-line-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.22rem 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background 0.1s ease;
}

.reading-line-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.reading-line-item.highlighted {
  background: rgba(245, 158, 11, 0.22);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  animation: pulseHighlight 1.5s ease-in-out;
}

@keyframes pulseHighlight {
  0% { background: rgba(245, 158, 11, 0.45); }
  100% { background: rgba(245, 158, 11, 0.22); }
}

.line-highlight-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  padding: 0.28rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  margin-top: 0.35rem;
  transition: all 0.2s ease;
}

.line-highlight-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
  transform: translateY(-1px);
}

.reading-line-num {
  min-width: 2.2rem;
  text-align: right;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.8rem;
  user-select: none;
  padding-right: 0.5rem;
  border-right: 1px solid var(--border-color);
}

.reading-line-num.milestone {
  color: #38bdf8;
  font-weight: 700;
}

.reading-line-text {
  flex: 1;
  color: #e2e8f0;
}

.reading-questions-pane {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.reading-questions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.reading-questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.reading-q-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.reading-q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.reading-q-prompt {
  font-size: 0.96rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.reading-q-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reading-option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
  color: #e2e8f0;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.reading-option-label:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.reading-option-label input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: #38bdf8;
  cursor: pointer;
}

.reading-evidence-box {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: rgba(56, 189, 248, 0.05);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
}

.reading-evidence-box label {
  display: block;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.reading-evidence-box input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: #f8fafc;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 280px;
  font-size: 0.88rem;
}

.reading-evidence-box input:focus {
  outline: none;
  border-color: #38bdf8;
}

.reading-feedback-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reading-feedback-card {
  padding: 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.reading-feedback-card.is-correct {
  border-left-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.reading-feedback-card.is-partial {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.05);
}

.reading-feedback-card.is-wrong {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
}

.reading-feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}

.reading-feedback-answers {
  font-size: 0.88rem;
  color: #e2e8f0;
  margin-bottom: 0.4rem;
}

.reading-feedback-evidence {
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.reading-feedback-explanation {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin-top: 0.4rem;
}

.reading-feedback-tip {
  font-size: 0.85rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.6rem;
  line-height: 1.45;
}

/* ==========================================================================
   German Module Workspace Tabs & Overview Card (Sonja UX)
   ========================================================================== */

.german-overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.german-overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.german-exam-pillars-summary {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.exam-pillar-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.exam-pillar-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.exam-pillar-pill .pill-icon {
  font-size: 1.3rem;
}

.exam-pillar-pill .pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.exam-pillar-pill .pill-text strong {
  color: #f8fafc;
  font-size: 0.88rem;
}

.exam-pillar-pill .pill-text span {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.german-workspace-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.german-workspace-tabs .subtab-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.german-workspace-tabs .subtab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.german-workspace-tabs .subtab-btn.active {
  background: #38bdf8;
  color: #0b1120;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
  font-weight: 700;
}

.german-workspace {
  display: none;
}

.german-workspace.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Touch Targets & Button Accessibility (UX-013) */
.tab-btn,
.subtab-btn,
.pill-btn,
.math-section-pill,
.hint-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Loading Skeleton Shimmer (UX-018) */
.loading-placeholder,
.skeleton-loader {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Celebration Confetti Particles (UX-016) */
.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color, #fbbf24);
  pointer-events: none;
  z-index: 9999;
  animation: confettiFly 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes confettiFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x, 0px), var(--y, -60px)) scale(0.3);
  }
}

/* Mobile & Tablet Responsive Enhancements (UX-014) */
@media (max-width: 768px) {
  header {
    padding: 0.5rem 1rem;
  }
  .nav-container {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .brand {
    justify-content: center;
  }
  .gamification-hud {
    justify-content: space-around;
    padding: 0.4rem 0.6rem;
  }
  .sub-nav {
    padding: 0.4rem 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-tabs {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  main {
    padding: 0 0.75rem;
    margin: 1rem auto;
  }
}

/* Vestibular Accessibility & Motion Sensitivity */
@media (prefers-reduced-motion: reduce) {
  .confetti-particle {
    display: none !important;
  }
  .loading-placeholder,
  .skeleton-loader {
    animation: none !important;
  }
}

/* Photo Upload Modal & Dropzone */
.photo-upload-modal {
  z-index: 10000;
}

.upload-modal-dialog {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 16px);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

.upload-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: rgba(239, 68, 68, 1);
}

.upload-dropzone {
  border: 2px dashed var(--primary, #6366f1);
  border-radius: var(--radius-md, 12px);
  background: rgba(99, 102, 241, 0.05);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.upload-dropzone:hover,
.upload-dropzone:focus-visible,
.upload-dropzone.drag-over {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.dropzone-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.dropzone-text {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.dropzone-link {
  color: var(--primary-light, #818cf8);
  text-decoration: underline;
  font-weight: 600;
}

.dropzone-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.upload-thumbnail-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
}

.upload-thumbnail-img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.upload-thumbnail-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  pointer-events: none;
}

.upload-thumbnail-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.upload-thumbnail-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.upload-thumbnail-meta {
  padding: 0.35rem 0.45rem;
  font-size: 0.68rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-options-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.custom-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.custom-checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary, #6366f1);
  margin-top: 0.15rem;
  cursor: pointer;
}

.upload-status-box {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  padding: 1rem;
}

.upload-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary, #6366f1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}






