/* ══════════════════════════════════════
   MapMotion Studio — Design System
   ══════════════════════════════════════ */

:root {
  /* ── Color Palette ── */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a26;
  --bg-elevated: #1e1e2e;
  --bg-hover: #252536;
  --bg-active: #2a2a40;

  --border-subtle: #1e1e30;
  --border-default: #2a2a3e;
  --border-bright: #3a3a55;

  --text-primary: #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted: #55556a;
  --text-accent: #7c6af6;

  --accent-primary: #7c6af6;
  --accent-primary-hover: #8d7ef8;
  --accent-primary-glow: rgba(124, 106, 246, 0.25);
  --accent-secondary: #4ecdc4;
  --accent-warning: #f5a623;
  --accent-danger: #e74c3c;
  --accent-success: #4ecdc4;

  --keyframe-color: #f5a623;
  --keyframe-active: #ffcc00;
  --playhead-color: #e74c3c;

  /* ── Typography ── */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --fs-xs: 10px;
  --fs-sm: 11px;
  --fs-md: 12px;
  --fs-lg: 13px;
  --fs-xl: 14px;

  /* ── Spacing ── */
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 12px;
  --space-xl: 16px;
  --space-2xl: 24px;

  /* ── Layout ── */
  --titlebar-height: 36px;
  --toolbar-width: 44px;
  --panel-width: 260px;
  --timeline-height: 220px;
  --timeline-min-height: 150px;

  /* ── Effects ── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);

  --transition-fast: 120ms ease;
  --transition-default: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
  font-family: var(--font-main);
  font-size: var(--fs-md);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  display: flex;
  flex-direction: column;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

#app {
  flex: 1 1 0;
  display: flex;
  overflow: hidden;
  min-height: 0;
  max-height: calc(100vh - var(--titlebar-height) - var(--timeline-height));
}

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

/* ── Buttons ── */
button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  outline: none;
}

input, select {
  font-family: inherit;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

input[type="number"] {
  width: 70px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

select {
  cursor: pointer;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
