export const loginThemeNames = ["graphite", "cyan", "emerald", "rose", "amber", "indigo", "mint", "sunset"] as const;

export type LoginThemeName = (typeof loginThemeNames)[number];

export type LoginTheme = {
  name: string;
  accent: string;
  canvas: string;
  panel: string;
  heading: string;
  body: string;
  supporting: string;
  illustrationUrl: string;
  landscapeIllustrationUrl: string;
  previewUrl: string;
  landscapePreviewUrl: string;
  mood?: "pastel" | "dark";
};

export const loginThemes: Record<LoginThemeName, LoginTheme> = {
  cyan: { name: "Coastal", accent: "#0891b2", canvas: "#dff6fb", panel: "#b8edf5", heading: "#073f55", body: "#0f5e73", supporting: "#227c8f", illustrationUrl: "/login-workspace-cyan.webp", landscapeIllustrationUrl: "/login-landscape-cyan.webp", previewUrl: "/login-workspace-cyan-thumb.webp", landscapePreviewUrl: "/login-landscape-cyan-thumb.webp", mood: "pastel" },
  graphite: { name: "Graphite", accent: "#334155", canvas: "#1f2937", panel: "#607085", heading: "#f8fafc", body: "#dbe4ee", supporting: "#c7d2df", illustrationUrl: "/login-workspace-graphite.webp", landscapeIllustrationUrl: "/login-landscape-graphite.webp", previewUrl: "/login-workspace-graphite-thumb.webp", landscapePreviewUrl: "/login-landscape-graphite-thumb.webp", mood: "dark" },
  emerald: { name: "Golden", accent: "#d99a00", canvas: "#fff3bd", panel: "#ffe07a", heading: "#6b4400", body: "#8a5a00", supporting: "#a66f00", illustrationUrl: "/login-workspace-emerald.webp", landscapeIllustrationUrl: "/login-landscape-emerald.webp", previewUrl: "/login-workspace-emerald-thumb.webp", landscapePreviewUrl: "/login-landscape-emerald-thumb.webp", mood: "pastel" },
  rose: { name: "Pink", accent: "#ec4899", canvas: "#fde7f1", panel: "#fbc8df", heading: "#7b1745", body: "#9b225a", supporting: "#bd3a74", illustrationUrl: "/login-workspace-rose.webp", landscapeIllustrationUrl: "/login-landscape-rose.webp", previewUrl: "/login-workspace-rose-thumb.webp", landscapePreviewUrl: "/login-landscape-rose-thumb.webp", mood: "pastel" },
  amber: { name: "Midnight", accent: "#1e3a8a", canvas: "#101b43", panel: "#31529c", heading: "#eff6ff", body: "#dbeafe", supporting: "#bfdbfe", illustrationUrl: "/login-workspace-amber.webp", landscapeIllustrationUrl: "/login-landscape-amber.webp", previewUrl: "/login-workspace-amber-thumb.webp", landscapePreviewUrl: "/login-landscape-amber-thumb.webp", mood: "dark" },
  indigo: { name: "Indigo", accent: "#4f46e5", canvas: "#ebe9ff", panel: "#d3ccff", heading: "#31206b", body: "#49358a", supporting: "#6853a6", illustrationUrl: "/login-workspace-indigo.webp", landscapeIllustrationUrl: "/login-landscape-indigo.webp", previewUrl: "/login-workspace-indigo-thumb.webp", landscapePreviewUrl: "/login-landscape-indigo-thumb.webp", mood: "pastel" },
  mint: { name: "Mint", accent: "#0f766e", canvas: "#def8f1", panel: "#bdf1e4", heading: "#114c47", body: "#12645d", supporting: "#237d73", illustrationUrl: "/login-workspace-mint.webp", landscapeIllustrationUrl: "/login-landscape-mint.webp", previewUrl: "/login-workspace-mint-thumb.webp", landscapePreviewUrl: "/login-landscape-mint-thumb.webp", mood: "pastel" },
  sunset: { name: "Sunset", accent: "#ea580c", canvas: "#ffe7d6", panel: "#ffcba8", heading: "#713019", body: "#8e3f1c", supporting: "#b35223", illustrationUrl: "/login-workspace-sunset.webp", landscapeIllustrationUrl: "/login-landscape-sunset.webp", previewUrl: "/login-workspace-sunset-thumb.webp", landscapePreviewUrl: "/login-landscape-sunset-thumb.webp", mood: "pastel" },
};

export function isLoginThemeName(value: string): value is LoginThemeName {
  return loginThemeNames.includes(value as LoginThemeName);
}
