/* ============================================
   Amity Glassmorphism — Cleanup & Readability
   Fix 2: Keine roten/blauen Textfarben
   Fix 3: Zurueck-Button permanent sichtbar
   Fix 4: Kein Ueberlappen, Teleprompter-Sidebar
   ============================================ */

/* ─── FIX 2: Lesbarkeits-Overhaul ─────────────────────────────────────── */

/* Pillar-Header: kein Rot/Blau — stattdessen helles Grau mit dezenter Pillar-Farbe */
.pillar-souveraenitaet .stratos-pillar-header {
  color: #f0c6b8 !important; /* Helles Warm-Peach statt knalliges Coral-Rot */
}
.pillar-strategie .stratos-pillar-header {
  color: #a3bfdb !important; /* Helles Blaugrau statt unlesbares Blau */
}
.pillar-signalanalyse .stratos-pillar-header {
  color: #c4b5fd !important; /* Helles Lila — bleibt gut lesbar */
}

/* Correction-Quote: kein hartes Rot — gelb fuer Warnung */
.correction-quote {
  color: #fbbf24 !important; /* Gelb statt #b91c1c (Rot) */
}

/* Correction-Principle: hoher Kontrast statt Rot/Blau */
.correction-souveraenitaet .correction-principle {
  color: #f0c6b8 !important;
}
.correction-strategie .correction-principle {
  color: #a3bfdb !important;
}
.correction-signalanalyse .correction-principle {
  color: #c4b5fd !important;
}

/* Korrektur-Card Seitenstreifen: dezenter, nicht knallrot/blau */
.correction-souveraenitaet::before {
  background: #f0c6b8 !important;
}
.correction-strategie::before {
  background: #a3bfdb !important;
}

/* LLM-Enrichment Originalsatz: kein Rot — helles Orange/Gelb */
.stratos-correction-card .correction-fix div[style*="color:#b91c1c"],
.stratos-correction-card .correction-fix div[style*="color: #b91c1c"] {
  color: #fbbf24 !important;
}

/* Inconsistency-Eintrag: kein Rot */
.inconsistency-entry {
  color: var(--text) !important;
}

/* Vision Alert Conclusion: kein Rot — helles Gelb */
.vision-expert-conclusion {
  color: #fcd34d !important;
  background: rgba(252, 211, 77, 0.08) !important;
}

/* Generisch: alle inline #b91c1c und #ef4444 Texte umfaerben */
[style*="color: #b91c1c"],
[style*="color:#b91c1c"] {
  color: #fbbf24 !important;
}

[style*="color: #ef4444"],
[style*="color:#ef4444"] {
  color: #fbbf24 !important;
}

/* Score-Ring Bar-Farben bleiben — aber Bar-Score-Text immer lesbar */
.bar-score {
  filter: brightness(1.3);
}

/* ─── FIX 3: Zurueck-Button permanent ───────────────────────────────── */

#stratos-back-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #21867a);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(42, 157, 143, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}

#stratos-back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(42, 157, 143, 0.5);
}

#stratos-back-btn:active {
  transform: scale(0.97);
}

/* Sidebar toggle immer sichtbar (auch bei offenen Panels) */
#sidebar-toggle {
  z-index: 9500 !important;
}

/* ─── FIX 4: Layout-Konsolidierung ──────────────────────────────────── */

/* Stratos-Panel: kein Ueberlappen mit Live-Overlay */
#stratos-panel.open {
  z-index: 600;
}

/* Wenn Live aktiv ist, Stratos-Panel nicht oeffnen (JS regelt) */

/* Stratos-Inner: Platz fuer Teleprompter-Feed rechts */
#stratos-panel.has-teleprompter #stratos-inner {
  max-width: none;
  margin: 0;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

#stratos-panel.has-teleprompter #stratos-inner > *:not(#stratos-live-feed) {
  grid-column: 1;
}

/* Teleprompter-Feed Sidebar im Stratos-Panel */
#stratos-live-feed {
  grid-column: 2;
  grid-row: 1 / -1;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 20px 0;
  border-left: 1px solid var(--glass-border);
  padding-left: 16px;
}

#stratos-live-feed .feed-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

#stratos-live-feed .feed-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  animation: slideUp 0.3s ease;
}

#stratos-live-feed .feed-card .feed-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

#stratos-live-feed .feed-card .feed-text {
  color: var(--text);
}

#stratos-live-feed .feed-card.feed-critical {
  border-left: 3px solid #fbbf24;
}

#stratos-live-feed .feed-card.feed-vision {
  border-left: 3px solid var(--accent);
}

/* Kein Feed = normales Layout */
#stratos-panel:not(.has-teleprompter) #stratos-live-feed {
  display: none;
}

/* ─── FIX 1: Analyse-Textausgabe unter Fortschrittsbalken ───────────── */

#stratos-analysis-output {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  display: none; /* Sichtbar wenn Daten vorhanden */
}

#stratos-analysis-output.visible {
  display: block;
}

#stratos-analysis-output .analysis-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#stratos-analysis-output .analysis-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

#stratos-analysis-output .analysis-item:last-child {
  border-bottom: none;
}

#stratos-analysis-output .analysis-item .analysis-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

