/* ══════════════════════════════════════════════════════════════
   Löwenzahn Guide – Arbeitsblatt-Builder CSS v1.0
   ══════════════════════════════════════════════════════════════ */

/* ── BUILDER WRAP ────────────────────────────────────────────── */
.lzg-school-builder {
  font-family: var(--lzg-font-body, 'Lato', sans-serif);
  color: var(--lzg-text, #3e2723);
  background: var(--lzg-cream, #fffde7);
  min-height: 600px;
}

/* ── HEADER ──────────────────────────────────────────────────── */
.lzg-sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 26px 32px 20px;
  background: linear-gradient(135deg, #fff9c4, #ffe082);
  border-bottom: 3px solid #ffd600;
}

.lzg-sb-header-left h2 {
  font-family: var(--lzg-font-head, Georgia, serif);
  font-size: 1.6rem;
  color: #558b2f;
  margin: 0 0 4px;
}
.lzg-sb-header-left p {
  font-size: .88rem;
  color: #6d4c41;
  margin: 0;
}

/* Level selector */
.lzg-level-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lzg-level-label {
  font-size: .82rem;
  font-weight: 700;
  color: #5d4037;
  white-space: nowrap;
}
.lzg-level-btn {
  padding: 7px 14px;
  border: 2px solid #ffe082;
  background: #fff;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--lzg-font-body, sans-serif);
  font-size: .8rem;
  font-weight: 700;
  color: #6d4c41;
  transition: all .18s;
  white-space: nowrap;
}
.lzg-level-btn:hover  { background: #fffde7; border-color: #f9a825; color: #558b2f; }
.lzg-level-btn.active {
  background: linear-gradient(135deg, #f9a825, #ff8f00);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(249,168,37,.4);
}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.lzg-sb-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 620px;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.lzg-sb-sidebar {
  background: #fff;
  border-right: 2px solid #ffe082;
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  max-height: 80vh;
}

.lzg-sb-sidebar-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #ffe082;
}
.lzg-sb-sidebar-head h3 {
  font-family: var(--lzg-font-head, Georgia, serif);
  font-size: 1.05rem;
  color: #558b2f;
  margin: 0 0 4px;
}
.lzg-sb-sidebar-head p {
  font-size: .8rem;
  color: #888;
  margin: 0;
}

/* Module groups */
.lzg-sb-modules { display: flex; flex-direction: column; gap: 4px; }

.lzg-module-group { margin-bottom: 10px; }

.lzg-module-group-label {
  display: block;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #bbb;
  padding: 6px 4px 4px;
}

.lzg-module-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-bottom: 2px;
}
.lzg-module-item:hover { background: #fffde7; border-color: #ffe082; }
.lzg-module-item:has(input:checked) {
  background: linear-gradient(135deg, #f1f8e9, #dcedc8);
  border-color: #aed581;
}

.lzg-module-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #7cb342;
  flex-shrink: 0;
  cursor: pointer;
}

.lzg-module-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }

.lzg-module-item > div { flex: 1; }
.lzg-module-item strong {
  display: block;
  font-size: .84rem;
  color: #3e2723;
  line-height: 1.3;
}
.lzg-module-item small {
  font-size: .74rem;
  color: #aaa;
}

/* Sidebar actions row */
.lzg-sb-actions {
  display: flex;
  gap: 6px;
  margin: 14px 0 10px;
}

/* Buttons */
.lzg-sb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--lzg-font-body, sans-serif);
  font-weight: 700;
  font-size: .84rem;
  transition: transform .18s, box-shadow .18s;
  white-space: nowrap;
}
.lzg-sb-btn:hover { transform: translateY(-2px); }
.lzg-sb-btn:active { transform: translateY(0); }

