/**
 * CSS Variables for AI Chat Application
 * Defines color schemes, spacing, typography, and other design tokens
 */

:root {
  /* Color Palette - Light Theme */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-dark: #1e40af;
  --color-primary-light: rgba(37, 99, 235, 0.1);
  --color-primary-rgb: 37, 99, 235;
  
  --color-secondary: #6b7280;
  --color-secondary-hover: #4b5563;
  
  --color-background: #ffffff;
  --color-background-secondary: #f9fafb;
  --color-background-tertiary: #f3f4f6;
  
  --color-surface: #ffffff;
  --color-surface-hover: #f9fafb;
  --color-surface-secondary: #f3f4f6;
  
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  --color-text-inverse: #ffffff;
  
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-border-focus: #2563eb;
  
  --color-error: #ef4444;
  --color-error-light: rgba(239, 68, 68, 0.1);
  --color-warning: #f59e0b;
  --color-warning-light: rgba(245, 158, 11, 0.1);
  --color-success: #10b981;
  --color-success-light: rgba(16, 185, 129, 0.1);
  --color-info: #3b82f6;
  --color-info-light: rgba(59, 130, 246, 0.1);
  
  /* Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-primary-hover: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
  --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  
  /* Contextual Colors */
  --color-creative: #7c3aed;
  --color-creative-light: rgba(124, 58, 237, 0.1);
  --color-technical: #2563eb;
  --color-technical-light: rgba(37, 99, 235, 0.1);
  --color-casual: #059669;
  --color-casual-light: rgba(5, 150, 105, 0.1);
  
  /* 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);
  --shadow-glow: 0 0 20px rgba(16, 163, 127, 0.3);
  
  /* Typography */
  --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
  
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing */
  --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 */
  
  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.125rem;   /* 2px */
  --radius-base: 0.25rem;  /* 4px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-lg: 0.5rem;     /* 8px */
  --radius-xl: 0.75rem;    /* 12px */
  --radius-2xl: 1rem;      /* 16px */
  --radius-full: 9999px;
  
  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
  --z-floating: 1090;
  
  /* Layout */
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 60px;
  --max-content-width: 768px;
  --header-height: 64px;
  --input-container-height: auto;
  --message-max-width: 85%;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Animation Durations */
  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;
  
  /* Animation Timing Functions */
  --ease-linear: linear;
  --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);
  
  /* Breakpoints (for reference in media queries) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* Message Styling */
  --message-padding: var(--spacing-4);
  --message-margin: var(--spacing-4);
  --message-border-radius: var(--radius-lg);
  --message-max-width: 100%;
  
  /* Code Block Styling */
  --code-background: #f6f8fa;
  --code-border: var(--color-border);
  --code-text: #24292e;
  --code-padding: var(--spacing-4);
  --code-border-radius: var(--radius-md);
  
  /* Loading Animation */
  --loading-dot-size: 8px;
  --loading-animation-duration: 1.4s;
  
  /* File Upload */
  --upload-border-color: var(--color-border);
  --upload-border-color-active: var(--color-primary);
  --upload-background-hover: var(--color-background-secondary);
  
  /* Scrollbar */
  --scrollbar-width: 6px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: var(--color-border);
  --scrollbar-thumb-hover: var(--color-text-tertiary);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --color-background: #111827;
  --color-background-secondary: #1f2937;
  --color-background-tertiary: #374151;
  
  --color-surface: #1f2937;
  --color-surface-hover: #374151;
  --color-surface-secondary: #4b5563;
  
  --color-text-primary: #f9fafb;
  --color-text-secondary: #d1d5db;
  --color-text-tertiary: #9ca3af;
  
  --color-border: #374151;
  --color-border-light: #4b5563;
  
  --code-background: #1f2937;
  --code-border: #374151;
  --code-text: #f9fafb;
  
  --scrollbar-thumb: #4b5563;
  --scrollbar-thumb-hover: #6b7280;
}

/* High Contrast Theme Variables */
[data-theme="high-contrast"] {
  --color-background: #000000;
  --color-background-secondary: #1a1a1a;
  --color-background-tertiary: #333333;
  
  --color-surface: #1a1a1a;
  --color-surface-hover: #333333;
  --color-surface-secondary: #4d4d4d;
  
  --color-text-primary: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-tertiary: #999999;
  
  --color-border: #666666;
  --color-border-light: #4d4d4d;
  
  --color-primary: #00ff00;
  --color-primary-hover: #00cc00;
}

/* RTL Support Variables */
[dir="rtl"] {
  --text-align-start: right;
  --text-align-end: left;
  --margin-start: margin-right;
  --margin-end: margin-left;
  --padding-start: padding-right;
  --padding-end: padding-left;
  --border-start: border-right;
  --border-end: border-left;
  --transform-rotate: rotate(-180deg);
}

[dir="ltr"] {
  --text-align-start: left;
  --text-align-end: right;
  --margin-start: margin-left;
  --margin-end: margin-right;
  --padding-start: padding-left;
  --padding-end: padding-right;
  --border-start: border-left;
  --border-end: border-right;
  --transform-rotate: rotate(0deg);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: none;
    --transition-normal: none;
    --transition-slow: none;
    --loading-animation-duration: 0s;
  }
}
