export const COLORS = {
  primary: "#fc0000",
  primaryLight: "#ff4040",
  primaryDark: "#c80000",
  gold: "#f0c040",
  secondary: "#240046",
  secondaryLight: "#3c096c",
  secondaryDark: "#10002b",
  neutralDark: "#363636",
  neutralLight: "#FFE2B3",
  black: "#000000",
  white: "#FFFFFF",
  dark: {
    bg: "#1a1a2e",
    surface: "#16213e",
    deep: "#0f3460",
    border: "rgba(255,255,255,0.08)",
    textPrimary: "#FFFFFF",
    textMuted: "#A0A0A0",
  },
};

export function hexToRgb(hex: string): string {
  const clean = hex.replace("#", "");
  const r = parseInt(clean.substring(0, 2), 16);
  const g = parseInt(clean.substring(2, 4), 16);
  const b = parseInt(clean.substring(4, 6), 16);
  return `${r}, ${g}, ${b}`;
}

export function buildCssVars(colors: typeof COLORS): string {
  return `
    --accent: ${colors.primary};
    --accent-rgb: ${hexToRgb(colors.primary)};
    --accent-light: ${colors.primaryLight};
    --accent-light-rgb: ${hexToRgb(colors.primaryLight)};
    --accent-dark: ${colors.primaryDark};
    --accent-dark-rgb: ${hexToRgb(colors.primaryDark)};
    --accent-gold: ${colors.gold};
    --accent-gold-rgb: ${hexToRgb(colors.gold)};
    --secondary: ${colors.secondary};
    --secondary-light: ${colors.secondaryLight};
    --secondary-dark: ${colors.secondaryDark};
  `.trim();
}
