/**
 * FitAI Color System
 * Minimalist muted earth tones with light and dark mode support
 */

export interface ColorScheme {
  // Primary Earth Tones
  primary: string;
  primaryDark: string;
  primaryLight: string;

  // Accent Colors
  accent: string;
  terracotta: string;
  sand: string;

  // Status Colors
  success: string;
  warning: string;
  danger: string;
  info: string;

  // Neutrals
  background: string;
  surface: string;
  surfaceElevated: string;

  // Text
  textPrimary: string;
  textSecondary: string;
  textTertiary: string;

  // Borders
  border: string;
  borderLight: string;

  // Overlays
  overlay: string;
  overlayLight: string;

  // Legacy compatibility (will be phased out)
  white: string;
  black: string;
}

/**
 * Light Mode Color Palette
 * Natural, warm, muted earth tones
 */
export const lightColors: ColorScheme = {
  // Primary Earth Tones
  primary: "#6B9080", // Muted sage green (main actions)
  primaryDark: "#5A7A6E", // Darker sage
  primaryLight: "#8AAE9E", // Lighter sage

  // Accent Colors (minimal use)
  accent: "#A9B4A0", // Warm gray-green
  terracotta: "#C1876B", // Warm terracotta (highlights)
  sand: "#E8DCC4", // Warm sand (backgrounds)

  // Status Colors (muted)
  success: "#7BA05B", // Muted olive green
  warning: "#D4A574", // Muted amber
  danger: "#B66B6B", // Muted rust red
  info: "#7B9BB0", // Muted blue-gray

  // Neutrals
  background: "#F9F7F4", // Warm off-white
  surface: "#FFFFFF", // Pure white
  surfaceElevated: "#FEFDFB", // Slightly warm white

  // Text
  textPrimary: "#2C3731", // Deep forest
  textSecondary: "#5C6B61", // Medium forest
  textTertiary: "#8B9A8F", // Light forest

  // Borders
  border: "#E8E4DF", // Very light warm gray
  borderLight: "#F2EFE9", // Ultra light warm gray

  // Overlays
  overlay: "rgba(44, 55, 49, 0.5)",
  overlayLight: "rgba(44, 55, 49, 0.05)",

  // Legacy
  white: "#FFFFFF",
  black: "#2C3731",
};

/**
 * Dark Mode Color Palette
 * Warm dark tones with adjusted earth colors for contrast
 */
export const darkColors: ColorScheme = {
  // Primary Earth Tones (adjusted for dark)
  primary: "#8AAE9E", // Lighter sage for contrast
  primaryDark: "#6B9080",
  primaryLight: "#A4C4B5",

  // Accent Colors
  accent: "#B5C2B0",
  terracotta: "#D4A285",
  sand: "#4A4539", // Dark sand

  // Status Colors
  success: "#8DB76A",
  warning: "#E0B886",
  danger: "#C87D7D",
  info: "#8FADC4",

  // Neutrals
  background: "#1C1F1D", // Deep warm black
  surface: "#252926", // Warm dark gray
  surfaceElevated: "#2D3330", // Elevated warm dark

  // Text
  textPrimary: "#E8E6E1", // Warm off-white
  textSecondary: "#B8BFB5", // Medium warm gray
  textTertiary: "#7A8379", // Muted warm gray

  // Borders
  border: "#3A3F3C", // Subtle dark border
  borderLight: "#2F3432", // Ultra subtle

  // Overlays
  overlay: "rgba(0, 0, 0, 0.6)",
  overlayLight: "rgba(255, 255, 255, 0.05)",

  // Legacy
  white: "#E8E6E1",
  black: "#1C1F1D",
};

/**
 * Get color scheme based on theme mode
 */
export const getColors = (mode: "light" | "dark"): ColorScheme => {
  return mode === "dark" ? darkColors : lightColors;
};
