* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0a0a;
  --bg-panel: #1a1a1a;
  --bg-elevated: #252525;
  --border: #333;
  --text-primary: #ddd;
  --text-secondary: #888;
  --accent: #fff;
}

body {
  display: grid;
  grid-template-areas:
    "top-bar top-bar top-bar"
    "left-panel canvas right-panel"
    "bottom-bar bottom-bar bottom-bar";
  grid-template-rows: 50px 1fr 50px;
  grid-template-columns: 300px 1fr 300px;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  font-size: 13px;
}

/* ============================================================================
   CANVAS
   ============================================================================ */
#scene {
  grid-area: canvas;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#scene.move-mode {
  cursor: grab;
}

#scene.dragging {
  cursor: grabbing;
}

#scene.connect-mode {
  cursor: pointer;
}

#scene.panning {
  cursor: move;
}

/* ============================================================================
   UI CONTAINER
   ============================================================================ */
#ui {
  display: contents;
}

/* ============================================================================
   TOP BAR
   ============================================================================ */
#top-bar {
  grid-area: top-bar;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

/* ============================================================================
   BOTTOM BAR
   ============================================================================ */
#bottom-bar {
  grid-area: bottom-bar;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

/* ============================================================================
   LEFT PANEL
   ============================================================================ */
#left-panel {
  grid-area: left-panel;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tab Header */
.tab-header {
  display: flex;
  gap: 0;
  padding: 12px 12px 0 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  width: auto !important;
  padding: 8px 16px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 500;
}

.tab-btn:hover {
  background: #2a2a2a;
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-panel);
  color: var(--text-primary);
  border-color: var(--border);
  border-bottom: 1px solid var(--bg-panel);
  position: relative;
  z-index: 1;
}

/* Tab Content */
.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ============================================================================
   RIGHT PANEL
   ============================================================================ */
#right-panel {
  grid-area: right-panel;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

h4 {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================================================
   SECTIONS
   ============================================================================ */
.section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* ============================================================================
   CONTROLS
   ============================================================================ */
.ctrl {
  margin-bottom: 8px;
}

.ctrl label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.ctrl input[type="range"] {
  width: 100%;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.ctrl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
}

.ctrl input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--text-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

button {
  width: 120px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 500;
}

button:hover {
  background: #2a2a2a;
  border-color: #444;
}

button.active {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

button:active {
  transform: scale(0.98);
}

/* ============================================================================
   INFO ELEMENTS
   ============================================================================ */
.info {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 8px;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border-radius: 3px;
}

.count {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 8px;
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */
.tab-content::-webkit-scrollbar,
#right-panel::-webkit-scrollbar {
  width: 8px;
}

.tab-content::-webkit-scrollbar-track,
#right-panel::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

.tab-content::-webkit-scrollbar-thumb,
#right-panel::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.tab-content::-webkit-scrollbar-thumb:hover,
#right-panel::-webkit-scrollbar-thumb:hover {
  background: #2a2a2a;
}

/* ============================================================================
   INSPECTOR
   ============================================================================ */
.collections {
  margin-top: 12px;
}

.collection {
  margin-bottom: 16px;
  padding: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
}

.collection-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inspector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: var(--bg-panel);
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.inspector-item:hover {
  background: #222;
}

.inspector-item.selected {
  background: #2a4a6a;
  border-color: #4a7a9a;
}

.inspector-item span {
  flex: 1;
  user-select: none;
}

.floater-item {
  font-weight: 500;
}

.constraint-item {
  font-size: 11px;
  opacity: 0.8;
  margin-left: 12px;
}

.item-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: #2a2a2a;
  border-color: #444;
}

.delete-btn:hover {
  background: #6a2a2a;
  border-color: #8a4a4a;
  color: #ff6666;
}

.empty-state {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: italic;
}

.settings-container {
  /* Container für dynamische Settings */
}
