/**
 * Chat Design Tokens
 * Centralized CSS Custom Properties for the chat interface
 * 
 * Usage: Import this file before any component CSS files
 */

:root {
  /* ============================================
     COLORS - Brand
     ============================================ */
  --chat-brand-primary: #6c43e0;
  --chat-brand-primary-hover: #5d3ac7;
  --chat-brand-primary-light: #7c5ce3;
  --chat-brand-primary-lighter: #8b5cf6;
  --chat-brand-primary-alpha-10: rgba(108, 67, 224, 0.1);
  --chat-brand-primary-alpha-15: rgba(108, 67, 224, 0.15);
  --chat-brand-primary-alpha-20: rgba(108, 67, 224, 0.2);
  --chat-brand-primary-alpha-25: rgba(108, 67, 224, 0.25);
  --chat-brand-primary-alpha-35: rgba(108, 67, 224, 0.35);

  /* ============================================
     COLORS - Status
     ============================================ */
  --chat-status-success: #10b981;
  --chat-status-success-light: #34d399;
  --chat-status-success-dark: #059669;
  --chat-status-warning: #fbbf24;
  --chat-status-warning-bg: #fef3c7;
  --chat-status-warning-dark: #78350f;
  --chat-status-warning-darkest: #422006;
  --chat-status-error: #ef4444;
  --chat-status-error-bg: #fee2e2;
  --chat-status-error-light: #fecaca;
  --chat-status-error-dark: #991b1b;
  --chat-status-error-darker: #7f1d1d;
  --chat-status-error-darkest: #450a0a;

  /* ============================================
     COLORS - Neutral (Light Mode)
     ============================================ */
  --chat-bg-primary: #ffffff;
  --chat-bg-secondary: #f8fafc;
  --chat-bg-tertiary: #f8f9fc;
  --chat-bg-quaternary: #f1f5f9;
  --chat-bg-gradient-start: #fafbfc;
  --chat-bg-gradient-end: #f8f9fc;

  --chat-surface-primary: #ffffff;
  --chat-surface-secondary: #f8fafc;
  --chat-surface-tertiary: #f1f5f9;

  --chat-border-primary: #e5e7eb;
  --chat-border-secondary: #d1d5db;
  --chat-border-alpha: rgba(2, 6, 23, 0.06);

  --chat-text-primary: #0f172a;
  --chat-text-secondary: #64748b;
  --chat-text-tertiary: #94a3b8;
  --chat-text-quaternary: #cbd5e1;

  --chat-subtle: #9ca3af;
  --chat-muted: #6b7280;

  /* ============================================
     COLORS - Dark Mode
     ============================================ */
  --chat-dark-bg-primary: #0f172a;
  --chat-dark-bg-secondary: #1a1d2e;
  --chat-dark-bg-tertiary: #0b0f1a;
  --chat-dark-bg-gradient-start: #0f172a;
  --chat-dark-bg-gradient-end: #1a1d2e;

  --chat-dark-surface-primary: #1a1d29;
  --chat-dark-surface-secondary: #1e293b;
  --chat-dark-surface-tertiary: #242938;
  --chat-dark-surface-light: #0f172a;

  --chat-dark-border-primary: #2d3748;
  --chat-dark-border-secondary: #3d4758;

  --chat-dark-text-primary: #e2e8f0;
  --chat-dark-text-secondary: #94a3b8;
  --chat-dark-text-tertiary: #64748b;
  --chat-dark-text-light: #e6e9f2;

  /* ============================================
     SPACING
     ============================================ */
  --chat-space-xs: 0.25rem; /* 4px */
  --chat-space-sm: 0.5rem; /* 8px */
  --chat-space-md: 0.75rem; /* 12px */
  --chat-space-lg: 1rem; /* 16px */
  --chat-space-xl: 1.25rem; /* 20px */
  --chat-space-2xl: 1.5rem; /* 24px */
  --chat-space-3xl: 2rem; /* 32px */
  --chat-space-4xl: 3rem; /* 48px */

  /* ============================================
     BORDER RADIUS
     ============================================ */
  --chat-radius-sm: 4px;
  --chat-radius-md: 8px;
  --chat-radius-lg: 12px;
  --chat-radius-xl: 14px;
  --chat-radius-2xl: 16px;
  --chat-radius-round: 50%;

  /* ============================================
     SHADOWS
     ============================================ */
  --chat-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05);
  --chat-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);
  --chat-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --chat-shadow-lg: 0 4px 14px rgba(2, 6, 23, 0.06);
  --chat-shadow-xl: 0 6px 18px rgba(108, 67, 224, 0.25);
  --chat-shadow-2xl: 0 -4px 20px rgba(0, 0, 0, 0.08);

  --chat-shadow-avatar: 0 2px 6px rgba(0, 0, 0, 0.12);
  --chat-shadow-avatar-lg: 0 2px 8px rgba(0, 0, 0, 0.12);
  --chat-shadow-message: 0 4px 14px rgba(2, 6, 23, 0.06);
  --chat-shadow-message-user: 0 4px 14px rgba(108, 67, 224, 0.25);
  --chat-shadow-button: 0 4px 12px rgba(108, 67, 224, 0.25);
  --chat-shadow-button-hover: 0 6px 16px rgba(108, 67, 224, 0.35);

  /* Dark mode shadows */
  --chat-dark-shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
  --chat-dark-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --chat-dark-shadow-md: 0 4px 12px rgba(108, 67, 224, 0.3);
  --chat-dark-shadow-overlay: 2px 0 15px rgba(0, 0, 0, 0.5);

  /* ============================================
     TRANSITIONS
     ============================================ */
  --chat-transition-fast: 0.15s ease;
  --chat-transition-base: 0.2s ease;
  --chat-transition-slow: 0.3s ease;
  --chat-transition-slower: 0.4s ease;

  --chat-transition-transform: transform 0.2s ease, box-shadow 0.2s ease;
  --chat-transition-colors: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease;
  --chat-transition-all: all 0.2s ease;

  /* ============================================
     TYPOGRAPHY
     ============================================ */
  --chat-font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --chat-font-family-mono: "Courier New", Consolas, Monaco, monospace;

  --chat-font-size-xs: 0.75rem; /* 12px */
  --chat-font-size-sm: 0.8125rem; /* 13px */
  --chat-font-size-base: 0.875rem; /* 14px */
  --chat-font-size-md: 0.875rem; /* 14px */
  --chat-font-size-lg: 0.9375rem; /* 15px */
  --chat-font-size-xl: 1rem; /* 16px */

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

  --chat-line-height-tight: 1.3;
  --chat-line-height-base: 1.6;
  --chat-line-height-relaxed: 1.8;

  /* ============================================
     LAYOUT DIMENSIONS
     ============================================ */
  --chat-layout-header-height: 82px;
  --chat-layout-footer-height: 110px;
  --chat-layout-sidebar-width: 280px;
  --chat-layout-sidebar-width-mobile: 260px;
  --chat-layout-content-max-width: 1100px;
  --chat-layout-message-max-width: 740px;

  /* ============================================
     Z-INDEX LAYERS
     ============================================ */
  --chat-z-base: 1;
  --chat-z-dropdown: 10;
  --chat-z-sticky: 20;
  --chat-z-fixed: 30;
  --chat-z-modal-backdrop: 40;
  --chat-z-modal: 50;
  --chat-z-sidebar: 100;
  --chat-z-header: 100;
  --chat-z-tooltip: 200;

  /* ============================================
     ANIMATIONS
     ============================================ */
  --chat-animation-fade-in: fadeIn 0.3s ease-in;
  --chat-animation-pulse: pulse 1.5s ease-in-out infinite;
  --chat-animation-shimmer: shimmer 2s infinite;
  --chat-animation-pulse-ring: pulseRing 2s infinite;
}

/* ============================================
   KEYFRAMES
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes pulseRing {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--chat-brand-primary-alpha-15);
  }
  50% {
    box-shadow: 0 0 0 6px var(--chat-brand-primary-alpha-25);
  }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet and below */
@media (max-width: 768px) {
  :root {
    --chat-layout-sidebar-width: var(--chat-layout-sidebar-width-mobile);
    --chat-space-3xl: 1.5rem;
    --chat-space-4xl: 2rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --chat-space-3xl: 1rem;
    --chat-space-4xl: 1.5rem;
  }
}
