/* 1) Root Variablen (Tech Light Theme mit verbessertem Kontrast) */
:root {
  /* Tech Palette (Original Hell) */
  --tech-bg: #e6edf4;       /* Sehr helles Grau/Blau */
  --tech-surface: #ffffff;  /* Reinweiß */
  --tech-border: #cbd5e1;   /* Sichtbarerer Rahmen (dunkler) */
  --tech-border-hover: #94a3b8;
  
  /* Akzentfarben (kräftiger für besseren Kontrast) */
  --color-info: #0284c7;    /* Dunkleres Sky Blue */
  --color-success: #16a34a; /* Dunkleres Grün */
  --color-danger: #dc2626;  /* Dunkleres Rot */
  --color-warning: #d97706; /* Dunkleres Amber */

  /* Text (dunkler für bessere Lesbarkeit) */
  --text-primary: #0f172a;  /* Fast Schwarz */
  --text-secondary: #1e293b; /* Dunkles Slate */
  --text-muted: #475569;    /* Dunkleres Grau */

  /* Layout & Spacing */
  --sidebar-width: 360px;
  --abstand-aussen: 24px;
  --sticky-under-header: 110px;

  /* Formen */
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-soft: 1px solid var(--tech-border);

  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Schatten (verstärkt für mehr Tiefe) */
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
  
  /* Aliases */
  --bg-body: var(--tech-bg);
  --bg-card: var(--tech-surface);
  --text: var(--text-primary);
}

/* 2) Reset + Base */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding: var(--abstand-aussen);
  font-family: var(--font-sans);
  
  background-color: #94a3b8;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.05) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 4px
    );
  
  color: var(--text);
}


code, pre { font-family: var(--font-mono); }

a { color: inherit; }

.container {
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

/* fixed header spacing */
.page-with-fixed-header { padding-top: var(--sticky-under-header); }

h1 { margin: 0 0 12px 0; font-size: 1.75rem; color: var(--text-primary); }
h2 { margin: 0 0 10px 0; font-size: 1.5rem; color: var(--text-primary); }

.muted { color: var(--text-muted); }

.error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
  font-weight: 600;
}

/* 4) Forms */
label {
  display: block;
  margin: 10px 0 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--tech-border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  outline: none;
}

input:focus {
  border-color: var(--color-info);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Buttons: Basis (Varianten in komponenten.css) */
button, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-info);
  background: var(--color-info);
  color: #fff;

  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

button:hover, a.btn:hover { 
  background: #0369a1;
  border-color: #0369a1;
  box-shadow: 0 4px 8px rgba(2, 132, 199, 0.25);
}
button:active, a.btn:active { transform: translateY(1px); }

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* 5) App Header (Premium Glass Tech) */
.app-header {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 1000;

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;

  padding: 0 24px;
  height: 64px;

  border-radius: 16px;

  /* Glass Effect mit mehr Kontrast */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  
  border: 1px solid rgba(203, 213, 225, 0.8);
  
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.12),
    0 4px 6px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);

  color: var(--text-primary);
  transition: all 0.3s ease;
}

/* Brand Logo */
.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
}
.brand__name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Header Middle: Navigation */
.app-header__middle {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  gap: 10px;
  overflow: visible; 
}

/* Header Right: Bot & User */
.app-header__right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

/* 6) Dropdowns (Ultra Clean Style) */
.nav-dd {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Der Trigger (Button) - KOMPLETT TRANSPARENT */
.nav-dd__summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  
  display: flex;
  align-items: center;
  gap: 6px;
  
  transition: color 0.2s ease;
}

.nav-dd__summary::-webkit-details-marker { display: none; }

/* Hover & Open State: NUR Textfarbe ändern */
.nav-dd__summary:hover,
details[open] > .nav-dd__summary {
  color: var(--text-muted);
}

/* Pfeil nach unten */
.nav-dd__summary::after {
  content: '';
  display: block;
  width: 0; height: 0; 
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--text-muted);
  transition: transform 0.2s ease, border-top-color 0.2s;
  margin-top: 2px;
  opacity: 0.7;
}

