/* PATH: Editor/UltraEditor/style.css
   UltraEditor v8 – Responsive & kompakte Flächennutzung
   Fokus:
   - Außenränder minimal halten, damit im Hub/iframe kein "unbenutzter Hof" entsteht.
   - Automatische Dichte-Profile für 4K/2K/1K/Tablet/Handy.
   - Sliders nur dort, wo echtes Resizing Sinn macht (Dock + MR-Bottom).
*/

:root {
  /* Dark theme defaults */
  --ue-bg: #020714;
  --ue-bg-panel: #050d1f;
  --ue-border-soft: rgba(24, 224, 255, 0.35);
  --ue-border-strong: #18e0ff;
  --ue-text: #e8f7ff;
  --ue-muted: #8fa0bf;
  --ue-accent: #18e0ff;
  --ue-radius-lg: 18px;
  --ue-radius-sm: 10px;
  --ue-shadow: 0 0 32px rgba(0, 0, 0, 0.7);

  /* Bottom panel height */
  --ue-bottom-height: 220px;
  --ue-bottom-min: 52px;

  /* Dock widths */
  --ue-dock-left: 33%;
  --ue-dock-mid: 34%;
  --ue-dock-right: 33%;
  --ue-dock-min: 220px;

  /* Focus widths (live) */
  --ue-focus-left: var(--ue-dock-left);
  --ue-focus-mid: var(--ue-dock-mid);
  --ue-focus-right: var(--ue-dock-right);

  /* Hover/click */
  --ue-hover-glow: 0 0 12px rgba(24, 224, 255, 0.55);
  --ue-active-scale: 0.98;

  /* Density scalars */
  --ue-pad-outer: 8px;
  --ue-pad-root: 10px;
  --ue-gap: 8px;
  --ue-font-base: 0.84rem;
  --ue-font-small: 0.74rem;
  --ue-header-h1: 1.28rem;
}

/* Light theme overrides */
body.ue-theme-light {
  --ue-bg: #f4f7ff;
  --ue-bg-panel: #ffffff;
  --ue-border-soft: rgba(20, 90, 170, 0.28);
  --ue-border-strong: #1a6ed8;
  --ue-text: #061427;
  --ue-muted: #42536e;
  --ue-accent: #1a6ed8;
  --ue-shadow: 0 0 24px rgba(6, 20, 39, 0.12);

  --ue-hover-glow: 0 0 10px rgba(26, 110, 216, 0.35);
}

/* Density presets via body classes (set by app.js) */
body.ue-density-compact {
  --ue-pad-outer: 4px;
  --ue-pad-root: 8px;
  --ue-gap: 6px;
  --ue-font-base: 0.82rem;
  --ue-font-small: 0.72rem;
  --ue-header-h1: 1.18rem;
  --ue-bottom-height: 200px;
}
body.ue-density-ultra {
  --ue-pad-outer: 2px;
  --ue-pad-root: 8px;
  --ue-gap: 6px;
  --ue-font-base: 0.86rem;
  --ue-font-small: 0.76rem;
  --ue-header-h1: 1.32rem;
  --ue-bottom-height: 240px;
}

/* Reset */
* { box-sizing: border-box; }

/* Body stretches full width – no forced centering */
body.ue-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ue-text);
  background:
    radial-gradient(circle at top, rgba(24, 224, 255, 0.12), transparent 42%),
    radial-gradient(circle at bottom, rgba(24, 224, 255, 0.06), transparent 55%),
    linear-gradient(180deg, #000 0%, var(--ue-bg) 25%, #000 100%);
  padding: var(--ue-pad-outer);
  display: block;
}

body.ue-theme-light.ue-body {
  background:
    radial-gradient(circle at top, rgba(26, 110, 216, 0.12), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #eef3ff 40%, #ffffff 100%);
}

/* Root uses nearly full viewport width/height */
.ue-root {
  width: 100%;
  min-height: calc(100vh - (var(--ue-pad-outer) * 2));
  border-radius: var(--ue-radius-lg);
  background:
    radial-gradient(circle at top left,
      rgba(24, 224, 255, 0.08),
      rgba(2, 7, 20, 0.98));
  border: 1px solid rgba(24, 224, 255, 0.25);
  box-shadow: var(--ue-shadow);
  padding: var(--ue-pad-root);
  display: flex;
  flex-direction: column;
  gap: var(--ue-gap);
}

body.ue-theme-light .ue-root {
  background:
    radial-gradient(circle at top left,
      rgba(26, 110, 216, 0.06),
      rgba(255, 255, 255, 0.98));
  border: 1px solid var(--ue-border-soft);
}

/* Header */
.ue-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--ue-radius-sm);
  background:
    linear-gradient(135deg, rgba(7, 21, 47, 0.95), rgba(4, 10, 28, 0.98));
  border: 1px solid rgba(24, 224, 255, 0.33);
}

