@import url("/assets/fonts/fonts.css");

/* Look & feel angelehnt an dzlm.de (ohne DZLM-Logo): Petrol/Teal-Primärfarbe,
   Open Sans (Text) + Roboto (Headlines), helle, klare Flächen. */
:root {
  --bg: #f6f7f8;
  --card: #ffffff;
  --ink: #373737;
  --ink-strong: #222222;
  --muted: #767676;
  --primary: #327d87;        /* DZLM-Petrol */
  --primary-dark: #2a6a72;
  --primary-ink: #ffffff;
  --accent: #22bbd6;         /* Cyan */
  --accent-2: #01ad93;       /* Grün */
  --ok: #01ad93;
  --warn: #f99200;
  --danger: #da4c0e;
  --border: #ebebeb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  /* Akzentpalette (z. B. für Rubrik-Kategorien) */
  --c0: #767676; --c1: #22bbd6; --c2: #ffba00; --c3: #f99200; --c4: #01ad93;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3, .MainHeadline, .ItemHeadline { font-family: "Roboto", "Open Sans", sans-serif; }

.wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px; }
.wrap.wide { max-width: 1200px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

h1 { font-size: 1.6rem; font-weight: 700; color: var(--ink-strong); margin: 0 0 12px; }
h2 { font-size: 1.2rem; font-weight: 700; color: var(--ink-strong); margin: 0 0 10px; }
.muted { color: var(--muted); }
.handwrite { font-family: "Handlee", cursive; }
a { color: var(--primary); }

/* ---- Kopf- und Fußzeile (DZLM-Anmutung) ---- */
.site-header {
  background: var(--primary);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.site-header .bar { max-width: 1200px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.site-header .brand { font-family: "Roboto", sans-serif; font-weight: 700; font-size: 1.2rem; color: #fff; text-decoration: none; letter-spacing: .2px; }
.site-header .brand small { display: block; font-family: "Open Sans"; font-weight: 400; font-size: .72rem; opacity: .85; letter-spacing: 0; }
.site-header .nav { margin-left: auto; display: flex; gap: 18px; }
.site-header .nav a { color: #fff; text-decoration: none; opacity: .92; font-size: .95rem; }
.site-header .nav a:hover { opacity: 1; text-decoration: underline; }

.site-footer { border-top: 1px solid var(--border); background: #fff; color: var(--muted); margin-top: 24px; }
.site-footer .bar { max-width: 1200px; margin: 0 auto; padding: 18px 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: .88rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

button, .btn {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
}
button:hover:not(:disabled) { filter: brightness(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
button.danger { color: #b91c1c; border-color: #fecaca; }
button.ghost { background: transparent; }

input[type="text"], input[type="password"], input[type="number"], textarea {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #e6f1f2; color: var(--primary-dark); font-size: 0.85rem; font-weight: 600;
}
.error { color: var(--danger); font-weight: 600; }

/* ---- Startseite: Hero + Rollen-Kacheln ---- */
.hero { background: linear-gradient(135deg, #eaf3f4, #ffffff); border-left: 4px solid var(--primary); }
.hero-title { font-size: 2.6rem; color: var(--primary); margin: 0 0 4px; }
.hero-sub { font-size: 1.05rem; color: var(--ink); margin: 0; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.role-tile {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  padding: 18px; border: 1px solid var(--border); border-radius: 12px; color: var(--ink);
  background: #fff; transition: border-color .15s, transform .1s, box-shadow .15s;
}
.role-tile:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.role-tile .ic { font-size: 2rem; }
.role-tile strong { font-family: "Roboto", sans-serif; color: var(--primary-dark); }
.role-tile small { color: var(--muted); }

/* ---- Aufgaben-/Arbeitsblatt-Anmutung (DZLM „Nach-gedacht!") ---- */
:root { --ws-amber: #e3a23a; --ws-bullet: #f0992b; --ws-violet: #6f3fa0; }

.worksheet { background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }

.ws-head { display: flex; align-items: center; gap: 14px; background: var(--ws-amber); color: #fff; padding: 12px 20px; border-radius: 8px; }
.worksheet .ws-head { border-radius: 0; }
.ws-title { font-family: "Roboto", sans-serif; font-weight: 600; font-size: 1.35rem; line-height: 1.2; }
.ws-title b { font-weight: 800; }
.ws-badge { margin-left: auto; display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.ws-code { font-size: .95rem; letter-spacing: .5px; }
.ws-bulb { width: 36px; height: 36px; border: 2px solid #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }

.ws-cols { display: flex; gap: 22px; flex-wrap: wrap; padding: 18px 20px; }
.full-task .ws-cols { padding: 4px 0; }
.ws-main { flex: 1 1 320px; min-width: 0; }
.ws-aside { flex: 0 1 380px; }
.ws-aside .item-image { margin-top: 0; }

.MainHeadline { font-size: 1.6rem; font-weight: 800; margin: 0 0 12px; }
.ItemHeadline { font-family: "Roboto", sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--ink-strong); margin: 0 0 10px; }
.ItemText { font-size: 1.1rem; margin: 8px 0; }

ul.bullets { list-style: none; margin: 10px 0; padding-left: 0; }
ul.bullets li { position: relative; padding-left: 24px; font-size: 1.05rem; margin: 8px 0; }
ul.bullets li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 11px; height: 11px; background: var(--ws-bullet); }

.StudentInstruction { display: flex; align-items: flex-start; gap: 10px; font-size: 1.15rem; font-weight: 700; color: var(--ink-strong); margin: 16px 0; }
.StudentInstruction::before { content: "✏️"; font-size: 1.25rem; line-height: 1; }

.ExampleResponse { position: relative; color: var(--ws-violet); font-weight: 600; padding-left: 24px; margin: 12px 0; white-space: pre-line; }
.ExampleResponse::before { content: ""; position: absolute; left: 2px; top: .5em; width: 11px; height: 11px; background: var(--ws-bullet); }

.item-image { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin-top: 10px; }
.tafel-hint { font-size: 1.1rem; }

/* ---- Counter-Leiste ---- */
.counters { display: flex; gap: 18px; font-weight: 700; }
.counters .num { font-size: 1.4rem; color: var(--primary); }

/* ---- Klassenansicht (Beamer): helles, DZLM-konformes Präsentationsdesign ---- */
body.projector { background: #f6f7f8; color: var(--ink); }
/* Große Darstellung für den Beamer */
body.projector .ws-title { font-size: 1.9rem; }
body.projector .worksheet .ItemHeadline { font-size: 1.7rem; }
body.projector .worksheet .ItemText { font-size: 1.5rem; }
body.projector .worksheet .StudentInstruction { font-size: 1.5rem; }
body.projector .worksheet ul.bullets li { font-size: 1.45rem; }
body.projector .worksheet .ExampleResponse { font-size: 1.4rem; }

/* Schmale Kopfzeile der Klassenansicht (ohne Navigation) */
.class-bar { background: var(--primary); color: #fff; border-bottom: 3px solid var(--accent); padding: 12px 16px 12px 60px; }
.class-bar .brand-plain { font-family: "Roboto", sans-serif; font-weight: 700; font-size: 1.15rem; }
.class-bar .brand-plain small { font-weight: 400; opacity: .85; font-size: .8rem; }
body.fullscreen .class-bar, body.fullscreen .site-header { display: none; }

/* Drei-Striche-Menü (Steuerung in der Klassenansicht) */
.menu-btn { position: fixed; top: 9px; left: 12px; z-index: 60; font-size: 1.3rem; line-height: 1; padding: 7px 12px; background: rgba(255,255,255,.95); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; box-shadow: var(--shadow); }
.class-menu { position: fixed; top: 56px; left: 12px; z-index: 60; width: 280px; max-width: 90vw; background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.18); padding: 8px 12px; }
.menu-sec { padding: 10px 0; border-top: 1px solid var(--border); }
.menu-sec:first-child { border-top: 0; }
.menu-h { font-weight: 700; color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; font: inherit; text-decoration: none; color: var(--ink); }
.menu-item:hover { background: #f1f5f9; }
.menu-item.danger { color: #b91c1c; }

/* Vertikale Ansichts-Auswahl (Teacher & Menü) */
.view-btns { display: flex; flex-direction: column; gap: 8px; }
.view-btn { text-align: left; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; font: inherit; }
.view-btn:hover { border-color: var(--primary); }
.view-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Name der Live-Interaktion (Steuerpult, über der Auswertung) */
.li-name { font-family: "Roboto", sans-serif; font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; }

/* "Aufgabe + Code"-Streifen */
.code-strip { display: flex; align-items: center; gap: 24px; }
.qr-box.small svg { width: 120px; height: 120px; }
.access-pin.small { font-size: 2rem; letter-spacing: 6px; }

/* Zugang (QR / PIN) */
#access .MainHeadline { color: var(--primary); font-size: 2.2rem; text-align: center; }
#access .ItemText { font-size: 1.4rem; }
.access-pin { font-size: 3.4rem; font-weight: 900; letter-spacing: 8px; color: var(--primary); }
.qr-box { background: #fff; padding: 12px; border-radius: 16px; display: inline-block; border: 1px solid var(--border); }
.qr-box svg { width: 280px; height: 280px; display: block; }

/* ---- Balkendiagramm (Auswertung) ---- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 260px 1fr 52px; gap: 12px; align-items: center; cursor: pointer; }
.bar-row .lbl { font-weight: 600; }
.bar-track { background: #e6f1f2; border-radius: 8px; height: 32px; overflow: hidden; }
.bar-fill { background: var(--primary); height: 100%; border-radius: 8px; transition: width 0.4s ease; min-width: 2px; }
.bar-row.selected .bar-fill { background: var(--warn); }
.bar-row .cnt { text-align: right; font-weight: 800; }
body.projector .bar-row { font-size: 1.25rem; }
body.projector .bar-track { height: 38px; }

/* ---- Antwort-Stream (WhatsApp-Stil) ---- */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { background: #e7ffdb; border-radius: 12px 12px 12px 2px; padding: 10px 12px; max-width: 80%; align-self: flex-start; }
.msg .who { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.msg .code { float: right; font-size: 0.75rem; font-weight: 700; color: var(--primary); }
.msg[data-id] { cursor: pointer; }
body.projector .msg { font-size: 1.2rem; }

/* Antworten nach Kategorien gruppiert */
.ans-group { margin-bottom: 16px; }
.ans-group-h { font-family: "Roboto", sans-serif; font-weight: 700; color: var(--ink-strong); margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
.ans-count { color: var(--muted); font-weight: 600; }
body.projector .ans-group-h { font-size: 1.4rem; }
.msg-manual { float: right; font-size: 0.85rem; margin-left: 6px; }
.msg-hidden { opacity: 0.5; }
.msg-hidden::after { content: " · ausgeblendet"; color: var(--danger); font-size: 0.75rem; font-weight: 700; }

/* Schieberegler (KI-Klassifikation an/aus) */
.ai-switch { display: inline-flex; align-items: center; gap: 8px; }
.ai-switch #aiLabel { font-size: .9rem; color: var(--muted); font-weight: 600; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 24px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Popup-Menü an einer Antwort (Umkategorisieren / Ausblenden) */
.answer-menu { position: fixed; z-index: 80; background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.22); padding: 6px; min-width: 230px; max-width: 300px; }
.answer-menu .am-h { font-weight: 700; color: var(--muted); font-size: .8rem; padding: 6px 10px; }
.answer-menu .am-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.answer-menu .am-item:hover { background: #f1f5f9; }
.answer-menu .am-item.active { background: var(--primary); color: #fff; }
.answer-menu .am-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---- Lernenden-Aktionen (kinderfreundlich, groß, icon-basiert) ---- */
.bigbtn { font-size: 1.9rem; line-height: 1; padding: 16px 26px; border-radius: 16px; min-width: 76px; }
.answer-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.recstate { font-size: 1.4rem; min-width: 1.4em; text-align: center; }
#recBtn.recording { background: #dc2626; color: #fff; border-color: #dc2626; animation: recpulse 1s ease-in-out infinite; }
@keyframes recpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); opacity: 0.85; } }
#task textarea { min-height: 120px; font-size: 1.15rem; }
.full-task { margin-top: 12px; padding: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; }

/* Umschalter Tafel / Aufgabe (Lernendensicht) */
.view-toggle { display: inline-flex; gap: 10px; margin: 14px 0; }
.seg { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.7rem; line-height: 1; padding: 10px 20px; border-radius: 14px; }
.seg span { font-size: 0.8rem; font-weight: 700; }
.seg.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Detailbereich (Klassifikation/Prompt) ---- */
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 8px 0 14px; }
.detail-grid .k { font-weight: 700; color: var(--muted); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: 700; }
.block-label { font-weight: 700; margin: 14px 0 6px; }
pre.codeblock {
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px;
  overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; margin: 0;
}
pre.reasoning { background: #fffbeb; color: #4d3a00; border: 1px solid #fde68a; }

.hidden { display: none !important; }
