import { useColorScheme } from 'react-native';

// Mêmes couleurs que les prototypes HTML
const light = {
  bg: '#EEF3F8', card: '#FFFFFF', ink: '#0F2338', muted: '#5F7387', line: '#D5DEE7',
  acc: '#1B4F8A', accSoft: 'rgba(27,79,138,0.13)', amber: '#D9830A', red: '#E5484D', ok: '#17724A', okSoft: 'rgba(23,114,74,0.13)',
  onAcc: '#FFFFFF', heroA: '#0F2A4A', heroB: '#1B4F8A', heroMuted: '#C5D3E3', dark: false,
};
const dark: typeof light = {
  bg: '#0A1522', card: '#13263A', ink: '#EAF1F8', muted: '#8DA3B8', line: '#243A52',
  acc: '#5B9BE0', accSoft: 'rgba(91,155,224,0.16)', amber: '#F0A63A', red: '#FF7A7A', ok: '#4CC38A', okSoft: 'rgba(76,195,138,0.15)',
  onAcc: '#08121F', heroA: '#0F2A4A', heroB: '#1B4F8A', heroMuted: '#C5D3E3', dark: true,
};
export type Theme = typeof light;
export function useTheme(): Theme { return useColorScheme() === 'dark' ? dark : light; }

export const font = { reg: 'Sora_400Regular', semi: 'Sora_600SemiBold', bold: 'Sora_700Bold' };
export const occColor = (lvl: number, t: Theme) => [t.ok, t.ok, t.amber, t.red][lvl] ?? t.muted;