body.ue-theme-light .ue-header {
  background: linear-gradient(135deg, #ffffff, #f3f7ff);
  border: 1px solid var(--ue-border-soft);
}

.ue-header-main { display: flex; flex-direction: column; justify-content: center; }

.ue-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--ue-muted);
  margin: 0 0 3px;
}

.ue-header h1 {
  margin: 0;
  font-size: var(--ue-header-h1);
  letter-spacing: 0.06em;
}

.ue-subtitle {
  font-size: 0.9rem;
  color: var(--ue-accent);
  margin-left: 0.35rem;
}

.ue-header-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  align-items: flex-end;
  max-width: 520px;
}

.ue-header-note {
  font-size: var(--ue-font-small);
  color: var(--ue-muted);
  line-height: 1.3;
  text-align: right;
}

.ue-note-compact-hint { opacity: 0.8; }

.ue-header-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Top row */
.ue-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ue-tabs,
.ue-viewtoggles {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  background: rgba(1, 8, 18, 0.92);
  border-radius: 999px;
  border: 1px solid rgba(24, 224, 255, 0.3);
  align-items: center;
  flex-wrap: wrap;
}

body.ue-theme-light .ue-tabs,
body.ue-theme-light .ue-viewtoggles {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--ue-border-soft);
}

.ue-tab {
  border: none;
  outline: none;
  background: transparent;
  color: var(--ue-text);
  font-size: 0.84rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.ue-tab.is-active {
  background: linear-gradient(135deg, var(--ue-border-strong), rgba(84, 240, 255, 1));
  color: #001019;
  box-shadow: var(--ue-hover-glow);
}

body.ue-theme-light .ue-tab.is-active {
  background: linear-gradient(135deg, var(--ue-accent), #7fb2ff);
  color: #ffffff;
}

.ue-pill {
  border: none;
  outline: none;
  background: transparent;
  color: var(--ue-text);
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.ue-pill.is-active {
  background: rgba(24, 224, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(24, 224, 255, 0.55);
}

body.ue-theme-light .ue-pill.is-active {
  background: rgba(26, 110, 216, 0.12);
  box-shadow: inset 0 0 0 1px rgba(26, 110, 216, 0.45);
}

.ue-divider {
  width: 1px;
  height: 16px;
  background: rgba(24, 224, 255, 0.35);
  opacity: 0.6;
  margin: 0 2px;
}

/* Status line */
.ue-statusline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 0.76rem;
  padding: 5px 8px;
  border-radius: var(--ue-radius-sm);
  background: rgba(2, 9, 20, 0.94);
  border: 1px solid rgba(24, 224, 255, 0.26);
}

body.ue-theme-light .ue-statusline {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--ue-border-soft);
}

.ue-status-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.64rem;
  color: var(--ue-muted);
}

.ue-status-value { font-weight: 500; }
.ue-muted { color: var(--ue-muted); }
.ue-status-sep { opacity: 0.6; }

/* Main container fills remaining vertical space */
.ue-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--ue-radius-sm);
  background:
    radial-gradient(circle at top left,
      rgba(24, 224, 255, 0.06),
      rgba(4, 10, 24, 0.98));
  border: 1px solid rgba(24, 224, 255, 0.24);
  overflow: hidden;
}

body.ue-theme-light .ue-main {
  background:
    radial-gradient(circle at top left,
      rgba(26, 110, 216, 0.05),
      rgba(255, 255, 255, 0.98));
  border: 1px solid var(--ue-border-soft);
}

/* Tabs view */
.ue-frame-host {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  background: rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(24, 224, 255, 0.2);
}

.ue-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

.ue-frame-overlay {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
}

.ue-overlay-btn {
  pointer-events: auto;
  border: 1px solid rgba(24, 224, 255, 0.5);
  background: rgba(1, 9, 20, 0.85);
  color: var(--ue-text);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.08s ease, background 0.15s ease;
}

.ue-overlay-btn:hover { box-shadow: var(--ue-hover-glow); }
.ue-overlay-btn:active { transform: scale(var(--ue-active-scale)); }

.ue-split-v {
  height: 8px;
  cursor: row-resize;
  background:
    linear-gradient(90deg,
      rgba(24, 224, 255, 0.0),
      rgba(24, 224, 255, 0.45),
      rgba(24, 224, 255, 0.0));
  user-select: none;
  flex: 0 0 auto;
}

