:root {
  --bg: #0f0f12;
  --panel: #1a1a1f;
  --accent: #00d4ff;
  --accent2: #ff2e63;
  --text: #e0e0e0;
  --border: #2a2a32;
  --track: #1e1e24;
  --clip: #3a3a48;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 52px;
  flex-shrink: 0;
}

header h1 {
  font-size: 1.25rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  margin-right: 0.5rem;
}

button, select {
  background: #2a2a32;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
}
button:hover { background: #3a3a45; }
button.primary { background: var(--accent); color: #000; font-weight: 600; }
button.danger { background: var(--accent2); }

.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar.left { border-right: 1px solid var(--border); }
.sidebar.right { border-left: 1px solid var(--border); width: 300px; }

.preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  min-width: 0;
}

#previewCanvas {
  flex: 1;
  width: 100%;
  background: #111;
  object-fit: contain;
}

.timeline-area {
  height: 260px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.timeline-header {
  padding: 0.3rem 0.6rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  height: 36px;
}

#timeline {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--track);
}

.track {
  height: 56px;
  border-bottom: 1px solid #2a2a32;
  position: relative;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 39px, #252530 40px);
}

.clip {
  position: absolute;
  height: 46px;
  top: 5px;
  background: var(--clip);
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: move;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  user-select: none;
}
.clip:hover { border-color: #66e0ff; }
.clip.selected { outline: 2px solid var(--accent2); z-index: 2; }

.clip-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 6px;
  background: rgba(0,212,255,0.4);
  cursor: ew-resize;
}
.clip-handle.left { left: 0; }
.clip-handle.right { right: 0; }

.media-item, .generator-item {
  background: #252530;
  margin: 4px 0;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: grab;
  font-size: 0.8rem;
  border-left: 3px solid var(--accent);
}
.media-item:hover { background: #2f2f3a; }

.effect-config {
  background: #222228;
  padding: 6px;
  margin: 4px 0;
  border-radius: 4px;
  border: 1px solid #333;
}
.effect-config label { font-size: 0.75rem; display: block; margin-top: 4px; }
.effect-config input, .effect-config select { width: 100%; margin-top: 2px; }

#playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ff2e63;
  z-index: 20;
  pointer-events: none;
}

.status {
  padding: 0.25rem 0.6rem;
  background: #111;
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  height: 24px;
}

.lang-switch { margin-left: auto; }
