/* ============================================
   STOCS B2B - Design Tokens
   ============================================

   This file defines all design tokens (CSS variables)
   used throughout the application. Import this file
   before any other CSS files.

   Based on CSS Audit conducted 2026-02-01
   ============================================ */

:root {
  /* ===========================
     COLOR PALETTE
     =========================== */

  /* Brand Colors */
  --color-primary: #5B21B6;        /* Vivid Purple - primary brand */
  --color-primary-hover: #7c3aed;  /* Lighter purple for hover */
  --color-secondary: #0693e3;      /* Cyan Blue - secondary brand */
  --color-accent: #5B21B6;         /* Alias for primary */

  /* Base Colors */
  --color-black: #000000;
  --color-white: #ffffff;

  /* Gray Scale (Tailwind-inspired) */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Legacy aliases (for backward compatibility) */
  --color-dark-gray: #32373c;
  --color-cyan-blue: #0693e3;
  --color-vivid-purple: #5B21B6;
  --color-medium-gray: #6b7280;

  /* Semantic Colors - Success */
  --color-success: #10b981;
  --color-success-50: #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-200: #a7f3d0;
  --color-success-600: #059669;
  --color-success-700: #047857;
  --color-success-800: #065f46;
  --color-success-900: #064e3b;

  /* Semantic Colors - Danger/Error */
  --color-danger: #ef4444;
  --color-danger-50: #fef2f2;
  --color-danger-100: #fee2e2;
  --color-danger-200: #fecaca;
  --color-danger-600: #dc2626;
  --color-danger-700: #b91c1c;
  --color-danger-800: #991b1b;
  --color-danger-900: #7f1d1d;

  /* Semantic Colors - Warning */
  --color-warning: #f59e0b;
  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-200: #fde68a;
  --color-warning-600: #d97706;
  --color-warning-700: #b45309;
  --color-warning-800: #92400e;
  --color-warning-900: #78350f;

  /* Semantic Colors - Info */
  --color-info: #3b82f6;
  --color-info-50: #eff6ff;
  --color-info-100: #dbeafe;
  --color-info-200: #bfdbfe;
  --color-info-600: #2563eb;
  --color-info-700: #1d4ed8;
  --color-info-800: #1e40af;
  --color-info-900: #1e3a8a;

  /* Background Colors */
  --color-bg-primary: var(--color-white);
  --color-bg-secondary: var(--color-gray-50);
  --color-bg-tertiary: var(--color-gray-100);

  /* Border Colors */
  --color-border: var(--color-gray-200);
  --color-border-light: var(--color-gray-100);
  --color-border-dark: var(--color-gray-300);

  /* Text Colors */
  --color-text-primary: var(--color-gray-900);
  --color-text-secondary: var(--color-gray-600);
  --color-text-tertiary: var(--color-gray-500);
  --color-text-muted: var(--color-gray-400);
  --color-text-inverted: var(--color-white);

  /* ===========================
     SPACING SYSTEM
     Based on 4px base unit
     =========================== */

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

  /* Legacy spacing (for backward compatibility) */
  /* These use the original naming from stocs-styles.css */
  --spacing-10-legacy: 0.25rem;  /* 4px - renamed to avoid conflict */
  --spacing-20: 0.44rem;  /* ~7px */
  --spacing-30: 0.67rem;  /* ~11px */
  --spacing-40: 1rem;     /* 16px */
  --spacing-50: 1.5rem;   /* 24px */
  --spacing-60: 2.25rem;  /* 36px */
  --spacing-70: 3.38rem;  /* 54px */
  --spacing-80: 5.06rem;  /* 81px */

  /* Semantic Spacing */
  --space-xs: var(--spacing-1);   /* 4px */
  --space-sm: var(--spacing-2);   /* 8px */
  --space-md: var(--spacing-4);   /* 16px */
  --space-lg: var(--spacing-6);   /* 24px */
  --space-xl: var(--spacing-8);   /* 32px */
  --space-2xl: var(--spacing-12); /* 48px */
  --space-3xl: var(--spacing-16); /* 64px */

  /* Gap Values */
  --gap-flex: 0.5rem;     /* 8px - default flex gap */
  --gap-column: 2rem;     /* 32px - grid column gap */
  --gap-post: 1.25rem;    /* 20px - content spacing */

  /* ===========================
     TYPOGRAPHY
     =========================== */

  /* Font Families */
  --font-family-primary: 'Gilroy', 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-family-mono: 'Courier New', Consolas, 'Liberation Mono', monospace;

  /* Font Sizes */
  --font-size-xs: 0.6875rem;  /* 11px */
  --font-size-sm: 0.75rem;    /* 12px */
  --font-size-base: 0.875rem; /* 14px */
  --font-size-md: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 2rem;      /* 32px */
  --font-size-4xl: 2.25rem;   /* 36px */
  --font-size-5xl: 2.625rem;  /* 42px */
  --font-size-6xl: 3rem;      /* 48px */

  /* Legacy font sizes (for backward compatibility) */
  --font-size-small: 13px;
  --font-size-medium: 20px;
  --font-size-large: 36px;
  --font-size-xlarge: 42px;

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

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 1.75;

  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;

  /* ===========================
     BORDER RADIUS
     =========================== */

  --radius-none: 0;
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;   /* Fully rounded */

  /* Legacy radius (for backward compatibility) */
  --radius-medium: 8px;

  /* ===========================
     SHADOWS
     =========================== */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --shadow-none: none;

  /* Focus ring shadow */
  --shadow-focus: 0 0 0 3px rgba(91, 33, 182, 0.1);
  --shadow-focus-primary: 0 0 0 3px rgba(91, 33, 182, 0.1);
  --shadow-focus-cyan: 0 0 0 3px rgba(6, 147, 227, 0.1);

  /* ===========================
     TRANSITIONS
     =========================== */

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 500ms ease;

  /* ===========================
     Z-INDEX SCALE
     =========================== */

  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* ===========================
     LAYOUT
     =========================== */

  --container-max-width: 1200px;
  --container-padding: var(--spacing-50);

  /* Breakpoints (for reference - use in media queries) */
  /* --breakpoint-sm: 640px; */
  /* --breakpoint-md: 768px; */
  /* --breakpoint-lg: 1024px; */
  /* --breakpoint-xl: 1280px; */
  /* --breakpoint-2xl: 1536px; */

  /* ===========================
     COMPONENT-SPECIFIC TOKENS
     =========================== */

  /* Buttons */
  --btn-padding-y: calc(0.5em + 2px);
  --btn-padding-x: calc(1em + 2px);
  --btn-font-size: 1em;
  --btn-border-radius: var(--radius-full);

  /* Form Inputs */
  --input-padding-y: var(--spacing-30);
  --input-padding-x: var(--spacing-40);
  --input-font-size: var(--font-size-base);
  --input-border-color: var(--color-border);
  --input-border-radius: var(--radius-md);
  --input-focus-border-color: var(--color-primary);

  /* Cards */
  --card-padding: var(--spacing-40);
  --card-border-radius: var(--radius-md);
  --card-shadow: var(--shadow-md);

  /* Tables */
  --table-cell-padding: var(--spacing-30);
  --table-border-color: var(--color-border);
  --table-header-bg: var(--color-gray-50);
  --table-hover-bg: var(--color-gray-50);

  /* Alerts */
  --alert-padding: var(--spacing-40);
  --alert-border-radius: var(--radius-md);
  --alert-border-width: 4px;

  /* Badges */
  --badge-padding-y: 4px;
  --badge-padding-x: 12px;
  --badge-font-size: var(--font-size-sm);
  --badge-border-radius: var(--radius-full);
}

/* ============================================
   ADMIN-SPECIFIC OVERRIDES
   ============================================ */

.admin-layout {
  --color-bg-primary: var(--color-gray-50);
  --color-bg-secondary: var(--color-white);
  --input-font-size: 14px;
  --card-padding: var(--spacing-40);
}
