/* =====================================
   Microteaching Builder – Layout
   (Farben/Buttons/Toasts: mtb-base.css)
===================================== */

.mtb-body { color: var(--mtb-text); }

main.mtb-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  box-sizing: border-box;
}

.mtb-container {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* =====================================
   SIDEBAR / STEPPER
===================================== */

.mtb-sidebar {
  position: sticky;
  top: 16px;
  background: var(--mtb-surface);
  border-radius: var(--mtb-radius);
  box-shadow: var(--mtb-shadow);
  padding: 18px 12px 14px;
}

.mtb-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--mtb-primary);
  padding: 0 10px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--mtb-border);
}

.mtb-steps { display: flex; flex-direction: column; gap: 4px; }

.mtb-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--mtb-radius-sm);
  background: none;
  color: var(--mtb-text);
  font: inherit;
  font-size: .95rem;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s;
}
.mtb-step:hover { background: var(--mtb-primary-soft); }
.mtb-step:focus-visible { outline: none; box-shadow: var(--mtb-focus); }

.mtb-step.active { background: var(--mtb-primary); color: #fff; }
.mtb-step.active .mtb-step-meta { color: rgba(255, 255, 255, .8); }

.mtb-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mtb-step-label { font-weight: 600; line-height: 1.3; }
.mtb-step-meta { font-size: .78rem; color: var(--mtb-muted); }
.mtb-step-meta:empty { display: none; }

/* Fortschrittspunkt: leer → angefangen → alle Kriterien abgehakt */
.mtb-step-dot {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid #c9c5dc;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.mtb-step.is-partial .mtb-step-dot {
  border-color: var(--mtb-accent-dark);
  background: conic-gradient(var(--mtb-accent) 0 50%, transparent 50% 100%);
}
.mtb-step.is-done .mtb-step-dot { border-color: var(--mtb-success); background: var(--mtb-success); }
.mtb-step.is-done .mtb-step-dot::after { content: "✓"; }
.mtb-step.active .mtb-step-dot { border-color: rgba(255, 255, 255, .85); }

.mtb-step--presenter {
  margin-top: 10px;
  justify-content: center;
  background: var(--mtb-accent);
  color: var(--mtb-primary);
  font-weight: 700;
}
.mtb-step--presenter:hover { background: var(--mtb-accent-dark); }

/* =====================================
   KOPFZEILE (Microteaching, Speichern, Login)
===================================== */

.mtb-workspace { min-width: 0; }

.mtb-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  background: var(--mtb-surface);
  border-radius: var(--mtb-radius);
  box-shadow: var(--mtb-shadow);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.mtb-session { display: flex; align-items: center; gap: 10px; flex: 1 1 340px; min-width: 0; }
.mtb-session label { font-weight: 600; white-space: nowrap; font-size: .92rem; }
.mtb-session select { flex: 1; min-width: 240px; }

.mtb-savebox { display: flex; align-items: center; gap: 12px; }

.mtb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  color: var(--mtb-muted);
  margin-left: auto;
}
.mtb-user strong { color: var(--mtb-text); }
.mtb-user a { color: var(--mtb-primary); font-weight: 600; }

.mtb-guest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.mtb-lock-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff6db;
  border: 1px solid var(--mtb-note-border);
  border-radius: var(--mtb-radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.mtb-lock-hint[hidden] { display: none; }

/* =====================================
   FORMULAR-ELEMENTE
===================================== */

.mtb-body select,
.mtb-input {
  font: inherit;
  font-size: .95rem;
  color: var(--mtb-text);
  background: var(--mtb-surface);
  border: 1px solid #cfcbe0;
  border-radius: var(--mtb-radius-sm);
  padding: .5em .7em;
  box-sizing: border-box;
}
.mtb-body select:focus,
.mtb-input:focus { outline: none; border-color: var(--mtb-primary); box-shadow: var(--mtb-focus); }

/* =====================================
   INHALTSBEREICH
===================================== */

.mtb-main-content {
  background: var(--mtb-surface);
  border-radius: var(--mtb-radius);
  box-shadow: var(--mtb-shadow);
  padding: 28px 32px 24px;
}

.mtb-content-section { display: none; }
.mtb-content-section.active { display: block; animation: mtb-fade .2s ease; }

@keyframes mtb-fade { from { opacity: 0; } to { opacity: 1; } }

.mtb-section-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
  color: var(--mtb-primary);
}

.mtb-block-desc {
  margin: 0 0 22px;
  color: var(--mtb-muted);
  line-height: 1.55;
  max-width: 75ch;
}
.mtb-block-desc a { color: var(--mtb-primary); font-weight: 600; white-space: nowrap; }

/* ---------- Neues Microteaching (Block 1) ---------- */
.mtb-create {
  border: 1px solid var(--mtb-border);
  border-radius: var(--mtb-radius);
  background: #faf9fe;
  padding: 16px;
  margin-bottom: 24px;
}

