/* =========================================================
   0) Design-Variablen & Baseline
   ========================================================= */
:root{
  /* Grundfarben */
  --bg:#f7f7f8;
  --fg:#222;
  --muted:#666;

  /* Brand (blau – weiterhin z.B. für Buttons/neutral) */
  --brand:#0b57d0;
  --brand-600:#0a4fc0;

  /* Erfolg / Warnung */
  --ok:#2e7d32;
  --ok-bg:#f1f8f4;
  --warn:#c62828;
  --warn-bg:#fdecea;

  /* Rahmen / Flächen */
  --border:#e5e7eb;
  --soft:#f7f7f9;

  /* Header (Crimson) */
  --crimson:#8b1d25;       /* main */
  --crimson-700:#761820;   /* hover */
  --crimson-800:#5c1218;   /* darker */
  --crimson-tint:#f7e9eb;  /* subnav band */
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; padding:0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

/* =========================================================
   1) Layout
   ========================================================= */
.container{ max-width:980px; margin:0 auto; padding:12px; }
main.container{ padding-top:14px; } /* etwas kompakter wegen neuen Headers */
footer{ padding:24px 0; color:#888; text-align:center; }
footer .small { font-size:12px; }

/* Grids */
.grid{ display:grid; gap:12px; }
.grid.cols-2{ grid-template-columns:1fr 1fr; }
.grid.cols-3{ grid-template-columns:repeat(3, 1fr); }
@media (max-width:1024px){ .grid.cols-3{ grid-template-columns:repeat(2, 1fr); } }
@media (max-width:760px){
  .grid.cols-2{ grid-template-columns:1fr; }
  .grid.cols-3{ grid-template-columns:1fr; }
}

/* Kleine Badge-Elemente (z.B. Domain-Chip außerhalb Header) */
.badge{
  display:inline-block; padding:2px 8px; border-radius:999px;
  background:#eef2ff; color:#1f2937; font-size:12px; border:1px solid #c7d2fe;
}
.alpha-badge{
  display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; border-radius:999px;
  background:#eef2ff; color:#1f2937; font-weight:700; font-size:12px;
  border:1px solid #c7d2fe;
}

/* =========================================================
   2) Header: NotSanTrainer (compact crimson)
   ========================================================= */
header{
  position:sticky; top:0; z-index:20;
  background:linear-gradient(180deg, var(--crimson-800) 0%, var(--crimson) 100%);
  color:#fff; border:0; box-shadow:0 2px 6px rgba(0,0,0,.15);
}
.header-wrap{ max-width:980px; margin:0 auto; padding:8px 12px; }
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:44px;
}
.brand{
  display:flex; align-items:center; gap:10px; color:#fff; text-decoration:none;
  font-weight:700; letter-spacing:.2px;
}
.brand .logo{
  width:26px; height:26px; border-radius:8px;
  display:inline-flex; align-items:center; justify-content:center;
  background:#fff; color:var(--crimson-800); font-size:14px;
  box-shadow:0 1px 0 rgba(0,0,0,.08) inset;
}
.brand .title{ font-size:16px; }
.brand .subtitle{ font-size:12px; opacity:.85; font-weight:600; }

/* Primary nav – Pills auf Crimson */
.primary-nav{
  display:flex; gap:8px; flex-wrap:wrap; margin:8px 0 0;
}
.primary-nav a{
  display:inline-block; padding:7px 12px; border-radius:999px;
  text-decoration:none; color:#fff; background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  transition:background .15s,border-color .15s,transform .02s;
}
.primary-nav a:hover{ background:rgba(255,255,255,.16); border-color:rgba(255,255,255,.28); }
.primary-nav a.active{
  background:#fff; color:var(--crimson-800); border-color:#fff;
}

/* Subnav – helle Leiste unter dem Header (z.B. nur auf Quiz) */
.subnav-band{ background:var(--crimson-tint); border-bottom:1px solid #ead0d3; }
.subnav{
  max-width:980px; margin:0 auto; padding:6px 12px;
  display:flex; gap:8px; flex-wrap:wrap;
}
.subnav a{
  display:inline-block; padding:6px 10px; border-radius:10px;
  text-decoration:none; color:#5b5860; background:#fff;
  border:1px solid #e7d6d9;
}
.subnav a:hover{ background:#fff; border-color:#d8bec2; }
.subnav a.active{ background:var(--crimson); color:#fff; border-color:var(--crimson); }

/* Chip rechts oben im Header */
.header-chip{
  display:inline-block; padding:4px 8px; border-radius:999px;
  background:rgba(255,255,255,.12); color:#fff; font-size:12px;
  border:1px solid rgba(255,255,255,.24);
}

/* =========================================================
   3) Typografie
   ========================================================= */
h1{ font-size:22px; margin:16px 0 8px; }
.muted{ color:var(--muted); font-size:12px; }
.small{ font-size:13px; }

/* =========================================================
   4) Cards & Status
   ========================================================= */
.card{
  background:#fff; border:1px solid var(--border);
  border-radius:14px; padding:14px; margin:12px 0;
  box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.card.success{ border-left:5px solid var(--ok); background:var(--ok-bg); color:var(--ok); }
.card.alert{ border-left:5px solid var(--warn); background:var(--warn-bg); color:var(--warn); }

/* Richtige Antworten auch in roter Feedback-Karte grün darstellen */
.card.alert .ans-correct{ color:var(--ok); }
.card.alert .ans-correct .fa-solid{ color:var(--ok); }

/* Zusätzliche Töne für Ergebnis-Karten */
.card.neutral{ border-left:5px solid var(--brand); background:#eef2ff; color:#1f2937; }
.card.warn   { border-left:5px solid #f59e0b; background:#fff7ed; color:#9a3412; }

/* =========================================================
   5) Formular-Elemente
   ========================================================= */
label{ display:block; margin:8px 0 4px; font-weight:bold; }
input[type="text"], input[type="number"], textarea, select{
  width:100%; padding:8px; border:1px solid #ddd; border-radius:8px; background:#fff;
}

/* =========================================================
   6) Buttons & Link-Buttons
   ========================================================= */
button{
  padding:10px 14px; border:none; border-radius:10px;
  background:var(--brand); color:#fff; cursor:pointer;
  transition: background .15s ease;
}
button:hover{ background:var(--brand-600); }
button.secondary{ background:#e5e7eb; color:#111; }
button.danger{ background:#e53935; color:#fff; }
button.danger:hover{ background:#c62828; }
button.small{ padding:6px 10px; font-size:12px; }

a.button{
  display:inline-block; padding:8px 12px; border-radius:10px;
  background:var(--brand); color:#fff; text-decoration:none;
  border:1px solid var(--brand);
  transition: background .15s ease, border-color .15s ease;
}
a.button:hover{ background:var(--brand-600); border-color:var(--brand-600); }
a.button.small{ padding:6px 10px; font-size:12px; }
a.button.secondary{ background:#fff; color:#111; border-color:var(--border); }
a.button.danger{ background:#e53935; border-color:#e53935; color:#fff; }
a.button.danger:hover{ background:#c62828; border-color:#c62828; }

/* Tastatur-Fokus */
button:focus-visible, a.button:focus-visible{
  outline:2px solid #94bfff; outline-offset:2px;
}

/* =========================================================
   7) Tabellen
   ========================================================= */
.table{ width:100%; border-collapse:collapse; }
.table thead th{ font-weight:600; background:#fafafa; }
.table th, .table td{ padding:8px; border-bottom:1px solid #eee; text-align:left; }
.table td.actions{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
}

/* =========================================================
   8) Bilder (responsive + Thumbs + Lightbox)
   ========================================================= */
img.responsive{
  display:block; max-width:100%; height:auto; margin:0 auto;
  border-radius:10px; border:1px solid #eee;
}
.thumb-img{
  width:120px; height:auto; border:1px solid #eee;
  border-radius:8px; cursor:pointer;
}

/* Lightbox */
.lightbox{
  position:fixed; inset:0; background:rgba(0,0,0,.75);
  display:none; align-items:center; justify-content:center;
  padding:16px; z-index:9999;
}
.lightbox-inner{ max-width:min(1100px,95vw); max-height:90vh; }
.lightbox-inner img{ width:100%; height:auto; display:block; border-radius:10px; background:#fff; }

/* Grid-Karten mit Bild mittig + Buttons nicht stretchen */
.grid.cols-3 .card{ display:flex; flex-direction:column; }
.grid.cols-3 .card > div:nth-child(3){ align-self:flex-start; }
.grid.cols-3 .card button{ align-self:flex-start; }
.grid.cols-3 .card a.button{ align-self:flex-start; }

/* =========================================================
   9) Quiz-Feedback
   ========================================================= */
.feedback-header{
  font-size:1.2em; display:flex; align-items:center; gap:6px; font-weight:bold;
}
.feedback-correct{ color:var(--ok); }
.feedback-wrong{ color:var(--warn); }

.feedback-rightanswer{ margin-top:6px; color:var(--ok); font-weight:bold; }
.feedback-explanation{ margin-top:8px; color:#333; }
.quiz-score{ font-size:1.6em; font-weight:bold; margin:10px 0; }
.quiz-result{ font-size:1.3em; margin-bottom:10px; }
.quiz-duration{ font-size:.9em; color:#555; }

/* Icons im Text etwas separieren */
.feedback-header .fa-solid,
.feedback-explanation .fa-solid{ margin-right:2px; }

/* Listen ohne Bullets + Iconlayout */
.ans-list{ list-style:none; padding-left:0; margin:0; }
.ans{ display:flex; align-items:flex-start; gap:6px; margin:3px 0; }
.ans i{ flex:0 0 16px; text-align:center; margin-top:2px; }

/* Farben der Antwortzeilen */
.ans-correct{ color:var(--ok); }
.ans-wrong  { color:var(--warn); }

/* Ergebnis-Progressbar */
.result-progress{ height:10px; background:#eee; border-radius:999px; overflow:hidden; margin-top:8px; }
.result-progress > span{ display:block; height:100%; width:0; transition:width .4s ease; }
.result-progress.success > span{ background:var(--ok); }
.result-progress.neutral > span{ background:var(--brand); }
.result-progress.warn > span{ background:#f59e0b; }
.result-progress.alert > span{ background:var(--warn); }

.grid.cols-7{ display:grid; grid-template-columns:repeat(7,1fr); gap:12px; }
@media (max-width:900px){ .grid.cols-7{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .grid.cols-7{ grid-template-columns:1fr; } }
.day-link{ color:inherit; text-decoration:none; }
.day-link:hover{ text-decoration:underline; }

/* Einheitliche Links für Terminlisten auf der Startseite */
.events-list a,
.events-list a:visited,
.event-link,
.event-link:visited {
  color: var(--link-color, #1f5eff);
  text-decoration: none;
}
.events-list a:hover,
.event-link:hover { text-decoration: underline; }

/* Tabellen mit Streifen + KW-Zeile */
.table.striped tbody tr:nth-child(even){ background:#fafafa; }
.kw-row td{
  background:#f3f4f6 !important;
  font-weight:700;
  border-top:2px solid #e5e7eb;
}

/* Countdown */
.countdown-card { overflow:hidden; }
.countdown-head { display:flex; align-items:baseline; gap:6px; margin-bottom:8px; }

.cd-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
  align-items:stretch;
}

.cd-item{
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.cd-num{
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.cd-lbl{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .2px;
}

/* Kalender: heutiger Tag hervorheben */
.card.today{
  border-left: 5px solid var(--brand);
  background: #eef2ff;
}

/* PDF/Liste */
.file-list{ list-style:none; padding-left:0; margin:0; }
.file-list li{
  display:flex; align-items:center; gap:8px;
  padding:8px 0; border-bottom:1px solid #eee;
}
.file-list li i{ font-size:18px; }
.file-list li:last-child{ border-bottom:0; }

.button.icon-only {
  width: 30px;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.icon-only i {
  pointer-events: none;
}

/* =========================================================
   7) Tabellen – mit Gitternetzlinien
   ========================================================= */
.table{
  width:100%;
  border-collapse:collapse;       /* wichtig für saubere Linien */
  border:1px solid #e5e7eb;       /* Außenrahmen */
  background:#fff;
}
.table thead th{
  font-weight:600;
  background:#fafafa;
  border:1px solid #e5e7eb;
}
.table th, .table td{
  padding:8px;
  border:1px solid #e5e7eb;       /* Gitterlinien */
  text-align:left;
}
.table.striped tbody tr:nth-child(even){ background:#fafafa; }

.badge { font-size: 12px; background:#fafafa; }
.lbl { display:block; font-weight:600; margin-bottom:4px; }
.grid { display:grid; gap:10px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.colspan-2 { grid-column: 1 / -1; }
.button.danger { background:#c62828; color:#fff; }
.list .card { transition: background-color .2s ease; }

/* --- Hauptmenü: einzeilig bleiben, Dropdown nicht clippen --- */
.primary-nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:nowrap;        /* nicht umbrechen */
  overflow:visible;        /* Dropdown darf herausragen */
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.primary-nav a{ white-space:nowrap; }

/* --- Dropdown für "Fälle" --- */
.primary-nav .nav-drop{ position:relative; display:inline-block; }
.primary-nav .nav-drop .nav-menu{
  position:absolute;
  top:100%;
  left:0;
  min-width:220px;
  background:#fff;
  border:1px solid #ddd;
  border-radius:10px;
  padding:6px;
  box-shadow:0 8px 24px rgba(0,0,0,.1);
  display:none;
  z-index:50;               /* Header hat z-index:20 */
}
.primary-nav .nav-drop:hover .nav-menu{ display:block; }

/* Links im Dropdown: gut lesbar auf weiß */
.primary-nav .nav-drop .nav-menu a{
  display:block;
  padding:8px 10px;
  border-radius:8px;
  color:#111;               /* nicht weiß erben */
  background:transparent;
  border:0;
  text-decoration:none;
}
.primary-nav .nav-drop .nav-menu a:hover{
  background:#f6f6f6;
}

/* --- Optional: mobil horizontales Scrollen erlauben --- */
@media (max-width:600px){
  .primary-nav{ overflow-x:auto; }   /* nur mobil */
  .primary-nav .nav-drop{ position:static; }
  .primary-nav .nav-drop .nav-menu{
    position:fixed;                  /* entkoppeln, damit nichts clippt */
    left:12px; right:12px;
    top:calc(56px + 44px);           /* ggf. an Headerhöhe anpassen */
    z-index:1000;
  }
}

.lbl{font-weight:600;margin-bottom:4px}.colspan-2{column-span:all}
.badge{display:inline-block;padding:2px 8px;border-radius:999px;background:#eef2ff;color:#1f2937;font-size:12px;border:1px solid #c7d2fe;margin-left:6px}
.result-progress{height:10px;background:#eee;border-radius:999px;overflow:hidden;margin-top:8px}
.result-progress>span{background:var(--brand,#0b57d0)}
details summary { list-style:none; }
details summary::-webkit-details-marker { display:none; }
details[open] summary { opacity:.9; }
