export interface AppColors {
  primary: string;
  primaryLight: string;
  background: string;
  card: string;
  text: string;
  textSecondary: string;
  textMuted: string;
  error: string;
  success: string;
  warning: string;
  border: string;
  salesCard: string;
  white: string;
  black: string;
}

/** Default colors (FitPulse Orange). Mutated in-place by updateColors(). */
export const colors: AppColors = {
  primary: '#FF6B00',
  primaryLight: '#FF8F3F',
  background: '#F5F5F5',
  card: '#FFFFFF',
  text: '#1A1A1A',
  textSecondary: '#6B7280',
  textMuted: '#9CA3AF',
  error: '#E53935',
  success: '#43A047',
  warning: '#FF9800',
  border: '#E5E7EB',
  salesCard: '#1B1B3A',
  white: '#FFFFFF',
  black: '#000000',
};

/** Update colors in place so all modules sharing the reference see new values. */
export function updateColors(newColors: AppColors): void {
  for (const key of Object.keys(newColors) as (keyof AppColors)[]) {
    colors[key] = newColors[key];
  }
}

export type ColorKey = keyof AppColors;
