/**
 * CSS Custom Properties (Variables)
 * Global design system variables
 */

:root {
  /* Color System */
  --primary-color: #6a11cb;
  --secondary-color: #fc466b;
  --accent-color: #ffcc00;
  --dark-color: #2c2c54;
  --light-color: #ffffff;
  --text-color: #333333;
  --bg-color: #f8f9fa;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --info-color: #17a2b8;
  
  /* RGB Values for rgba() usage */
  --primary-rgb: 106, 17, 203;
  --secondary-rgb: 252, 70, 107;
  --accent-rgb: 255, 204, 0;
  --dark-rgb: 44, 44, 84;
  --light-rgb: 255, 255, 255;
  --text-rgb: 51, 51, 51;
  
  /* Extended Color Palette */
  --color-primary-300: #a855f7;
  --color-primary-400: #9333ea;
  --color-primary-500: #7c3aed;
  --color-primary-600: #6d28d9;
  --color-primary-500-rgb: 124, 58, 237;
  --color-primary-600-rgb: 109, 40, 217;
  
  /* Typography */
  --font-family-base: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-heading: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;
  
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Spacing System */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;
  
  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.125rem;
  --radius-base: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Border Radius Alias */
  --border-radius: var(--radius-md);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-base: 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);
  
  /* Transitions */
  --transition-speed: 0.3s;
  --transition-fast: 0.15s;
  --transition-slow: 0.5s;
  --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* 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;
  --z-toast: 1080;
  
  /* Breakpoints (for use in CSS) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* Border Widths */
  --border-width: 1px;
  --border-width-2: 2px;
  --border-width-4: 4px;
  --border-width-8: 8px;
  
  /* Grid */
  --grid-gap: var(--space-6);
  --grid-gap-sm: var(--space-4);
  --grid-gap-lg: var(--space-8);
  
  /* Forms */
  --input-height: 44px;
  --input-height-sm: 36px;
  --input-height-lg: 52px;
  --input-padding-x: var(--space-3);
  --input-padding-y: var(--space-2);
  --input-border-radius: var(--radius-md);
  --input-border-width: 1px;
  --input-border-color: #d1d5db;
  --input-focus-border-color: var(--primary-color);
  --input-focus-ring-color: rgb(var(--primary-rgb) / 0.2);
  
  /* Buttons */
  --button-height: 44px;
  --button-height-sm: 36px;
  --button-height-lg: 52px;
  --button-height-xl: 60px;
  --button-padding-x: var(--space-6);
  --button-padding-y: var(--space-3);
  --button-border-radius: var(--radius-md);
  --button-font-weight: var(--font-weight-semibold);
  
  /* High Contrast Mode */
  --high-contrast-bg: #000000;
  --high-contrast-text: #ffffff;
  --high-contrast-primary: #ffffff;
  --high-contrast-secondary: #ffff00;
  
  /* Dark Mode */
  --dark-bg: #1a1a1a;
  --dark-surface: #2d2d2d;
  --dark-text: #ffffff;
  --dark-text-muted: #a0a0a0;
  
  /* Animation Durations */
  --animation-duration-fast: 150ms;
  --animation-duration-normal: 300ms;
  --animation-duration-slow: 500ms;
  
  /* Easing Functions */
  --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  --ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: var(--dark-bg);
    --text-color: var(--dark-text);
    --dark-color: var(--light-color);
    --light-color: var(--dark-bg);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --bg-color: var(--high-contrast-bg);
    --text-color: var(--high-contrast-text);
    --primary-color: var(--high-contrast-primary);
    --secondary-color: var(--high-contrast-secondary);
  }
}