/* ── Rettungssanitäter Lernplattform – Stylesheet ── */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue:         #191970;
  --blue-light:   #2e2e9f;
  --blue-dark:    #101047;
  --blue-glow:    rgba(25, 25, 112, 0.2);
  --red:          #dc2626;
  --green:        #16a34a;
  --green-light:  #f0fdf4;
  --red-light:    #fef2f2;
  --yellow-light: #fffbeb;
  --gray-50:      #f8fafc;
  --gray-100:     #f1f5f9;
  --gray-200:     #e2e8f0;
  --gray-500:     #64748b;
  --gray-700:     #334155;
  --gray-900:     #0f172a;
  --white:        #ffffff;
  --sidebar-w:   240px;
  --radius:      10px;
  --shadow:      0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md:   0 6px 18px rgba(15, 23, 42, 0.08);
  --info-bg:     #eef2ff;
  --info-border: #c7d2fe;
  --info-text:   #3730a3;
  --surface-2:   #f3f6ff;
}

:root[data-theme="dark"] {
  --blue:         #8ea6ff;
  --blue-light:   #a9bcff;
  --blue-dark:    #161a40;
  --blue-glow:    rgba(142, 166, 255, 0.22);
  --red:          #f87171;
  --green:        #4ade80;
  --green-light:  #052e16;
  --red-light:    #3b0a0a;
  --yellow-light: #3a2a0a;
  --gray-50:      #090b15;
  --gray-100:     #0f1222;
  --gray-200:     #1d2238;
  --gray-500:     #94a3b8;
  --gray-700:     #d1d5db;
  --gray-900:     #e5e7eb;
  --white:        #111528;
  --shadow:       0 1px 2px rgba(2, 6, 23, 0.45);
  --shadow-md:    0 8px 24px rgba(2, 6, 23, 0.55);
  --info-bg:      #1e1b4b;
  --info-border:  #3730a3;
  --info-text:    #c7d2fe;
  --surface-2:    #151938;
}

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

html { font-size: 16px; }

body {
  font-family: "Inter", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 480px at -5% -20%, var(--blue-glow), transparent 62%),
    radial-gradient(760px 420px at 110% -15%, rgba(46, 46, 159, 0.14), transparent 66%),
    linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.02) 100%);
}

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

/* ── Layout ────────────────────────────────────────────── */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  color: var(--gray-900);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid var(--gray-200);
  backdrop-filter: blur(8px);
}

.sidebar-logo {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(180deg, var(--surface-2) 0%, transparent 100%);
}
.sidebar-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--blue-dark);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}
.sidebar-logo .logo-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.3;
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--gray-500);
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 16px 16px 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--gray-700);
  font-size: 14px;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  margin: 2px 8px;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--gray-100);
  color: var(--gray-900);
  border-color: var(--gray-200);
}
.sidebar-nav a .nav-icon {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #cbd5e1;
  margin-left: 2px;
}
.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon {
  background: var(--blue);
}

.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0.26;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.content {
  padding: 28px 24px 34px;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
}

/* ── Epic Hero ──────────────────────────────────────────── */
.hero-epic {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(46, 46, 159, 0.35);
  background:
    radial-gradient(420px 220px at 12% 0%, rgba(255, 255, 255, 0.25), transparent 70%),
    linear-gradient(125deg, var(--blue-dark) 0%, var(--blue) 52%, #3232b4 100%);
  padding: 28px;
  color: #fff;
  box-shadow: 0 26px 60px rgba(16, 16, 71, 0.34);
}

.hero-epic h1 {
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.hero-epic p {
  max-width: 700px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  margin-bottom: 18px;
}

.hero-epic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero-epic-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-epic .btn-primary {
  background: #fff;
  color: var(--blue-dark);
  border-color: transparent;
}

.hero-epic .btn-primary:hover {
  background: #f3f4ff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(255, 255, 255, 0.32);
}

.hero-epic .btn-success {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.hero-epic .btn-success:hover {
  background: rgba(255, 255, 255, 0.24);
}

.hero-epic .btn-outline {
  background: rgba(10, 14, 42, 0.28);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.28);
}

.hero-epic .btn-outline:hover {
  background: rgba(10, 14, 42, 0.4);
}

.hero-epic-glow {
  position: absolute;
  right: -70px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  filter: blur(4px);
  pointer-events: none;
}

:root[data-theme="dark"] .hero-epic {
  border-color: rgba(142, 166, 255, 0.28);
  background:
    radial-gradient(420px 220px at 12% 0%, rgba(255, 255, 255, 0.08), transparent 70%),
    linear-gradient(125deg, #0d1030 0%, #1b2160 56%, #232b7a 100%);
  box-shadow: 0 24px 54px rgba(2, 6, 23, 0.62);
}

/* ── Auth-Seiten ────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--gray-200);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 48px;
  height: 48px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--blue-dark);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.auth-logo h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.auth-logo p  { font-size: 13px; color: var(--gray-700); margin-top: 4px; }

/* ── Karten & Container ─────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: transform .18s ease, box-shadow .2s ease, border-color .18s ease;
}

.card:hover {
  /*transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.11);
  border-color: var(--blue-light); */
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: .01em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: var(--blue-light);
}
.stat-card::before {
  content: "";
  position: absolute;
  left: -40%;
  top: -120%;
  width: 180%;
  height: 200%;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
  transform: translateX(-45%);
  transition: transform .8s ease;
}
.stat-card:hover::before {
  transform: translateX(45%);
}
.stat-card .stat-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--blue);
  display: block;
  letter-spacing: -0.02em;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--gray-700);
  margin-top: 4px;
}

