/* ============================================
   Design System Variables
   Food Cost Control Hub Mini App
   ============================================ */

:root {
  /* === Telegram Theme Colors (overridden by JS) === */
  --tg-theme-bg-color: #ffffff;
  --tg-theme-text-color: #000000;
  --tg-theme-hint-color: #999999;
  --tg-theme-link-color: #2481cc;
  --tg-theme-button-color: #2481cc;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-secondary-bg-color: #f0f0f0;

  /* === Semantic Colors === */
  --color-bg: var(--tg-theme-bg-color);
  --color-bg-secondary: var(--tg-theme-secondary-bg-color);
  --color-text: var(--tg-theme-text-color);
  --color-text-secondary: var(--tg-theme-hint-color);
  --color-accent: var(--tg-theme-button-color);
  --color-accent-text: var(--tg-theme-button-text-color);
  --color-link: var(--tg-theme-link-color);

  /* === Status Colors === */
  --color-success: #34C759;
  --color-success-bg: rgba(52, 199, 89, 0.1);
  --color-warning: #FF9500;
  --color-warning-bg: rgba(255, 149, 0, 0.1);
  --color-error: #FF3B30;
  --color-error-bg: rgba(255, 59, 48, 0.1);
  --color-info: #007AFF;
  --color-info-bg: rgba(0, 122, 255, 0.1);

  /* === Typography === */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-lg: 17px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 28px;

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

  --line-height-tight: 1.2;
  --line-height-normal: 1.4;
  --line-height-loose: 1.6;

  /* === Spacing Scale === */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* === Border Radius === */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* === Shadows === */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.16);

  /* === Animation === */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;

  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === Z-Index Scale === */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;

  /* === Layout === */
  --max-width: 480px;
  --header-height: 56px;
  --nav-height: 64px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* === Dark Mode Adjustments === */
@media (prefers-color-scheme: dark) {
  :root {
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}
