/* ============================================
   TOOLSSIFY  -  Design System
   Core design tokens, typography, colors, 
   spacing, shadows, and base styles.
   Apple / Linear / Stripe inspired white theme.
   ============================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* ---- Colors ---- */
  /* Neutrals (gray scale) */
  --color-white:      #ffffff;
  --color-gray-25:    #fcfcfd;
  --color-gray-50:    #f9fafb;
  --color-gray-100:   #f2f4f7;
  --color-gray-200:   #eaecf0;
  --color-gray-300:   #d0d5dd;
  --color-gray-400:   #98a2b3;
  --color-gray-500:   #667085;
  --color-gray-600:   #475467;
  --color-gray-700:   #344054;
  --color-gray-800:   #1d2939;
  --color-gray-900:   #101828;
  --color-gray-950:   #0c111d;
  --color-black:      #000000;

  /* Primary accent: Toolssify blue (#0080ff) */
  --color-primary-50:  #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-500: #0080ff;
  --color-primary-600: #0080ff;
  --color-primary-700: #0066cc;
  --color-primary-800: #0052a3;
  --color-primary-900: #003d7a;

  /* Semantic colors */
  --color-success-50:  #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-500: #10b981;
  --color-success-600: #059669;
  --color-success-700: #047857;

  --color-warning-50:  #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;

  --color-error-50:    #fef2f2;
  --color-error-100:   #fee2e2;
  --color-error-500:   #ef4444;
  --color-error-600:   #dc2626;

  --color-info-50:     #eff6ff;
  --color-info-100:    #dbeafe;
  --color-info-500:    #3b82f6;

  /* ---- Backgrounds ---- */
  --bg-primary:      var(--color-white);
  --bg-secondary:    var(--color-gray-50);
  --bg-tertiary:     var(--color-gray-100);
  --bg-inverse:      var(--color-gray-900);

  /* ---- Text ---- */
  --text-primary:    var(--color-gray-900);
  --text-secondary:  var(--color-gray-600);
  --text-tertiary:   var(--color-gray-500);
  --text-quaternary: var(--color-gray-400);
  --text-inverse:    var(--color-white);
  --text-brand:      var(--color-primary-600);

  /* ---- Borders ---- */
  --border-primary:   var(--color-gray-200);
  --border-secondary: var(--color-gray-300);
  --border-focus:     var(--color-primary-500);

  /* ---- Typography ---- */
  --font-family:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:      'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  /* Font sizes */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */

  /* Font weights */
  --font-light:     300;
  --font-regular:   400;
  --font-medium:    500;
  --font-semibold:  600;
  --font-bold:      700;
  --font-extrabold: 800;

  /* Line heights */
  --leading-none:    1;
  --leading-tight:   1.25;
  --leading-snug:    1.375;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;

  /* Letter spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight:   -0.025em;
  --tracking-normal:  0em;
  --tracking-wide:    0.025em;

  /* ---- Spacing ---- */
  --space-0:   0;
  --space-1:   0.25rem;   /* 4px */
  --space-2:   0.5rem;    /* 8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */
  --space-32:  8rem;      /* 128px */

  /* ---- Shadows ---- */
  --shadow-xs:  0 1px 2px 0 rgba(16, 24, 40, 0.05);
  --shadow-sm:  0 1px 3px 0 rgba(16, 24, 40, 0.06), 0 1px 2px -1px rgba(16, 24, 40, 0.06);
  --shadow-md:  0 4px 8px -2px rgba(16, 24, 40, 0.06), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg:  0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --shadow-xl:  0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);
  --shadow-2xl: 0 24px 48px -12px rgba(16, 24, 40, 0.12);
  --shadow-3xl: 0 32px 64px -12px rgba(16, 24, 40, 0.14);

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

  /* ---- 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-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- Z-Index Scale ---- */
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-fixed:     300;
  --z-overlay:   400;
  --z-modal:     500;
  --z-popover:   600;
  --z-tooltip:   700;
  --z-toast:     800;

  /* ---- Layout ---- */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1200px;
  --container-2xl: 1400px;
  --header-height: 72px;
}


/* ============================================
   Base Reset & Global Styles
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ---- Typography ---- */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
}

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

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

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

a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  flex-shrink: 0;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

::selection {
  background: var(--color-primary-100);
  color: var(--color-primary-900);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-50);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* ---- Screen Reader Only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---- Text utilities ---- */
.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-lg      { font-size: var(--text-lg); }
.text-xl      { font-size: var(--text-xl); }
.text-2xl     { font-size: var(--text-2xl); }
.text-3xl     { font-size: var(--text-3xl); }
.text-4xl     { font-size: var(--text-4xl); }
.text-5xl     { font-size: var(--text-5xl); }

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

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

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

/* Responsive typography for mobile */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}