/* ── Formulare ──────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

.is-wysiwyg-source {
  display: none !important;
}

.wysiwyg-wrapper .ql-toolbar.ql-snow,
.wysiwyg-wrapper .ql-container.ql-snow {
  border-color: var(--gray-200);
}

.wysiwyg-wrapper .ql-toolbar.ql-snow {
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-2);
}

.wysiwyg-wrapper .ql-container.ql-snow {
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--white);
  min-height: 140px;
  font-size: 14px;
}

.wysiwyg-wrapper .ql-editor {
  min-height: 130px;
  color: var(--gray-900);
}

.wysiwyg-wrapper .ql-editor.wysiwyg-invalid {
  outline: 2px solid var(--red);
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn-primary   { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-success   { background: var(--green); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-secondary { background: var(--gray-100); color: var(--gray-900); border-color: var(--gray-200); }
.btn-outline   { background: var(--white); border: 1px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-100); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 8px 22px var(--blue-glow); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Alerts / Flash ─────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-success { background: var(--green-light); border-color: #86efac; color: #166534; }
.alert-danger  { background: var(--red-light);   border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--yellow-light); border-color: #fde68a; color: #92400e; }
.alert-info    { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }

/* ── Tabellen ───────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--gray-50);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-700);
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody tr:nth-child(even) td { background: var(--surface-2); }

.datatable-filters th {
  background: var(--white);
  padding: 8px 10px;
}

.datatable-filter-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-900);
  font-size: 12px;
}

.datatable-filter-input:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 2px var(--blue-glow);
}

div.dt-container .dt-search input,
div.dt-container .dt-length select {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-900);
  padding: 6px 8px;
}

div.dt-container .dt-paging .dt-paging-button {
  border-radius: 8px !important;
  border: 1px solid var(--gray-200) !important;
  background: var(--white) !important;
  color: var(--gray-900) !important;
}

div.dt-container .dt-paging .dt-paging-button.current {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

/* ── Badges ─────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-success { background: var(--green-light); color: var(--green); }
.badge-danger  { background: var(--red-light);   color: var(--red); }
.badge-warning { background: var(--yellow-light); color: #e65100; }
.badge-info    { background: var(--info-bg); color: var(--blue); }
.badge-gray    { background: var(--gray-100); color: var(--gray-700); }

/* ── Fragen (Test-Sitzung) ───────────────────────────────── */

.question-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--gray-200);
  padding: 28px 32px;
  max-width: 780px;
  margin: 0 auto;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--gray-500);
}

.question-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}
.question-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 3px;
  transition: width .3s;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--gray-900);
  margin-bottom: 24px;
}

.options-list { list-style: none; }
.option-item {
  margin-bottom: 10px;
}
.option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 15px;
  line-height: 1.4;
}
.option-label:hover { border-color: var(--blue-light); background: var(--info-bg); }
.option-label input { flex-shrink: 0; margin-top: 2px; accent-color: var(--blue); }

/* Feedback-Zustand */
.option-correct  { border-color: var(--green) !important; background: var(--green-light) !important; }
.option-wrong    { border-color: var(--red)   !important; background: var(--red-light)   !important; }
.option-missed   { border-color: var(--green) !important; background: #c8e6c9 !important; }

/* ── Ergebnis-Seite ─────────────────────────────────────── */

.result-hero {
  text-align: center;
  padding: 40px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 24px;
}
.result-score {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}
.score-pass { color: var(--green); }
.score-fail { color: var(--red); }

.result-answer {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}
.result-answer.correct { border-left-color: var(--green); }
.result-answer.wrong   { border-left-color: var(--red); }

/* ── Custom-Prüfung ─────────────────────────────────────── */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.category-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.category-check:hover { border-color: var(--blue-light); }
.category-check input:checked + span { color: var(--blue); font-weight: 600; }
.category-check:has(input:checked) { border-color: var(--blue); background: var(--info-bg); }

/* ── Admin ──────────────────────────────────────────────── */

.answer-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.answer-option-row .form-control { flex: 1; }

/* ── Utilities ───────────────────────────────────────────── */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); font-size: 13px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.fw-bold { font-weight: 700; }

.page-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo .logo-text,
  .sidebar-logo .logo-sub,
  .sidebar-nav a span,
  .nav-section-title { display: none; }
  .sidebar-nav a { justify-content: center; padding: 12px; }
  .main-wrap { margin-left: 60px; }
  .content { padding: 16px; }
  .hero-epic { padding: 20px; border-radius: 14px; }
  .hero-epic h1 { font-size: 1.45rem; }
}
