import { useColorScheme } from 'react-native';

/** Tokens SIOP portés en RN — répliques de docs/02-design/tokens.css
 *  (mêmes valeurs que le web et les maquettes R4, bi-thème). */

export const CLAIR = {
  primaire: '#1f4fb8',
  primaireDoux: '#eaf0fb',
  safran: '#dd8a0b',
  safranDoux: '#fdf3e3',
  fond: '#f5f7fa',
  surface: '#ffffff',
  surface2: '#eef2f7',
  bordure: '#dce3ec',
  bordureForte: '#b9c4d4',
  encre: '#1b2534',
  encre2: '#55647a',
  encre3: '#8494ab',
  stOuvert: '#3d6fe0',
  stOuvertFond: '#e9effc',
  stEncours: '#6d5bd8',
  stEncoursFond: '#efecfa',
  stAttente: '#b96f07',
  stAttenteFond: '#fbf1df',
  stTermine: '#178a50',
  stTermineFond: '#e6f5ec',
  stAnnule: '#68788f',
  stAnnuleFond: '#edf0f4',
  prioBloque: '#d92626',
  prioBloqueFond: '#fdeaea',
  prioHaute: '#d92626',
  prioMoyenne: '#b96f07',
  prioBasse: '#178a50',
  prioAucune: '#8494ab',
  succes: '#178a50',
  alerte: '#b96f07',
  danger: '#d92626',
  navFond: '#16233b',
} as const;

export const SOMBRE: Tokens = {
  primaire: '#6e92e8',
  primaireDoux: '#1d2c4c',
  safran: '#e89a1f',
  safranDoux: '#33270f',
  fond: '#0f1622',
  surface: '#182234',
  surface2: '#1e2a40',
  bordure: '#2b3850',
  bordureForte: '#3d4d6b',
  encre: '#e8edf5',
  encre2: '#a7b4c8',
  encre3: '#6d7d96',
  stOuvert: '#7da2ee',
  stOuvertFond: '#1c2a47',
  stEncours: '#a394ec',
  stEncoursFond: '#262040',
  stAttente: '#e0a33c',
  stAttenteFond: '#322510',
  stTermine: '#4bc084',
  stTermineFond: '#12301f',
  stAnnule: '#93a3ba',
  stAnnuleFond: '#222d3f',
  prioBloque: '#f26d6d',
  prioBloqueFond: '#3a1414',
  prioHaute: '#f26d6d',
  prioMoyenne: '#e0a33c',
  prioBasse: '#4bc084',
  prioAucune: '#6d7d96',
  succes: '#4bc084',
  alerte: '#e0a33c',
  danger: '#f26d6d',
  navFond: '#0c1524',
};

export type Tokens = { [K in keyof typeof CLAIR]: string };

export function useTokens(): Tokens {
  return useColorScheme() === 'dark' ? SOMBRE : CLAIR;
}
