/* sol-lernjournal.css – QRENA Lerntagebuch (SOL) v1.0.0 */
/* Design Hook: Buch-Reiter-Leiste (Kapitel als Karteireiter) statt generischer Pagination-Punkte,
   warmer "Seiten"-Innenton in der ansonsten dunklen Glass-Hülle, editoriale Kapitel-Typografie. */
/* Geteilt zwischen Schüler-Overlay (rallye.html) und Lehrer-Overlay (sol-radar.js/lehrkraft.html)
   — EIN Stylesheet für visuelle Konsistenz, siehe Plan-Datei "Lernjournal". */
/* Prefix: sol-lj- (sol-lernjournal) — keine Konflikte mit bestehenden Klassen. */

/* ──────────────────────────────────────────────────────────────
   LEHRER-EINSTIEGSPUNKT (SOL-Radar Detail-Header)
   ────────────────────────────────────────────────────────────── */
.sol-radar-detail-lj-btn {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 150ms ease, transform 150ms ease;
}
.sol-radar-detail-lj-btn:hover { background: rgba(16, 185, 129, 0.18); transform: translateY(-1px); }
.sol-radar-detail-lj-btn:focus-visible { outline: 2px solid #34d399; outline-offset: 2px; }

/* ──────────────────────────────────────────────────────────────
   OVERLAY-SHELL
   ────────────────────────────────────────────────────────────── */
.sol-lj-overlay {
  position: fixed;
  inset: 0;
  z-index: 650;
  background: rgba(6, 10, 20, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: solTrackOverlayIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.sol-lj-overlay.hidden { display: none; }

.sol-lj-shell {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(253, 246, 227, 0.05) 0%, rgba(31, 41, 55, 0.55) 22%);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: var(--radius-xl, 20px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(16, 185, 129, 0.06);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sol-lj-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}
.sol-lj-close:hover, .sol-lj-close:focus-visible {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  transform: rotate(90deg);
}
.sol-lj-close:focus-visible { outline: 2px solid #fca5a5; outline-offset: 2px; }
/* Explizite stroke-Farbe statt currentColor-Vererbung: auf manchen WebKit-Geräten bleibt das
   SVG-Icon innerhalb des backdrop-filter-Containers unsichtbar, obwohl color korrekt gesetzt ist
   (Hintergrund/Rand ohne currentColor-Abhängigkeit rendern dort einwandfrei). */
.sol-lj-close svg { stroke: #fff; width: 18px; height: 18px; flex-shrink: 0; }
.sol-lj-close:hover svg, .sol-lj-close:focus-visible svg { stroke: #fca5a5; }

/* ──────────────────────────────────────────────────────────────
   LOADING / EMPTY / ERROR ZUSTÄNDE
   ────────────────────────────────────────────────────────────── */
.sol-lj-loading, .sol-lj-empty, .sol-lj-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 32px;
  color: var(--muted, #94a3b8);
}
.sol-lj-loading.hidden, .sol-lj-empty.hidden, .sol-lj-error.hidden { display: none; }

.sol-lj-loading-spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: #34d399;
  animation: sol-lj-spin 0.8s linear infinite;
}
@keyframes sol-lj-spin { to { transform: rotate(360deg); } }

.sol-lj-empty svg { color: rgba(52, 211, 153, 0.4); }
.sol-lj-empty h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text, #f1f5f9);
  margin: 0;
}
.sol-lj-empty p, .sol-lj-error p { font-size: 0.85rem; line-height: 1.5; max-width: 320px; margin: 0; }

.sol-lj-retry {
  margin-top: 4px;
  padding: 10px 20px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-weight: 700;
  cursor: pointer;
}

/* ──────────────────────────────────────────────────────────────
   INHALT
   ────────────────────────────────────────────────────────────── */
.sol-lj-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sol-lj-content.hidden { display: none; }

.sol-lj-header {
  padding: 24px 56px 12px 24px;
  flex-shrink: 0;
}
.sol-lj-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(52, 211, 153, 0.75);
}
.sol-lj-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text, #f1f5f9);
  margin: 4px 0 0;
  line-height: 1.15;
}
.sol-lj-archived-badge {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(251, 191, 36, 0.85);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.sol-lj-archived-badge[hidden] { display: none; }

/* Kapitel-Reiter — der Design-Hook: Buch-/Karteireiter statt Punkte-Pagination */
.sol-lj-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.sol-lj-tabs::-webkit-scrollbar { display: none; }

.sol-lj-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #94a3b8);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(2px);
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
  max-width: 120px;
}
.sol-lj-tab:hover { background: rgba(255, 255, 255, 0.06); color: var(--text, #f1f5f9); }
.sol-lj-tab.is-active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
  transform: translateY(0);
}
.sol-lj-tab:focus-visible { outline: 2px solid #34d399; outline-offset: 1px; }
.sol-lj-tab-num {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 900;
  opacity: 0.8;
}
.sol-lj-tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Seiten-Fläche — dezenter warmer Innenton, bewusst kein voller Stilwechsel */
.sol-lj-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(180deg, rgba(253, 246, 227, 0.035) 0%, transparent 140px);
  border-top: 1px solid rgba(16, 185, 129, 0.15);
  touch-action: pan-y;
}

.sol-lj-entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sol-lj-empty-chapter {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted, #94a3b8);
  font-size: 0.85rem;
}

/* Rückblick-Eintrag (Checkpoint-/Reflexions-Feedback) */
.sol-lj-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg, 16px);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
}
.sol-lj-entry-body { flex: 1; min-width: 0; }
.sol-lj-entry-question {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #f1f5f9);
  line-height: 1.4;
}
.sol-lj-entry-date {
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--muted, #94a3b8);
}
.sol-lj-entry-smiley { flex-shrink: 0; width: 36px; height: 36px; }
.sol-lj-entry-smiley svg { width: 100%; height: 100%; }
.sol-lj-entry-stars { display: flex; gap: 2px; flex-shrink: 0; padding-top: 2px; }
.sol-lj-entry-stars svg { width: 16px; height: 16px; opacity: 0.25; }
.sol-lj-entry-stars .is-filled svg { opacity: 1; }
.sol-lj-entry-textbadge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Freier Eintrag — eigene Optik (Anführungszeichen-Akzent), sichtbar unterscheidbar
   vom strukturierten Rückblick-Eintrag, ohne ein zweites Stil-Vokabular einzuführen */
.sol-lj-entry--free {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.06) 0%, rgba(255, 255, 255, 0.03) 60%);
  border-color: rgba(16, 185, 129, 0.18);
}
.sol-lj-entry-quote {
  flex-shrink: 0;
  width: 28px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.2rem;
  line-height: 1;
  color: rgba(52, 211, 153, 0.45);
  font-weight: 700;
}
.sol-lj-entry-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text, #f1f5f9);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Freier-Eintrag-Formular — nur im Kapitel der aktuell laufenden Einheit sichtbar */
.sol-lj-compose {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg, 16px);
  background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.3);
}
.sol-lj-compose[hidden] { display: none; }
.sol-lj-compose-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #34d399;
  margin-bottom: 8px;
}
.sol-lj-compose-input {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  background: rgba(15, 23, 42, 0.5);
  color: var(--text, #f1f5f9);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
}
.sol-lj-compose-input:focus-visible {
  outline: none;
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.sol-lj-compose-submit {
  margin-top: 10px;
  padding: 10px 20px;
  border-radius: var(--radius-md, 10px);
  border: none;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: #06251b;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 44px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.sol-lj-compose-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3); }
.sol-lj-compose-submit:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

/* Kapitel-Navigation */
.sol-lj-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--glass-border, rgba(255,255,255,0.08));
}
.sol-lj-nav-btn {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #f1f5f9);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease;
}
.sol-lj-nav-btn:hover:not(:disabled) { border-color: rgba(16, 185, 129, 0.4); color: #34d399; transform: scale(1.05); }
.sol-lj-nav-btn:disabled { opacity: 0.25; cursor: default; }
/* Explizite stroke-Farbe statt currentColor-Vererbung: siehe Kommentar bei .sol-lj-close. */
.sol-lj-nav-btn svg { stroke: var(--text, #f1f5f9); width: 18px; height: 18px; flex-shrink: 0; }
.sol-lj-nav-btn:hover:not(:disabled) svg { stroke: #34d399; }
.sol-lj-nav-btn:focus-visible { outline: 2px solid #34d399; outline-offset: 2px; }
.sol-lj-nav-hint {
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
  text-align: center;
  flex: 1;
}

/* Mobile: knapper Innenabstand, aber kein Vollbild-Eindruck mehr — kleiner Rand + Rundung bleiben,
   damit es sich weiterhin wie ein Overlay anfühlt statt wie eine eigene Vollbild-Seite. */
@media (max-width: 480px) {
  .sol-lj-overlay { padding: 10px; }
  .sol-lj-shell { height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .sol-lj-header { padding: 20px 52px 10px 16px; }
  .sol-lj-tabs { padding: 0 12px; }
  .sol-lj-page { padding: 16px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sol-lj-overlay, .sol-lj-close, .sol-lj-tab, .sol-lj-nav-btn, .sol-lj-compose-submit {
    animation: none !important;
    transition: none !important;
  }
}
