/**
 * CC Frontend — Design Tokens
 * CSS custom properties for dark/light mode theming.
 * Light mode is the default (:root), dark mode via [data-theme="dark"].
 */

/* ============================================================
   LIGHT MODE (default)
   ============================================================ */
:root {
  /* --- Colors: Backgrounds --- */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-elevated: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* --- Colors: Surfaces --- */
  --surface-default: #ffffff;
  --surface-raised: #f9fafb;
  --surface-sunken: #f3f4f6;
  --surface-hover: #e5e7eb;
  --surface-active: #d1d5db;

  /* --- Colors: Text --- */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #6b7280;
  --text-disabled: #9ca3af;
  --text-inverse: #ffffff;
  --text-link: #2563eb;
  --text-link-hover: #1d4ed8;

  /* --- Colors: Borders --- */
  --border-default: #e5e7eb;
  --border-strong: #d1d5db;
  --border-subtle: #f3f4f6;
  --border-focus: #2563eb;

  /* --- Colors: Accent --- */
  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-primary-active: #1e40af;
  --accent-primary-subtle: #eff6ff;
  --accent-secondary: #7c3aed;
  --accent-secondary-hover: #6d28d9;

  /* --- Colors: Status --- */
  --status-success: #059669;
  --status-success-bg: #ecfdf5;
  --status-success-border: #a7f3d0;
  --status-warning: #d97706;
  --status-warning-bg: #fffbeb;
  --status-warning-border: #fde68a;
  --status-error: #dc2626;
  --status-error-bg: #fef2f2;
  --status-error-border: #fecaca;
  --status-info: #2563eb;
  --status-info-bg: #eff6ff;
  --status-info-border: #bfdbfe;

  /* --- Colors: Control Plane Indicators --- */
  --plane-system: #dc2626;
  --plane-management: #7c3aed;
  --plane-user: #059669;

  /* --- Spacing Scale --- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* --- Typography: Font Family --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* --- Typography: Font Sizes --- */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* --- Typography: Line Heights --- */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* --- Typography: Font Weights --- */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* --- Border Radius --- */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

  /* --- Transitions --- */
  --duration-fast: 100ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;
  --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-in: cubic-bezier(0.4, 0, 1, 1);
  --easing-out: cubic-bezier(0, 0, 0.2, 1);

  /* --- Z-Index Scale --- */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* --- Layout --- */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --header-height: 56px;
  --content-max-width: 1280px;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme='dark'] {
  /* --- Colors: Backgrounds --- */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-elevated: #1e293b;
  --bg-overlay: rgba(0, 0, 0, 0.7);

  /* --- Colors: Surfaces --- */
  --surface-default: #1e293b;
  --surface-raised: #334155;
  --surface-sunken: #0f172a;
  --surface-hover: #475569;
  --surface-active: #64748b;

  /* --- Colors: Text --- */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-disabled: #64748b;
  --text-inverse: #0f172a;
  --text-link: #60a5fa;
  --text-link-hover: #93c5fd;

  /* --- Colors: Borders --- */
  --border-default: #334155;
  --border-strong: #475569;
  --border-subtle: #1e293b;
  --border-focus: #60a5fa;

  /* --- Colors: Accent --- */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-primary-active: #2563eb;
  --accent-primary-subtle: #1e3a5f;
  --accent-secondary: #a78bfa;
  --accent-secondary-hover: #c4b5fd;

  /* --- Colors: Status --- */
  --status-success: #34d399;
  --status-success-bg: #064e3b;
  --status-success-border: #065f46;
  --status-warning: #fbbf24;
  --status-warning-bg: #78350f;
  --status-warning-border: #92400e;
  --status-error: #f87171;
  --status-error-bg: #7f1d1d;
  --status-error-border: #991b1b;
  --status-info: #60a5fa;
  --status-info-bg: #1e3a5f;
  --status-info-border: #1e40af;

  /* --- Colors: Control Plane Indicators --- */
  --plane-system: #f87171;
  --plane-management: #a78bfa;
  --plane-user: #34d399;

  /* --- Shadows (adjusted for dark backgrounds) --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
