// Single source of truth for the per-account accent variant catalogue.
//
// Lives outside `tamagui.config.ts` so leaf modules (the account registry,
// the swatch picker) can import the ids and design hex without pulling the
// full Tamagui config — and reanimated — into the import graph (jest can't
// resolve the native reanimated initialiser, so anything that transitively
// imports the config breaks the test runner).
//
// `tamagui.config.ts` imports from here to build the 16 `light_accent*` /
// `dark_accent*` sub-themes; everything else (state, UI) imports just the
// id type, the id list, and the design metadata it needs.

export type AccentVariantId = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8

export type AccentVariantSpec = {
  name: string
  // Hue + scheme-paired hex pairs. `light` / `dark` are the base hue tuned
  // for that scheme's neutral background; the `*Pressed` siblings are the
  // pressed-state shifts (light: ~10% darker, dark: ~10% lighter).
  light: string
  lightPressed: string
  dark: string
  darkPressed: string
  // Per-scheme on-accent text/icon tint. White on every variant except
  // Saffron, where white-on-saffron drops below AA on dark and is forced
  // to near-black. Variants 1–7 set both fields to `#FFFFFF`.
  onAccent: string
  onAccentDark: string
}

export const ACCENT_VARIANTS: Record<AccentVariantId, AccentVariantSpec> = {
  1: {
    name: 'Electric Blue',
    light: '#0A22FF',
    lightPressed: '#0819CC',
    dark: '#3A52FF',
    darkPressed: '#5A72FF',
    onAccent: '#FFFFFF',
    onAccentDark: '#FFFFFF',
  },
  2: {
    name: 'Coral',
    light: '#DA3826',
    lightPressed: '#B82A1B',
    dark: '#FF6E5C',
    darkPressed: '#FF8978',
    onAccent: '#FFFFFF',
    onAccentDark: '#FFFFFF',
  },
  3: {
    name: 'Cyan',
    light: '#007EAE',
    lightPressed: '#006791',
    dark: '#1B96BC',
    darkPressed: '#3FA9CC',
    onAccent: '#FFFFFF',
    onAccentDark: '#FFFFFF',
  },
  4: {
    name: 'Amber',
    light: '#C8651C',
    lightPressed: '#A85316',
    dark: '#E58A3A',
    darkPressed: '#F0A055',
    onAccent: '#FFFFFF',
    onAccentDark: '#FFFFFF',
  },
  5: {
    name: 'Violet',
    light: '#6B1FE0',
    lightPressed: '#5818BF',
    dark: '#9B66FF',
    darkPressed: '#B284FF',
    onAccent: '#FFFFFF',
    onAccentDark: '#FFFFFF',
  },
  6: {
    name: 'Magenta',
    light: '#C2188C',
    lightPressed: '#A21576',
    dark: '#E64FAE',
    darkPressed: '#F26EBE',
    onAccent: '#FFFFFF',
    onAccentDark: '#FFFFFF',
  },
  7: {
    name: 'Emerald',
    light: '#128A4E',
    lightPressed: '#0F7340',
    dark: '#1FA864',
    darkPressed: '#34BD7A',
    onAccent: '#FFFFFF',
    onAccentDark: '#FFFFFF',
  },
  8: {
    name: 'Saffron',
    light: '#B58800',
    lightPressed: '#967100',
    dark: '#DDA426',
    darkPressed: '#EBB540',
    onAccent: '#FFFFFF',
    onAccentDark: '#1C1C1C',
  },
}

export const ACCENT_VARIANT_IDS: readonly AccentVariantId[] = [1, 2, 3, 4, 5, 6, 7, 8]
