/**
 * MacroBuddyCrunch Design Tokens
 * ===============================
 * All design variables in one place.
 * Import this first in your main stylesheet.
 */

:root {
  /* ==================== */
  /* COLORS               */
  /* ==================== */

  /* Primary - can be overridden by branding config */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: rgba(37, 99, 235, 0.1);
  --color-primary-muted: rgba(37, 99, 235, 0.6);

  /* Neutrals */
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Text */
  --color-text: #1e293b;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  /* Semantic */
  --color-success: #22c55e;
  --color-success-light: rgba(34, 197, 94, 0.1);
  --color-warning: #f59e0b;
  --color-warning-light: rgba(245, 158, 11, 0.1);
  --color-danger: #ef4444;
  --color-danger-light: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-info-light: rgba(59, 130, 246, 0.1);

  /* Macro Colors (consistent everywhere) */
  --color-calories: #f59e0b;
  --color-protein: #ef4444;
  --color-carbs: #3b82f6;
  --color-fat: #22c55e;

  /* Status Colors */
  --color-status-pending: #f59e0b;
  --color-status-submitted: #3b82f6;
  --color-status-viewed: #22c55e;
  --color-status-active: #22c55e;
  --color-status-archived: #64748b;

  /* ==================== */
  /* TYPOGRAPHY           */
  /* ==================== */

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 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: 2rem;      /* 32px */
  --font-size-4xl: 2.5rem;    /* 40px */

  /* 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;

  /* ==================== */
  /* SPACING              */
  /* ==================== */

  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */

  /* ==================== */
  /* BORDERS & RADIUS     */
  /* ==================== */

  /* Square corners - NO round buttons */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-base: 4px;     /* Default for buttons */
  --radius-md: 6px;
  --radius-lg: 8px;       /* Cards, modals */
  --radius-xl: 12px;

  --border-width: 1px;
  --border-width-thick: 2px;

  /* ==================== */
  /* SHADOWS              */
  /* ==================== */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Focus ring */
  --shadow-focus: 0 0 0 3px var(--color-primary-light);
  --shadow-focus-danger: 0 0 0 3px var(--color-danger-light);

  /* ==================== */
  /* TRANSITIONS          */
  /* ==================== */

  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;

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

  /* ==================== */
  /* Z-INDEX SCALE        */
  /* ==================== */

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;

  /* ==================== */
  /* COMPONENT SIZES      */
  /* ==================== */

  /* Buttons */
  --btn-height-sm: 32px;
  --btn-height-base: 40px;
  --btn-height-lg: 48px;

  /* Icons */
  --icon-size-sm: 16px;
  --icon-size-base: 20px;
  --icon-size-lg: 24px;
  --icon-size-xl: 32px;

  /* Touch targets (minimum 44px) */
  --touch-target-min: 44px;

  /* Inputs */
  --input-height: 44px;
  --input-height-sm: 36px;
  --input-height-lg: 52px;

  /* Navigation */
  --nav-height-mobile: 64px;
  --nav-width-sidebar: 240px;
  --nav-width-sidebar-collapsed: 64px;

  /* ==================== */
  /* BREAKPOINTS          */
  /* ==================== */
  /* Use in media queries:
   * @media (min-width: 640px) { } - sm
   * @media (min-width: 768px) { } - md
   * @media (min-width: 1024px) { } - lg
   * @media (min-width: 1280px) { } - xl
   */
}

/* ==================== */
/* DARK MODE            */
/* ==================== */

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0f172a;
    --color-surface: #1e293b;
    --color-surface-raised: #334155;
    --color-border: #334155;
    --color-border-light: #1e293b;

    --color-text: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  }
}

/* ==================== */
/* REDUCED MOTION       */
/* ==================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0.01ms;
    --duration-base: 0.01ms;
    --duration-slow: 0.01ms;
    --duration-slower: 0.01ms;
  }
}
