/* =================================
   SYNTHASIS — UNIFIED DESIGN SYSTEM
   ================================= */

/* 1. CSS Reset & Root Variables */
:root {
  /* Brand Colors */
  --brand-primary: #3a469c;           /* Indigo 700 */
  --brand-primary-hover: #726cc3;     /* Indigo 800 */
  --brand-primary-light: #1f1f43;     /* Indigo 500 */
  --brand-accent: #304bae;            /* Sky 500 */
  --brand-accent-hover: #0284c7;      /* Sky 600 */
  --brand-accent-light: #38bdf8;      /* Sky 400 */

  /* Status Colors */
  --success: #16a34a;                 /* Green 600 */
  --success-light: #4ade80;           /* Green 400 */
  --success-bg: #f0fdf4;              /* Green 50 */
  --warning: #f59e0b;                 /* Amber 500 */
  --warning-light: #fbbf24;           /* Amber 400 */
  --warning-bg: #fffbeb;              /* Amber 50 */
  --danger: #8e1739;                  /* Red 600 */
  --danger-hover: #842757;            /* Red 700 */
  --danger-light: #f87171;            /* Red 400 */
  --danger-bg: #fef2f2;               /* Red 50 */
  --info: #0ea5e9;                    /* Sky 500 */
  --info-light: #38bdf8;              /* Sky 400 */
  --info-bg: #f0f9ff;                 /* Sky 50 */

  /* Background Colors */
  --bg-primary: #f9fafb;              /* Gray 50 */
  --bg-secondary: #f3f4f6;            /* Gray 100 */
  --bg-tertiary: #e5e7eb;             /* Gray 200 */
  --surface-primary: #feffff;
  --surface-secondary: #f5ffff;
  --surface-hover: #f8f9fa;

  /* Text Colors */
  --text-primary: #364462;            /* Gray 900 */
  --text-secondary: #313e52;          /* Gray 600 */
  --text-tertiary: #6b7280;           /* Gray 500 */
  --text-subtle: #9ca3af;             /* Gray 400 */
  --text-on-brand: #ffffff;

  /* Border Colors */
  --border-primary: #e5e7eb;          /* Gray 200 */
  --border-secondary: #d1d5db;        /* Gray 300 */
  --border-focus: var(--brand-primary);
  --border-hover: var(--brand-accent-light);

  /* Spacing Scale */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 0.75rem;    /* 12px */
  --space-lg: 1rem;       /* 16px */
  --space-xl: 1.3rem;     /* 24px */
  --space-2xl: 2rem;      /* 32px */
  --space-3xl: 3rem;      /* 48px */
  --space-4xl: 4rem;      /* 64px */

  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --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-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-brand: 0 4px 14px 0 rgba(67, 56, 202, 0.25);
  --shadow-accent: 0 4px 14px 0 rgba(14, 165, 233, 0.25);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;

  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.1rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.1rem;      /* 24px */
  --font-size-3xl: 1.2rem;    /* 30px */
  --font-size-4xl: 1.3rem;     /* 36px */
  --font-size-5xl: 2rem;        /* 48px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* Layout */
  --panel-width-collapsed: 72px;
  --panel-width-open: 260px;
  --control-panel-width: 280px;
  --max-content-width: 1200px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 3. Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin: 0;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin: 0;
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-primary-hover);
}

/* 4. Utility Classes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-subtle { color: var(--text-subtle); }

/* 5. Responsive Breakpoints */
@media (max-width: 1536px) { /* 2xl */ }
@media (max-width: 1280px) { /* xl */ }
@media (max-width: 1024px) { /* lg */ }
@media (max-width: 768px) { /* md */ }
@media (max-width: 640px) { /* sm */ }
@media (max-width: 480px) { /* xs */ }

/* 6. Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 7. Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --surface-primary: #1e293b;
    --surface-secondary: #293548;
    --surface-hover: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-subtle: #64748b;

    --border-primary: #334155;
    --border-secondary: #475569;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  }
}