.mtb-segmented {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 14px;
  background: var(--mtb-primary-soft);
  border-radius: 999px;
}
.mtb-segmented label { position: relative; cursor: pointer; }
.mtb-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.mtb-segmented span {
  display: block;
  padding: .4em 1em;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--mtb-primary);
}
.mtb-segmented input:checked + span { background: var(--mtb-primary); color: #fff; }
.mtb-segmented input:focus-visible + span { box-shadow: var(--mtb-focus); }

.course.selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.course.selector[hidden] { display: none; }
.selector-group label,
.mtb-custom-title label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 4px;
}
.selector-group select { width: 100%; }

.mtb-custom-title .mtb-input { width: 100%; max-width: 520px; }

.mtb-create-actions { margin-top: 14px; }

/* ---------- Haftnotizen ---------- */
.mtb-two-column { width: 100%; }

.mtb-presentation-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.mtb-sticky-note {
  display: flex;
  flex-direction: column;
  background: var(--mtb-note);
  border: 1px solid var(--mtb-note-border);
  border-radius: var(--mtb-radius-sm);
  padding: 12px 14px 14px;
  box-shadow: 0 1px 2px rgba(120, 90, 0, .08);
  transition: box-shadow .15s, border-color .15s;
}
.mtb-sticky-note:focus-within {
  border-color: var(--mtb-primary);
  box-shadow: var(--mtb-focus);
}
.mtb-sticky-note.is-filled .mtb-note-label::after {
  content: "✓";
  margin-left: .4em;
  color: var(--mtb-success);
  font-size: .85em;
}

.mtb-note-label {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 8px;
  color: #4a3b00;
}

.mtb-textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: .95rem;
  line-height: 1.45;
  color: var(--mtb-text);
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(160, 130, 20, .18);
  border-radius: 6px;
  padding: 8px 10px;
}
textarea.mtb-textarea { min-height: 110px; resize: none; overflow: hidden; }
.mtb-textarea::placeholder { color: #8f8a73; }
.mtb-textarea:focus { outline: none; background: #fff; border-color: transparent; }
.mtb-textarea:disabled { cursor: not-allowed; opacity: .6; }

/* ---------- Checklisten ---------- */
.mtb-checklist {
  margin: 24px 0 0;
  padding: 16px 18px;
  background: var(--mtb-primary-soft);
  border-radius: var(--mtb-radius);
  border-left: 4px solid var(--mtb-primary);
}
.mtb-checklist-title { margin: 0 0 10px; font-size: 1rem; color: var(--mtb-primary); }
.mtb-checklist-text { margin: 0 0 10px; color: var(--mtb-muted); line-height: 1.5; }

.mtb-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  line-height: 1.4;
}
.mtb-checkbox {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--mtb-primary);
  cursor: pointer;
}
.mtb-checkbox:disabled { cursor: not-allowed; }
.mtb-checkbox:checked + span { color: var(--mtb-muted); }

.mtb-summary-section .mtb-checklist { border-left-color: var(--mtb-accent-dark); }

/* ---------- Weiter / Zurück ---------- */
.mtb-block-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--mtb-border);
}

.mtb-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 48%;
  padding: 10px 16px;
  border: 1px solid var(--mtb-border);
  border-radius: var(--mtb-radius-sm);
  background: var(--mtb-surface);
  color: var(--mtb-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.mtb-nav-btn small { font-size: .78rem; color: var(--mtb-muted); }
.mtb-nav-btn span { font-weight: 600; color: var(--mtb-primary); }
.mtb-nav-btn:hover { background: var(--mtb-primary-soft); border-color: #cfc8ef; }
.mtb-nav-btn:focus-visible { outline: none; box-shadow: var(--mtb-focus); }
.mtb-nav-next { margin-left: auto; text-align: right; }

.mtb-nav-presenter { background: var(--mtb-accent); border-color: var(--mtb-accent); }
.mtb-nav-presenter small { color: #6b5200; }
.mtb-nav-presenter:hover { background: var(--mtb-accent-dark); border-color: var(--mtb-accent-dark); }

/* =====================================
   RESPONSIVE
===================================== */

@media (max-width: 980px) {
  .mtb-container { grid-template-columns: minmax(0, 1fr); gap: 14px; }

  /* Sidebar wird zur waagrechten Schrittleiste */
  .mtb-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-width: 0;
    padding: 8px;
    border-radius: 0 0 var(--mtb-radius) var(--mtb-radius);
  }
  .mtb-brand { display: none; }
  .mtb-steps { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: thin; }
  .mtb-step { width: auto; flex: none; align-items: center; white-space: nowrap; padding: 8px 12px; }
  .mtb-step-meta { display: none; }
  .mtb-step--presenter { margin-top: 0; }
}

@media (max-width: 700px) {
  main.mtb-page { padding: 0 0 24px; }
  .mtb-topbar, .mtb-main-content, .mtb-lock-hint { border-radius: 0; }
  .mtb-main-content { padding: 20px 16px; }
  .mtb-topbar { padding: 12px 16px; }
  .mtb-session { flex-wrap: wrap; flex-basis: 100%; }
  .mtb-session select { flex-basis: 100%; }
  .mtb-user { margin-left: 0; }
  .course.selector { grid-template-columns: 1fr; }
  .mtb-section-title { font-size: 1.35rem; }
  .mtb-nav-btn { max-width: none; flex: 1; }
}