.lzg-sb-btn.primary {
  background: linear-gradient(135deg, #f9a825, #ff8f00);
  color: #fff;
  box-shadow: 0 3px 10px rgba(249,168,37,.35);
  width: 100%;
  margin-bottom: 8px;
}
.lzg-sb-btn.primary:hover { box-shadow: 0 5px 16px rgba(249,168,37,.45); }

.lzg-sb-btn.success {
  background: linear-gradient(135deg, #7cb342, #558b2f);
  color: #fff;
  box-shadow: 0 3px 10px rgba(124,179,66,.35);
  width: 100%;
}
.lzg-sb-btn.success:hover { box-shadow: 0 5px 16px rgba(124,179,66,.45); }

.lzg-sb-btn.secondary {
  background: #f5f5f5;
  color: #6d4c41;
  flex: 1;
  font-size: .78rem;
  padding: 8px 10px;
  border: 1.5px solid #e0e0e0;
}
.lzg-sb-btn.secondary:hover { background: #fffde7; border-color: #ffe082; }

.lzg-sb-btn.mini {
  background: #fff;
  color: #558b2f;
  border: 1.5px solid #aed581;
  padding: 6px 12px;
  font-size: .78rem;
  border-radius: 50px;
}
.lzg-sb-btn.mini:hover { background: #f1f8e9; }

/* ── PREVIEW AREA ────────────────────────────────────────────── */
.lzg-sb-preview-wrap {
  display: flex;
  flex-direction: column;
  background: #f7f7f5;
}

.lzg-sb-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1.5px solid #ffe082;
  font-size: .85rem;
  font-weight: 700;
  color: #558b2f;
  gap: 12px;
  flex-wrap: wrap;
}

.lzg-sb-preview {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-height: 74vh;
}

/* Empty state */
.lzg-sb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  text-align: center;
  color: #bbb;
}
.lzg-sb-empty-icon { font-size: 3.5rem; margin-bottom: 14px; }
.lzg-sb-empty p    { font-size: .92rem; line-height: 1.6; color: #aaa; }
.lzg-sb-empty strong { color: #f9a825; }

/* ── WORKSHEET PREVIEW STYLES ────────────────────────────────── */
.ws-preview-inner { max-width: 740px; margin: 0 auto; }

.ws-block {
  background: #fff;
  border: 1.5px solid #ffe082;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(249,168,37,.07);
}

h3.ws-task-title {
  font-family: var(--lzg-font-head, Georgia, serif);
  color: #f57f17;
  font-size: 1rem;
  border-bottom: 2px solid #ffe082;
  padding-bottom: 6px;
  margin: 0 0 14px;
}

/* Deckblatt */
.ws-deckblatt { text-align: center; padding: 8px 0 14px; }
.ws-db-title  {
  font-family: var(--lzg-font-head, Georgia, serif);
  font-size: 1.9rem;
  color: #558b2f;
  margin: 8px 0 4px;
}
.ws-db-sub    { color: #aaa; font-size: .9rem; margin-bottom: 16px; }
.ws-db-fields { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.ws-db-flower { margin-bottom: 4px; }

/* Lines */
.ws-line-wrap  { display: flex; align-items: flex-end; gap: 8px; margin: 7px 0; }
.ws-line-label { white-space: nowrap; font-size: .85rem; font-weight: 700; color: #666; }
.ws-line       { display: inline-block; border-bottom: 1.5px solid #555; flex: 1; min-width: 60px; height: 18px; }

/* Hint text */
.ws-hint { font-size: .8rem; color: #aaa; font-style: italic; margin: 0 0 8px; }

/* Steckbrief */
.ws-steckbrief { width: 100%; border-collapse: collapse; }
.ws-steckbrief td { padding: 7px 10px; border: 1px solid #ddd; font-size: .86rem; }
.ws-sb-key { background: #fffde7; font-weight: 700; width: 38%; color: #666; }

/* Pflanze beschriften */
.ws-plant-wrap   { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ws-plant-svg    { width: 170px; flex-shrink: 0; }
.ws-plant-legend { flex: 1; min-width: 140px; }
.ws-plant-num-row{ display: flex; align-items: center; gap: 8px; margin: 9px 0; }
.ws-num-circle   {
  width: 22px; height: 22px; border-radius: 50%;
  background: #f9a825; color: #fff;
  font-weight: 700; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-num-line { flex: 1; border-bottom: 1.5px solid #ccc; }

/* Word bank */
.ws-word-bank {
  background: #fff9c4;
  border: 1.5px solid #ffe082;
  border-radius: 6px;
  padding: 7px 12px;
  margin-bottom: 10px;
  font-size: .84rem;
  line-height: 1.7;
}

/* Lückentext */
.ws-luecke-text { font-size: .9rem; line-height: 2.1; }
.ws-luecke-text strong {
  border-bottom: 1.5px solid #333;
  min-width: 80px;
  display: inline-block;
  text-align: center;
  color: transparent; /* hide answer in preview */
}

/* Zuordnung */
.ws-zuo-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ws-zuo-item  {
  padding: 7px 10px;
  border: 1px solid #ffe082;
  border-radius: 6px;
  margin: 3px 0;
  font-size: .84rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-zuo-num   {
  width: 22px; height: 22px; border-radius: 50%;
  background: #f9a825; color: #fff;
  font-weight: 700; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-zuo-blank {
  border-bottom: 1.5px solid #555;
  min-width: 28px;
  display: inline-block;
  text-align: center;
  margin-right: 6px;
}

/* Richtig / Falsch */
.ws-rf-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ws-rf-table th {
  background: #fffde7;
  padding: 6px 10px;
  border: 1px solid #ddd;
  font-size: .8rem;
  text-align: left;
}
.ws-rf-table td { padding: 7px 10px; border: 1px solid #ddd; }
.ws-rf-num  { width: 30px; text-align: center; font-weight: 700; color: #aaa; }
.ws-rf-box  {
  width: 34px; text-align: center; font-weight: 700; font-size: .95rem;
  background: #f9fbe7; border-radius: 4px;
}

/* Kreuzwort */
.ws-cw-wrap  { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.ws-cw-grid  { border-collapse: collapse; flex-shrink: 0; }
.ws-cw-grid td {
  width: 28px; height: 28px;
  border: 1.5px solid #999;
  text-align: center;
  font-weight: 700;
  font-size: .82rem;
}
.cw-black { background: #333 !important; border-color: #222 !important; }
.cw-open  { background: #fff; }
.ws-cw-clues { flex: 1; min-width: 200px; }
.ws-cw-clues h4 { margin: 0 0 5px; font-size: .88rem; color: #558b2f; }
.ws-cw-clues ul { padding-left: 16px; margin: 0 0 10px; }
.ws-cw-clues li { font-size: .82rem; margin: 3px 0; }

/* Wortsuche */
.ws-ws-grid   { border-collapse: collapse; margin-top: 10px; }
.ws-ws-cell   {
  width: 22px; height: 22px;
  border: 1px solid #e0e0e0;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: #555;
}
.ws-ws-words  { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.ws-ws-word   {
  background: #fff9c4;
  border: 1px solid #ffe082;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: .8rem;
  font-weight: 700;
}

/* Rätsel */
.ws-raetsel-item { margin-bottom: 16px; }
.ws-raetsel-q    { font-size: .87rem; margin-bottom: 6px; display: flex; gap: 8px; }
.ws-q-num        {
  min-width: 22px; height: 22px; border-radius: 50%;
  background: #f9a825; color: #fff;
  font-weight: 700; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}

/* Experiment */
.ws-exp-step  { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; font-size: .86rem; }
.ws-step-num  {
  min-width: 22px; height: 22px; border-radius: 50%;
  background: #558b2f; color: #fff;
  font-weight: 700; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ws-exp-obs   { margin-top: 12px; padding: 10px; background: #f9fbe7; border-radius: 6px; }
.ws-obs-pre   { white-space: pre-wrap; font-family: inherit; font-size: .83rem; color: #888; margin: 5px 0; }

/* Rechnen */
.ws-rechnen-item   { margin-bottom: 14px; }
.ws-rechnen-q      { font-size: .87rem; margin-bottom: 6px; }
.ws-rechnen-space  { display: flex; flex-direction: column; gap: 4px; }

/* Rezept */
.ws-rezept-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: 10px; }
.ws-rezept-grid h4 { margin: 0 0 6px; font-size: .88rem; color: #558b2f; }

/* Malbild */
.ws-malbild { text-align: center; padding: 8px 0; }

/* Freitext */
.ws-free-box {
  border: 1.5px solid #ddd;
  border-radius: 8px;
  min-height: 150px;
  background: #fafaf8;
  margin-top: 8px;
  background-image: repeating-linear-gradient(transparent, transparent 25px, #f0f0f0 25px, #f0f0f0 26px);
}

/* Lösungsblatt */
.ws-loesung-wrap { background: #fff9c4; border-radius: 8px; padding: 14px; }
.ws-sol-sec      { margin-bottom: 12px; }
.ws-sol-sec h4   { color: #558b2f; margin: 0 0 5px; font-size: .88rem; }
.ws-sol-item     { display: inline-block; margin: 2px 6px 2px 0; font-size: .82rem; }
.ws-sol-raetsel  { font-size: .82rem; margin: 3px 0; color: #444; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .lzg-sb-layout { grid-template-columns: 260px 1fr; }
}

@media (max-width: 680px) {
  .lzg-sb-layout       { grid-template-columns: 1fr; }
  .lzg-sb-sidebar      { border-right: none; border-bottom: 2px solid #ffe082; max-height: 420px; }
  .lzg-sb-header       { padding: 18px 16px; }
  .lzg-sb-preview      { max-height: none; }
  .ws-zuo-grid         { grid-template-columns: 1fr; }
  .ws-rezept-grid      { grid-template-columns: 1fr; }
  .ws-cw-wrap          { flex-direction: column; }
  .ws-plant-wrap       { flex-direction: column; }
}
