/* ═══════════════════════════════════════════════════════════════
   AIMLSE Unified Design System
   Single source of truth for colors, typography, spacing
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── PALETTE ────────────────────────────────────────────────── */

  /* Backgrounds */
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-secondary: #1a1a1a;
  --surface-tertiary: #242424;

  /* Borders */
  --border: #2a2a2a;
  --border-secondary: #3a3a3a;

  /* Text */
  --text: #ffffff;
  --text-bright: #f5f5f5;
  --text-dim: #aaaaaa;
  --text-muted: #666666;

  /* Primary Accent (PyTorch Brand) */
  --accent-primary: #d4a017;
  --accent-primary-dark: #b8870a;
  --accent-primary-light: #f0c040;

  /* Semantic Colors */
  --accent-success: #22c55e;
  --accent-error: #ef4444;
  --accent-warning: #f59e0b;
  --accent-info: #5b7cf6;

  /* Optional Secondary Accents (use sparingly) */
  --accent-cyan: #38bdf8;
  --accent-purple: #7c6fff;

  /* ── TYPOGRAPHY ─────────────────────────────────────────────── */
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* ── SIZING & SPACING ───────────────────────────────────────── */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 4px;

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* ── TRANSITIONS ────────────────────────────────────────────── */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease-out;
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* ── SHADOWS ────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 2px 8px rgba(212, 160, 23, 0.15);
}

/* ── UTILITY CLASSES ────────────────────────────────────────────── */

/* Text utilities */
.text-primary { color: var(--text); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--accent-success); }
.text-error { color: var(--accent-error); }

/* Display vs UI font */
.font-display { font-family: var(--font-display); }
.font-ui { font-family: var(--font-ui); }
.font-mono { font-family: var(--font-mono); }

/* Spacing utilities */
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

.m-0 { margin: 0; }
.mb-md { margin-bottom: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

/* ── BUTTON STANDARDS ───────────────────────────────────────────── */

/* Primary Button */
.btn-primary {
  padding: 12px 32px;
  background: var(--accent-primary);
  color: #0a0a0a;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Secondary Button */
.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  background: rgba(212, 160, 23, 0.05);
}

.btn-secondary:active {
  background: rgba(212, 160, 23, 0.1);
}

/* Small Button */
.btn-small {
  padding: 6px 12px;
  background: var(--accent-primary);
  color: #0a0a0a;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-small:hover:not(:disabled) {
  background: var(--accent-primary-light);
  transform: translateY(-1px);
}

.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Ghost Button (for secondary actions) */
.btn-ghost {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-ghost:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(212, 160, 23, 0.05);
}

/* ── INPUT STANDARDS ────────────────────────────────────────────── */

input,
textarea,
select {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* ── FORM ELEMENTS ──────────────────────────────────────────────── */

label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  display: block;
  margin-bottom: var(--spacing-sm);
}

/* ── LOADING SPINNER ────────────────────────────────────────────── */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(212, 160, 23, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: var(--spacing-sm);
}

/* ── FOCUS VISIBLE (Accessibility) ──────────────────────────────── */

*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ── SCROLLBAR STYLING ──────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}
