 :root {
  --blue: #2a71b8;
  --blue-light: #e3f0ff;
  --green: #38a169;
  --red: #e53e3e;
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --text-main: #222;
  --text-muted: #666;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

/* Header */

.app-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--blue);
  color: #fff;
}

.app-title h1 {
  margin: 0;
  font-size: 1.4rem;
}

.app-title p {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

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

.profile label {
  font-size: 0.85rem;
}

.profile input {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: none;
  min-width: 120px;
}

.profile button {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: #ffcb00;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

.profile-status {
  font-size: 0.75rem;
  color: #fefcbf;
  margin-left: 0.5rem;
}

/* Layout */

.app-main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Cards */

.stats-card,
.badges-card,
.modules-card,
.learning-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.2rem;
}

h2 {
  margin-top: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Stats */

.stat-row {
  display: flex;
  justify-content: space-between;
  margin: 0.2rem 0;
  font-size: 0.95rem;
}

.progress-bar {
  margin-top: 0.6rem;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffcb00, #2a71b8);
  transition: width 0.3s ease;
}

.small-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Badges */

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.badge-pill {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(56, 161, 105, 0.4);
  background: rgba(198, 246, 213, 0.7);
  color: #22543d;
}

/* Module-Liste */

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

.module-item {
  border-radius: var(--radius-md);
  border: 1px solid #dce4f2;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: #f8fafc;
}

.module-item:hover {
  border-color: var(--blue);
}

.module-item.active {
  background: var(--blue-light);
  border-color: var(--blue);
}

.module-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.module-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Weiterlernen-Box */

.resume-card {
  margin-bottom: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  background: #ecfdf3;
  border: 1px solid rgba(56, 161, 105, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.resume-text {
  font-size: 0.85rem;
}

.resume-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

/* Learning Card */

#learningContent {
  margin-top: 0.8rem;
  min-height: 120px;
  font-size: 0.95rem;
}

.learning-snack {
  padding: 0.75rem 0.9rem;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--blue);
}

.snack-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.story-box {
  padding: 0.75rem 0.9rem;
  background: #fffaf0;
  border-radius: var(--radius-md);
  border-left: 4px solid #f6ad55;
}

/* Buttons */

button {
  font-family: inherit;
}

.answer-btn {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.3rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
}

.answer-btn.correct {
  background: #c6f6d5;
  border-color: var(--green);
}

.answer-btn.wrong {
  background: #fed7d7;
  border-color: var(--red);
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 0.6rem;
}

.nav-buttons button {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
}

#prevStepBtn {
  background: #e2e8f0;
}

#nextStepBtn {
  background: var(--blue);
  color: #fff;
}

/* Footer */

.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.8rem;
}

/* Mobile */

@media (max-width: 800px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .content {
    order: 1;
  }

  .profile {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: flex-start;
  }
}

.module-actions {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.module-actions button {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
}
.module-progress-wrapper {
  margin-top: 0.3rem;
}

.module-progress-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.module-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcb00, #2a71b8);
  transition: width 0.3s ease;
}

.module-progress-label {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #65748b;
}