#stratos-analysis-output .analysis-item .analysis-text {
  color: var(--text);
}

#stratos-analysis-output .analysis-item .analysis-highlight {
  color: #fbbf24;
  font-weight: 600;
}

#stratos-analysis-output .analysis-item .analysis-positive {
  color: #34d399;
  font-weight: 600;
}

/* ─── Responsive: Feed als Overlay auf kleinen Screens ──────────────── */
@media (max-width: 900px) {
  #stratos-panel.has-teleprompter #stratos-inner {
    grid-template-columns: 1fr;
  }

  #stratos-live-feed {
    grid-column: 1;
    grid-row: auto;
    position: relative;
    max-height: 250px;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    padding-left: 0;
    padding-top: 12px;
  }
}

/* ─── DESIGN OVERHAUL: Stratos + Live Lesbarkeit ───────────────────────── */

/* Score ring: use yellow for low, green for high — NEVER red text */
#stratos-score-num {
  color: var(--text) !important;
}

/* Stratos pillar headers: all use light readable colors, NO red/blue */
.pillar-souveraenitaet .stratos-pillar-header { color: #fbbf24 !important; }
.pillar-strategie .stratos-pillar-header { color: #34d399 !important; }
.pillar-signalanalyse .stratos-pillar-header { color: #c4b5fd !important; }

/* Correction card side strips: muted, not screaming */
.correction-souveraenitaet::before { background: #fbbf24 !important; }
.correction-strategie::before { background: #34d399 !important; }
.correction-signalanalyse::before { background: #c4b5fd !important; }

/* Correction principle text */
.correction-souveraenitaet .correction-principle { color: #fbbf24 !important; }
.correction-strategie .correction-principle { color: #34d399 !important; }
.correction-signalanalyse .correction-principle { color: #c4b5fd !important; }

/* Vision alerts: no blue borders — use teal */
.vision-alert-card { border-left-color: var(--accent) !important; }
.vision-alert-card.vision-alert-warning { border-left-color: #fbbf24 !important; }
.vision-alert-card.vision-alert-critical { border-left-color: #fbbf24 !important; }

/* Vision conclusion: yellow, not red */
.vision-expert-conclusion {
  color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.08) !important;
}

/* Live intervention levels: no red */
.live-intervention-nachschaerfen .live-intervention-level { color: #fbbf24 !important; }

/* Forensic section labels: readable colors */
.forensic-signal .forensic-section-label { color: #34d399 !important; }
.forensic-fbi .forensic-section-label { color: #fbbf24 !important; }

/* Incongruence tags: no red */
.incongruence-nonverbal .incongruence-tag { color: #fbbf24 !important; }
.incongruence-fbi .incongruence-tag { color: #fbbf24 !important; }

/* Live regie text: no blue */
.live-regie-text { color: var(--text) !important; }
.live-correction-text { color: var(--text) !important; }

/* Smart mode cards: replace blue with teal */
.smart-mode-video { --mode-color: var(--accent) !important; border-color: rgba(42, 157, 143, 0.25) !important; }
.smart-mode-video:hover { border-color: var(--accent) !important; }
.smart-mode-video .smart-mode-title { color: var(--accent) !important; }
.smart-active-video { border-color: var(--accent) !important; }

/* Red flag section: yellow instead of red for text */
.section-red-flag-halt .label-halt { color: #fbbf24 !important; }
.halt-reason { color: var(--text) !important; }
.red-flag-category { color: #fbbf24 !important; }
.red-flag-match { color: var(--text) !important; }
.red-flag-halt-msg { color: var(--text-muted) !important; }

/* Panic button stays red — it's intentional for urgency (background, not text) */

/* ALL body text in Stratos must be white/light gray */
#stratos-panel, #stratos-panel * {
  scrollbar-color: #333 transparent;
}

/* Draft output section */
#stratos-draft-output {
  margin-top: 20px;
  padding: 18px 20px;
  background: rgba(42, 157, 143, 0.06);
  border: 1px solid rgba(42, 157, 143, 0.2);
  border-radius: var(--radius, 16px);
  display: none;
}

#stratos-draft-output.visible {
  display: block;
}

#stratos-draft-output .draft-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #34d399;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#stratos-draft-output .draft-text {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text, #e4e4e7);
  white-space: pre-wrap;
}

#stratos-draft-output .draft-copy-btn {
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--accent, #2a9d8f);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

#stratos-draft-output .draft-copy-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 12px rgba(42, 157, 143, 0.4);
}

#stratos-draft-output .draft-copy-btn.copied {
  background: #34d399;
}

#stratos-draft-output .draft-loading {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Corrected text section */
#stratos-corrected-output {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--glass-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: var(--radius, 16px);
  display: none;
}

#stratos-corrected-output.visible {
  display: block;
}

#stratos-corrected-output .corrected-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fbbf24;
  margin-bottom: 12px;
}

#stratos-corrected-output .corrected-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text, #e4e4e7);
  white-space: pre-wrap;
}

/* Navigation: Mode switcher in Stratos */
#stratos-nav-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

#stratos-nav-bar .nav-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#stratos-nav-bar .nav-btn.active {
  background: var(--accent);
  color: #fff;
}

#stratos-nav-bar .nav-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
