/* Design Token System for HANQ Chat App
   ========================================
   정밀한 채팅앱을 위한 디자인 토큰 시스템
*/

:root {
  /* 🎨 Color System - 일관된 브랜드 컬러 팔레트 */
  
  /* Primary Colors - 메인 브랜드 컬러 */
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;
  --color-primary-950: #1e1b4b;
  
  /* Secondary Colors - 보조 컬러 */
  --color-secondary-50: #f0fdfa;
  --color-secondary-100: #ccfbf1;
  --color-secondary-200: #99f6e4;
  --color-secondary-300: #5eead4;
  --color-secondary-400: #2dd4bf;
  --color-secondary-500: #14b8a6;
  --color-secondary-600: #0d9488;
  --color-secondary-700: #0f766e;
  --color-secondary-800: #115e59;
  --color-secondary-900: #134e4a;
  
  /* Accent Colors - 강조 컬러 */
  --color-accent-blue: #4cc9f0;
  --color-accent-purple: #7209b7;
  --color-accent-pink: #f72585;
  --color-accent-yellow: #ffd60a;
  
  /* Semantic Colors - 의미론적 컬러 */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Neutral Colors - 중립 컬러 */
  --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;
  --color-gray-950: #030712;
  
  /* 📐 Spacing System - 일관된 여백 시스템 */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */
  
  /* 📝 Typography System - 타이포그래피 시스템 */
  --font-family-primary: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'D2Coding', monospace;
  
  /* Font Sizes */
  --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-size-4xl: 2.25rem;   /* 36px */
  
  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* 🔄 Animation System - 애니메이션 시스템 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* 🎭 Shadow System - 그림자 시스템 */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  
  /* Brand Shadow - 브랜드 컬러 그림자 */
  --shadow-primary: 0 10px 25px -5px rgba(99, 102, 241, 0.25);
  --shadow-secondary: 0 10px 25px -5px rgba(20, 184, 166, 0.25);
  
  /* 📱 Breakpoints - 반응형 브레이크포인트 */
  --breakpoint-xs: 475px;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* 🎯 Z-Index System - 레이어 시스템 */
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;
  --z-index-notification: 1080;
  
  /* 🔄 Border Radius - 모서리 둥글기 */
  --radius-sm: 0.25rem;     /* 4px */
  --radius-md: 0.375rem;    /* 6px */
  --radius-lg: 0.5rem;      /* 8px */
  --radius-xl: 0.75rem;     /* 12px */
  --radius-2xl: 1rem;       /* 16px */
  --radius-3xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;
  
  /* 📊 Gradients - 그라디언트 */
  --gradient-primary: linear-gradient(90deg, var(--color-primary-500) 0%, var(--color-accent-blue) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--color-secondary-400) 0%, var(--color-accent-blue) 100%);
  --gradient-warm: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-cool: linear-gradient(135deg, #667eea 0%, #64b5f6 100%);
  --gradient-dark: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  
  /* 💬 Chat Specific Tokens - 채팅 전용 토큰 */
  --chat-bubble-radius: 1.125rem;
  --chat-bubble-padding: 0.75rem 1rem;
  --chat-bubble-max-width: 70%;
  --chat-bubble-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --chat-sender-bg: var(--color-primary-500);
  --chat-sender-text: white;
  --chat-receiver-bg: var(--color-gray-100);
  --chat-receiver-text: var(--color-gray-900);
  --chat-timestamp-color: var(--color-gray-500);
  --chat-input-height: 3.5rem;
  --chat-sidebar-width: 280px;
  
  /* 🎮 Interactive States - 인터랙션 상태 */
  --state-hover-opacity: 0.8;
  --state-active-opacity: 0.6;
  --state-disabled-opacity: 0.5;
  --state-focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.2);
  --state-focus-ring-error: 0 0 0 3px rgba(239, 68, 68, 0.2);
  --state-focus-ring-success: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* 다크 모드 토큰 (준비) */
@media (prefers-color-scheme: dark) {
  :root {
    /* 다크 모드 색상 오버라이드 */
    --color-gray-50: #1f2937;
    --color-gray-100: #374151;
    --color-gray-900: #f9fafb;
    /* ... 추가 다크 모드 토큰 */
  }
}

/* 접근성 - 고대비 모드 */
@media (prefers-contrast: high) {
  :root {
    --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 0 0 2px rgba(0, 0, 0, 0.3);
    /* 더 강한 대비 설정 */
  }
}

/* 접근성 - 모션 감소 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
    --transition-spring: 0ms;
  }
}