/**
 * Design Tokens - Trantor Platform Design System
 *
 * Centralized CSS custom properties (variables) for consistent styling
 * across the entire application.
 *
 * This file must be loaded FIRST before any other CSS files to ensure
 * all design tokens are available globally.
 *
 * Usage: var(--token-name)
 * Example: color: var(--color-primary);
 */

:root {
  /* ========================================
     TYPOGRAPHY
     ======================================== */

  /* Font Families */
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: Monaco, Menlo, Consolas, "Courier New", monospace;

  /* Font Sizes - Modular Scale (1.125 ratio, base 16px) */
  --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 */

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

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

  /* ========================================
     COLORS
     ======================================== */

  /* Primary Brand Colors */
  --color-primary: #2196f3;           /* Main brand blue */
  --color-primary-dark: #1976d2;      /* Darker blue for hover states */
  --color-primary-light: #bbdefb;     /* Light blue for backgrounds */
  --color-primary-50: #e3f2fd;        /* Lightest blue */

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

  /* Semantic Colors - Success */
  --color-success: #10b981;           /* Green for success states */
  --color-success-light: #d1fae5;     /* Light green background */
  --color-success-dark: #059669;      /* Darker green */

  /* Semantic Colors - Warning */
  --color-warning: #ffc107;           /* Amber/yellow for warnings */
  --color-warning-light: #fff3cd;     /* Light yellow background */
  --color-warning-dark: #f59e0b;      /* Darker amber */

  /* Semantic Colors - Error/Danger */
  --color-error: #dc3545;             /* Red for errors */
  --color-error-light: #fef2f2;       /* Light red background */
  --color-error-dark: #dc2626;        /* Darker red */

  /* Semantic Colors - Info */
  --color-info: #3b82f6;              /* Blue for informational messages */
  --color-info-light: #eff6ff;        /* Light blue background */
  --color-info-dark: #2563eb;         /* Darker info blue */

  /* Chat-specific Accent Colors */
  --color-teal: #139ca7;              /* Teal accent for chat */
  --color-teal-light: #50aeb4;        /* Light teal */
  --color-teal-dark: #0e7a83;         /* Dark teal */
  --color-green-sage: #507a76;        /* Sage green for chat elements */
  --color-green-sage-light: #b7d4c2;  /* Light sage */
  --color-aqua: #00c6ff;              /* Aqua blue for chat accents */
  --color-bright-blue: #0a84ff;       /* Bright blue for chat UI */
  --color-bright-blue-hover: #0072ff; /* Darker bright blue */
  --color-lime: #1fd1a2;              /* Lime green accent */

  /* Additional Semantic Colors */
  --color-amber-dark: #92400e;        /* Dark amber for warnings */
  --color-sky-blue: #6fb7ff;          /* Sky blue for borders */

  /* Text Colors (mapped to grays for convenience) */
  --text-primary: var(--gray-900);    /* Primary text color */
  --text-secondary: var(--gray-600);  /* Secondary text color */
  --text-tertiary: var(--gray-500);   /* Tertiary/muted text */
  --text-disabled: var(--gray-400);   /* Disabled text */
  --text-on-primary: #ffffff;         /* Text on primary color backgrounds */

  /* Border Colors */
  --border-light: var(--gray-200);    /* Light borders */
  --border-medium: var(--gray-300);   /* Medium borders */
  --border-dark: var(--gray-400);     /* Dark borders */

  /* Background Colors */
  --bg-base: var(--gray-50);          /* Base page background */
  --bg-surface: #ffffff;              /* Surface/card background */
  --bg-elevated: #ffffff;             /* Elevated elements (modals, dropdowns) */
  --bg-hover: var(--gray-100);        /* Hover state background */
  --bg-active: var(--gray-200);       /* Active state background */

  /* Transparent Background Colors (for overlays and hover states) */
  --bg-warning-alpha: rgba(255, 193, 7, 0.1);   /* Warning background with opacity */
  --bg-primary-alpha: rgba(33, 150, 243, 0.1);  /* Primary background with opacity */

  /* ========================================
     SPACING (8pt Grid System)
     ======================================== */

  --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-7: 1.75rem;     /* 28px */
  --space-8: 2rem;        /* 32px */
  --space-9: 2.25rem;     /* 36px */
  --space-10: 2.5rem;     /* 40px */
  --space-11: 2.75rem;    /* 44px */
  --space-12: 3rem;       /* 48px */
  --space-14: 3.5rem;     /* 56px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */
  --space-32: 8rem;       /* 128px */

  /* ========================================
     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 (pills/circles) */

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

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --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);

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

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

  /* Transition Timing Functions */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

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

  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

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

  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;

  /* Breakpoints (for reference in media queries) */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-2xl: 1400px;

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

  /* Buttons */
  --btn-padding-y: var(--space-3);
  --btn-padding-x: var(--space-5);
  --btn-font-size: var(--text-base);
  --btn-font-weight: var(--font-semibold);
  --btn-border-radius: var(--radius-md);
  --btn-transition: var(--transition-base);

  /* Inputs */
  --input-padding-y: var(--space-3);
  --input-padding-x: var(--space-4);
  --input-font-size: var(--text-base);
  --input-border-width: 1px;
  --input-border-color: var(--gray-300);
  --input-border-radius: var(--radius-md);
  --input-focus-border-color: var(--color-primary);
  --input-focus-ring-width: 3px;
  --input-focus-ring-color: var(--color-primary-50);

  /* Cards */
  --card-padding: var(--space-6);
  --card-border-radius: var(--radius-lg);
  --card-border-width: 1px;
  --card-border-color: var(--gray-200);
  --card-shadow: var(--shadow-md);
  --card-bg: var(--bg-surface);

  /* Modals */
  --modal-backdrop-bg: rgba(0, 0, 0, 0.5);
  --modal-content-bg: var(--bg-elevated);
  --modal-border-radius: var(--radius-lg);
  --modal-shadow: var(--shadow-2xl);

  /* ========================================
     UTILITIES
     ======================================== */

  /* Focus Ring (for accessibility) */
  --focus-ring-width: 3px;
  --focus-ring-color: var(--color-primary-50);
  --focus-ring-offset: 2px;

  /* Disabled State */
  --disabled-opacity: 0.5;
  --disabled-cursor: not-allowed;
}

/**
 * Dark Mode Support (Optional - Prepared for future implementation)
 *
 * Uncomment and customize when implementing dark mode:
 *
 * @media (prefers-color-scheme: dark) {
 *   :root {
 *     --gray-50: #111827;
 *     --gray-900: #f9fafb;
 *     --bg-base: #0f172a;
 *     --bg-surface: #1e293b;
 *     --text-primary: #f9fafb;
 *     --text-secondary: #cbd5e1;
 *   }
 * }
 */