/* Pfeil bei Hover/Open */
.nav-dd__summary:hover::after,
details[open] > .nav-dd__summary::after {
  border-top-color: var(--color-info);
  opacity: 1;
}

/* Pfeil drehen bei offen */
details[open] > .nav-dd__summary::after {
  transform: rotate(180deg);
}

/* Das Panel (Das Menü selbst) */
.nav-dd__panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  
  min-width: 220px;
  padding: 6px;
  
  background: #ffffff;
  border: 1px solid var(--tech-border);
  border-radius: 12px;
  
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.15), 
    0 8px 10px rgba(0, 0, 0, 0.1);
    
  z-index: 2100;
  
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Panel sichtbar machen */
details[open] > .nav-dd__panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Rechtsbündiges Panel (für User-Menü) */
.nav-dd__panel--right {
  left: auto;
  right: 0;
  transform: translateY(-10px);
}

details[open] > .nav-dd__panel--right {
  transform: translateY(0);
}

/* Inhalt des Menüs */
.nav-dd__title {
  padding: 8px 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--tech-border);
  margin-bottom: 4px;
}

.nav-dd__item {
  display: flex;
  align-items: center;
  gap: 10px;
  
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  
  transition: background 0.15s, color 0.15s;
}

.nav-dd__item:hover {
  background: rgba(2, 132, 199, 0.1);
  color: var(--color-info);
}

/* Logout Button rot */
.nav-dd__item--danger:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-danger);
}

.nav-dd__muted {
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

/* 7) Inline Editing */
[contenteditable="true"]:focus {
  background: rgba(2, 132, 199, 0.1);
  border-bottom: 1px solid var(--color-info);
  outline: none;
}

/* 8) Loading State */
.is-loading {
  position: relative;
  opacity: 0.7;
  pointer-events: none;
}

/* 9) Toasts */
.toast-container {
  position: fixed;
  bottom: var(--abstand-aussen);
  right: var(--abstand-aussen);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(2, 132, 199, 0.3);
  border-left: 4px solid var(--color-info);
  color: #fff;

  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-hover);
  min-width: 260px;

  opacity: 0;
  transform: translateY(16px);
  animation: toastIn 0.25s forwards;

  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }

@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ============================================================================
   Notices / Blocking Error Modal
   ============================================================================ */

.notice {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;

  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 900;

  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(2, 132, 199, 0.3);
  min-width: 260px;
  max-width: min(720px, calc(100vw - 40px));
  text-align: center;
}

.notice--success {
  background: rgba(22, 163, 74, 0.95);
  color: #fff;
  border-color: var(--color-success);
}

.notice.is-hide {
  animation: noticeOut 0.15s forwards;
}

@keyframes noticeOut {
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.98); }
}

.nav-dd__item[data-locked="1"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================
   MONACO EDITOR STYLE RESET
   ========================================= */

/* 1. Verhindern, dass app.css die Inputs im Editor sprengt */
.monaco-editor input {
    width: initial !important;      /* Dein width: 100% aufheben */
    padding: 2px 4px !important;    /* Dein padding: 10px aufheben */
    margin: 0 !important;
    height: initial !important;
    border-radius: 0 !important;
    display: inline-block !important;
    font-size: inherit !important;
}

/* 2. Labels im Editor wieder normal machen */
.monaco-editor label {
    display: inline !important;     /* Dein display: block aufheben */
    margin: 0 !important;           /* Dein margin aufheben */
    font-weight: normal !important;
    cursor: default !important;
}

/* 3. Dropdowns im Editor fixen */
.monaco-editor select {
    width: auto !important;
    padding: 0 !important;
}

/* 4. Hintergrund des F1-Menüs sicherstellen */
.quick-input-widget {
    background-color: #252526 !important; /* Dunkler Hintergrund wie VS Code */
    color: #ccc !important;
    border: 1px solid #454545 !important;
}

