/* Catppuccin Mocha palette */
:root {
  --rosewater: #f5e0dc;
  --flamingo: #f2cdcd;
  --pink: #f5c2e7;
  --mauve: #cba6f7;
  --red: #f38ba8;
  --maroon: #eba0ac;
  --peach: #fab387;
  --yellow: #f9e2af;
  --green: #a6e3a1;
  --teal: #94e2d5;
  --sky: #89dceb;
  --sapphire: #74c7ec;
  --blue: #89b4fa;
  --lavender: #b4befe;
  --text: #cdd6f4;
  --subtext1: #bac2de;
  --subtext0: #a6adc8;
  --overlay2: #9399b2;
  --overlay1: #7f849c;
  --overlay0: #6c7086;
  --surface2: #585b70;
  --surface1: #45475a;
  --surface0: #313244;
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--base);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--sapphire); text-decoration: underline; }

/* DHBW-Header (Klausur-Style) */
.dhbw-header {
  background: var(--mantle);
  border-bottom: 2px solid var(--red);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dhbw-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--red);
  letter-spacing: 0.05em;
}
.dhbw-logo::before { content: "🎓 "; }
.dhbw-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}
.dhbw-nav a {
  color: var(--subtext1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.dhbw-nav a:hover {
  background: var(--surface0);
  text-decoration: none;
}
.dhbw-nav a.active {
  background: var(--red);
  color: var(--base);
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px 1fr; }
  .test-nav { display: none; }
}
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.sidebar, .test-nav {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1rem;
  height: fit-content;
  position: sticky;
  top: 1rem;
}
.sidebar h3, .test-nav h3 {
  color: var(--mauve);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
}
.sidebar ul, .test-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar li a, .test-nav li a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  color: var(--subtext1);
  font-size: 0.9rem;
}
.sidebar li a:hover, .test-nav li a:hover {
  background: var(--surface0);
  text-decoration: none;
}
.sidebar li a.active, .test-nav li a.active {
  background: var(--red);
  color: var(--base);
}

main {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  min-height: 60vh;
}

h1 { color: var(--mauve); margin-top: 0; }
h2 { color: var(--blue); border-bottom: 1px solid var(--surface1); padding-bottom: 0.3rem; margin-top: 2rem; }
h3 { color: var(--lavender); }

.frage-box {
  background: var(--base);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.frage-box .frage-meta {
  font-size: 0.8rem;
  color: var(--overlay1);
  margin-bottom: 0.5rem;
}
.frage-box .frage-titel {
  font-weight: 600;
  color: var(--peach);
  margin-bottom: 0.5rem;
}

pre, code {
  font-family: 'FiraCode Nerd Font Mono', 'Fira Code', monospace;
}
pre {
  background: var(--crust);
  border: 1px solid var(--surface0);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
}
code {
  background: var(--surface0);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--peach);
}
pre code { background: transparent; padding: 0; color: inherit; }

textarea.code-input {
  width: 100%;
  min-height: 240px;
  background: var(--crust);
  border: 1px solid var(--surface1);
  border-radius: 6px;
  padding: 0.75rem;
  color: var(--text);
  font-family: 'FiraCode Nerd Font Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  resize: vertical;
  tab-size: 4;
}
textarea.code-input:focus {
  outline: 2px solid var(--mauve);
  border-color: var(--mauve);
}

button, .btn {
  background: var(--red);
  color: var(--base);
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}
button:hover, .btn:hover { background: var(--maroon); }
button.secondary { background: var(--surface1); color: var(--text); }
button.secondary:hover { background: var(--surface2); }

.feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: pre-wrap;
}
.feedback.ok { background: rgba(166,227,161,0.12); border: 1px solid var(--green); color: var(--green); }
.feedback.warn { background: rgba(249,226,175,0.10); border: 1px solid var(--yellow); color: var(--yellow); }
.feedback.fail { background: rgba(243,139,168,0.10); border: 1px solid var(--red); color: var(--red); }

/* Aufgabenraster (Klausur-Style: 1–10 Kreise) */
.task-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin: 0.75rem 0;
}
.task-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface0);
  color: var(--subtext1);
  font-weight: 600;
  font-size: 0.85rem;
}
.task-grid a:hover { background: var(--surface1); text-decoration: none; }
.task-grid a.done { background: var(--green); color: var(--base); }
.task-grid a.partial { background: var(--yellow); color: var(--base); }
.task-grid a.failed { background: var(--red); color: var(--base); }
.task-grid a.current { outline: 2px solid var(--mauve); }

.points-pill {
  display: inline-block;
  background: var(--surface0);
  color: var(--text);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--surface0); text-align: left; }
th { color: var(--mauve); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

.deficit-card {
  background: var(--base);
  border-left: 4px solid var(--peach);
  padding: 0.9rem 1.1rem;
  margin: 0.75rem 0;
  border-radius: 0 6px 6px 0;
}
.deficit-card .tag {
  display: inline-block;
  background: var(--peach);
  color: var(--base);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

footer {
  text-align: center;
  color: var(--overlay0);
  padding: 2rem 1rem;
  font-size: 0.85rem;
}

/* Syntax highlight (minimal) */
.hl-kw { color: var(--mauve); }
.hl-str { color: var(--green); }
.hl-num { color: var(--peach); }
.hl-com { color: var(--overlay1); font-style: italic; }
.hl-typ { color: var(--yellow); }