.ue-mr-panel {
  flex: 0 0 var(--ue-bottom-height);
  min-height: var(--ue-bottom-min);
  padding: 8px 10px 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  overflow: auto;
  background:
    radial-gradient(circle at bottom,
      rgba(24, 224, 255, 0.05),
      rgba(2, 7, 20, 0.98));
}

/* Cards */
.ue-card {
  border-radius: var(--ue-radius-sm);
  background: rgba(3, 9, 22, 0.96);
  border: 1px solid rgba(24, 224, 255, 0.3);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.35);
  padding: 9px 10px 10px;
  font-size: var(--ue-font-base);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ue-card h2 { margin: 0 0 2px; font-size: 0.95rem; }
.ue-card-text { margin: 0 0 2px; color: var(--ue-muted); line-height: 1.35; }

.ue-list { margin: 0 0 0 1.05rem; padding: 0; color: var(--ue-muted); }
.ue-list li { margin: 0.18rem 0; }

.ue-field { display: flex; flex-direction: column; gap: 3px; }

.ue-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ue-muted);
}

.ue-input,
.ue-input-file {
  font-family: inherit;
  font-size: var(--ue-font-base);
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(24, 224, 255, 0.45);
  background: rgba(1, 6, 16, 0.95);
  color: var(--ue-text);
}

.ue-field-hint { font-size: 0.72rem; color: var(--ue-muted); }

.ue-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Buttons */
.ue-btn {
  border-radius: 999px;
  border: 1px solid rgba(24, 224, 255, 0.55);
  padding: 5px 12px;
  font-size: 0.8rem;
  background: rgba(1, 9, 20, 0.9);
  color: var(--ue-text);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.ue-btn:hover { box-shadow: var(--ue-hover-glow); }
.ue-btn:active { transform: scale(var(--ue-active-scale)); }

.ue-btn-primary {
  background: linear-gradient(135deg, var(--ue-border-strong), rgba(84, 240, 255, 1));
  color: #001019;
  box-shadow: var(--ue-hover-glow);
}

.ue-btn-ghost { border-style: dashed; }

.ue-btn-sm {
  padding: 3px 9px;
  font-size: 0.72rem;
}

.ue-note { margin: 0; font-size: var(--ue-font-small); color: var(--ue-muted); }

/* Dock view */
.ue-main-dock { padding: 0; }

.ue-dock {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns:
    minmax(var(--ue-dock-min), var(--ue-focus-left))
    8px
    minmax(var(--ue-dock-min), var(--ue-focus-mid))
    8px
    minmax(var(--ue-dock-min), var(--ue-focus-right));
  height: 100%;
}

.ue-dock-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(2, 8, 20, 0.6);
}

.ue-dock-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ue-muted);
  padding: 7px 8px 5px;
  border-bottom: 1px solid rgba(24, 224, 255, 0.2);
  background: rgba(2, 9, 22, 0.9);
}

.ue-dock-title-actions { display:flex; gap:6px; }

.ue-dock-mini {
  border-radius: 8px;
  border: 1px solid rgba(24, 224, 255, 0.4);
  background: rgba(1, 9, 20, 0.85);
  color: var(--ue-text);
  font-size: 0.74rem;
  padding: 2px 6px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.08s ease, background 0.15s ease;
}

.ue-dock-mini:hover { box-shadow: var(--ue-hover-glow); }
.ue-dock-mini:active { transform: scale(var(--ue-active-scale)); }

.ue-dock-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

.ue-dock-mr-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px 8px 10px;
}

.ue-split-h {
  cursor: col-resize;
  background:
    linear-gradient(180deg,
      rgba(24, 224, 255, 0.0),
      rgba(24, 224, 255, 0.48),
      rgba(24, 224, 255, 0.0));
  user-select: none;
}

/* Utility */
.is-hidden { display: none !important; }

/* Responsive breakpoints */
@media (max-width: 1200px) {
  .ue-header-right { max-width: 420px; }
}

@media (max-width: 980px) {
  .ue-header { flex-direction: column; align-items: flex-start; }
  .ue-header-right { align-items: flex-start; text-align: left; max-width: 100%; }
  .ue-header-note { text-align: left; }
}

@media (max-width: 900px) {
  .ue-dock {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(240px, 1fr);
  }
  .ue-split-h { display: none; }
}

@media (max-width: 620px) {
  .ue-header-actions { width: 100%; justify-content: flex-start; }
  .ue-tabs, .ue-viewtoggles { width: 100%; justify-content: flex-start; }
  .ue-statusline { font-size: 0.72rem; }
}

/* Ultra-wide 4K-ish */
@media (min-width: 2200px) {
  :root {
    --ue-dock-min: 280px;
  }
}
