/* ==========================================================================
   main.css — Design tokens, reset and shared/reusable component styles.
   Every other stylesheet consumes the custom properties defined here.
   ========================================================================== */

:root {
  /* ---- Surfaces --------------------------------------------------- */
  --bg-void: #0b0c10;        /* behind everything, outside the shell */
  --bg-app: #101217;         /* app shell background */
  --bg-surface: #171a21;     /* panels: sidebar, properties, timeline */
  --bg-elevated: #1e222b;    /* toolbar, cards, track rows */
  --bg-elevated-2: #262b36;  /* hovered/active rows, inputs */
  --bg-hover: #2c313d;

  /* ---- Borders ------------------------------------------------------ */
  --border-subtle: #262a33;
  --border-strong: #3a3f4b;

  /* ---- Text ----------------------------------------------------------- */
  --text-primary: #eef0f4;
  --text-secondary: #9aa0ad;
  --text-tertiary: #5c6270;
  --text-on-accent: #ffffff;

  /* ---- Accents (brand + track colour language) ------------------------ */
  --accent-primary: #7c5cff;       /* primary creative accent — violet */
  --accent-primary-hover: #9179ff;
  --accent-primary-soft: rgba(124, 92, 255, 0.16);
  --accent-pink: #ff4d8d;          /* record / audio accent */
  --accent-success: #35d68f;       /* saved / confirm */
  --accent-warning: #ffb547;       /* text / caution */

  --track-video: #5b8cff;
  --track-image: #35d68f;
  --track-text: #ffb547;
  --track-audio: #ff4d8d;

  /* ---- Radii & shadow --------------------------------------------------- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-inset: inset 0 0 0 1px var(--border-subtle);

  /* ---- Typography ------------------------------------------------------- */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ---- Layout metrics (overridden inline by JS where resizable) ------- */
  --toolbar-h: 56px;
  --rail-w: 64px;
}

/* ---- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* the editor shell owns its own scroll regions */
}

h1, h2, h3, p {
  margin: 0;
}

button, input {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

svg {
  display: block;
  flex-shrink: 0;
}

::selection {
  background: var(--accent-primary-soft);
}

/* Slim, unobtrusive scrollbars for panel content */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-sm);
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* ---- Shared: dividers ------------------------------------------------------ */
.divider--vertical {
  width: 1px;
  align-self: stretch;
  background: var(--border-subtle);
  margin: 0 4px;
}

/* ---- Shared: buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: var(--shadow-inset);
}
.btn--ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn--small {
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
}

.btn:disabled {
  opacity: 0.45;
}

/* ---- Shared: icon buttons --------------------------------------------------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.icon-btn:disabled {
  opacity: 0.35;
}
.icon-btn--lg {
  width: 38px;
  height: 38px;
}
.icon-btn--play {
  color: var(--text-primary);
}

/* ---- Shared: empty states ---------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 40px 20px;
  color: var(--text-tertiary);
  margin: auto;
}
.empty-state__icon {
  color: var(--text-tertiary);
  margin-bottom: 6px;
  opacity: 0.8;
}
.empty-state p {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
}
.empty-state span {
  font-size: 11.5px;
  max-width: 220px;
  line-height: 1.5;
}

/* ---- Shared: panel header ----------------------------------------------------- */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  flex-shrink: 0;
}
.panel-header h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

/* ---- Shared: range inputs -------------------------------------------------------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border-strong);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  transition: transform 0.15s ease;
}
input[type="range"]:disabled::-webkit-slider-thumb {
  background: var(--text-tertiary);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
