/* Modern Dark Creative Studio Design System */
:root {
  --bg-darkest: #0e1013;
  --bg-darker: #14171b;
  --bg-dark: #1a1e24;
  --bg-surface: #22262d;
  --bg-hover: #2b313a;
  --bg-active: #343b46;
  
  --border-subtle: #272d36;
  --border-muted: #343c49;
  --border-focus: #3b82f6;

  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-active: #1d4ed8;
  --accent-glow: rgba(59, 130, 246, 0.25);

  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --text-inverted: #0e1013;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fira Code", "Cascadia Code", Consolas, Menlo, monospace;

  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px 0 rgba(0, 0, 0, 0.7);

  --header-height: 48px;
  --toolbar-width: 52px;
  --inspector-width: 320px;
  --timeline-height: 280px;
  --ruler-thickness: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-family);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-main);
  background-color: var(--bg-darkest);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  user-select: auto;
  -webkit-user-select: auto;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

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

.icon-only {
  padding: 6px !important;
}

/* Badges */
.badge-version {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

.save-status {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}
.save-status.saved {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
}
.save-status.unsaved {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
}

.badge-layer-type {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

/* Common Form Controls */
.input-styled, .scrub-input, .select-styled, .textarea-styled {
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 5px 8px;
  font-size: 12px;
  width: 100%;
  transition: border-color 0.15s ease;
}

.input-styled:focus, .scrub-input:focus, .select-styled:focus, .textarea-styled:focus {
  border-color: var(--border-focus);
}

.scrub-input {
  text-align: right;
  font-family: var(--font-mono);
}

.select-styled {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 12px;
  padding-right: 22px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-main);
}
.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}
.color-picker-wrap input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: transparent;
}
.color-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker-wrap input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
}
.hex-text-input {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 70px;
}

/* Button Styles */
.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-primary:active {
  background: var(--accent-active);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-muted);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

.btn-sm {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.btn-sm.primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
.btn-sm:hover {
  background: var(--bg-hover);
}

.btn-icon-xs {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}
.btn-icon-xs:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
