/* DM_EDITOR — style.css */

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #1a1a1a;
}

body {
  font-family: 'Tahoma', 'Verdana', monospace;
  font-size: 12px;
  color: #c8c8c8;
}

/* ── Root layout ─────────────────────────────── */
.dm-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #2a2a2a;
  border: 2px inset #555;
}

/* ── Menu bar ────────────────────────────────── */
.dm-menubar {
  background: #3c3c3c;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: stretch;
  height: 22px;
  flex-shrink: 0;
}

.dm-menu-item {
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  color: #d0d0d0;
  user-select: none;
}

.dm-menu-item:hover {
  background: #5a7fc4;
  color: #fff;
}

/* ── Toolbar ─────────────────────────────────── */
.dm-toolbar {
  background: #3a3a3a;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  padding: 3px 4px;
  gap: 2px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.dm-btn {
  background: linear-gradient(to bottom, #555, #3d3d3d);
  border: 1px solid #1a1a1a;
  border-top-color: #666;
  color: #d0d0d0;
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: 'Tahoma', monospace;
  min-width: 28px;
  text-align: center;
}

.dm-btn:hover {
  background: linear-gradient(to bottom, #6a8fd4, #4a6cb8);
  border-color: #3a5aa0;
  color: #fff;
}

.dm-btn:active,
.dm-btn.active {
  background: linear-gradient(to bottom, #3d3d3d, #555);
  border-top-color: #1a1a1a;
  border-bottom-color: #666;
}

.dm-btn.record  { color: #e08050; }
.dm-btn.export  { color: #7ab87a; }

.dm-sep  { width: 1px; background: #1a1a1a; margin: 2px 3px; height: 18px; flex-shrink: 0; }
.dm-sep2 { width: 1px; background: #666;    margin: 2px 0;   height: 18px; flex-shrink: 0; }

/* ── Main three-column area ──────────────────── */
.dm-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar (left) ──────────────────────────── */
.dm-sidebar {
  width: 160px;
  background: #2e2e2e;
  border-right: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.dm-sidebar-header {
  background: #3c3c3c;
  padding: 3px 6px;
  font-size: 10px;
  color: #aaa;
  border-bottom: 1px solid #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.dm-tree-item {
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #c0c0c0;
  user-select: none;
}

.dm-tree-item:hover    { background: #3d5a8a; color: #fff; }
.dm-tree-item.selected { background: #4a6cb8; color: #fff; }
.dm-tree-item.indent1  { padding-left: 18px; }
.dm-tree-item.indent2  { padding-left: 28px; }
.dm-tree-item.dm-trigger { color: #7a9a7a; }

.dm-tree-arrow { font-size: 8px; color: #888; }

.layer-geo { color: #7a9a7a; }
.layer-act { color: #7a7ab8; }
.layer-dm  { color: #a07a50; }

/* ── Viewport (center) ───────────────────────── */
.dm-viewport {
  flex: 1;
  background: #1e1e1e;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dm-viewport-header {
  background: #3a3a3a;
  border-bottom: 1px solid #1a1a1a;
  padding: 2px 8px;
  font-size: 10px;
  color: #aaa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.live-indicator { color: #e05050; }

.dm-viewport-canvas {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dm-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#2a2a2a 1px, transparent 1px),
    linear-gradient(90deg, #2a2a2a 1px, transparent 1px);
  background-size: 32px 32px;
  background-color: #1e1e1e;
}

.dm-axis-h {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: #333;
}

.dm-axis-v {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: #333;
}

.dm-scene-svg {
  position: absolute;
  width: 260px;
  height: 160px;
  opacity: 0.55;
}

.dm-watermark {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 9px;
  color: #333;
  font-family: monospace;
  pointer-events: none;
  user-select: none;
}

/* ── Properties (right) ──────────────────────── */
.dm-properties {
  width: 170px;
  background: #2e2e2e;
  border-left: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.dm-prop-row {
  padding: 3px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #262626;
}

.dm-prop-label { color: #999; font-size: 10px; }
.dm-prop-val   { color: #c8d8ff; font-size: 10px; font-family: monospace; }
.dm-prop-val.green  { color: #7ab87a; }
.dm-prop-val.amber  { color: #a07a50; }
.dm-prop-val.orange { color: #e08050; }

/* ── Timeline ────────────────────────────────── */
.dm-timeline {
  height: 90px;
  background: #252525;
  border-top: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.dm-tl-header {
  background: #333;
  border-bottom: 1px solid #1a1a1a;
  padding: 2px 8px;
  font-size: 10px;
  color: #aaa;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.dm-tl-header .sep   { color: #888; }
.dm-tl-header .tl-val { color: #c8d8ff; }

.dm-tl-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.dm-tl-track {
  height: 24px;
  background: #2a2a2a;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  position: relative;
}

.track-label {
  position: absolute;
  left: 8px;
  font-size: 10px;
  color: #999;
  z-index: 1;
  pointer-events: none;
}

.dm-tl-bar {
  height: 14px;
  background: #4a6cb8;
  border-radius: 2px;
  position: absolute;
  top: 5px;
}

.dm-tl-bar.purple { background: #6a4a8a; }

.dm-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 130px;
  width: 1px;
  background: #e05050;
  z-index: 10;
}

/* ── Console ─────────────────────────────────── */
.dm-console {
  background: #0e0e0e;
  border-top: 1px solid #1a1a1a;
  height: 56px;
  overflow-y: auto;
  padding: 4px 8px;
  font-family: monospace;
  font-size: 10px;
  flex-shrink: 0;
}

.dm-console-line      { color: #7a9a7a; line-height: 1.6; }
.dm-console-line.warn { color: #aaa060; }
.dm-console-line.err  { color: #a06060; }

/* ── Status bar ──────────────────────────────── */
.dm-statusbar {
  background: #333;
  border-top: 1px solid #1a1a1a;
  padding: 2px 8px;
  font-size: 10px;
  color: #888;
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.dm-status-item { display: flex; gap: 4px; }
.ml-auto        { margin-left: auto; }
.sk             { color: #777; }
.sv             { color: #aaa; }
.sv.red         { color: #e05050; }

/* ── Animations ──────────────────────────────── */
.blink {
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}
