import type { SiteThemeColors } from "@/types/models";

export type ThemePaletteMeta = {
  id: string;
  name: string;
  description: string;
  colors: SiteThemeColors;
};

/** Hazır 5 palet; adminde seçilir, `themeColors` ile siteye uygulanır */
export const THEME_PRESETS: ThemePaletteMeta[] = [
  {
    id: "klasik-lacivert",
    name: "Klasik lacivert & altın",
    description: "Kurumsal hukuk sitesi; mevcut varsayılan tonlar.",
    colors: {
      navy: "#0f1f44",
      navySoft: "#152a45",
      gold: "#c9a227",
      goldDark: "#9a7619",
      page: "#f6f7fb",
      muted: "#5c6478",
      line: "rgba(15, 31, 68, 0.08)",
    },
  },
  {
    id: "gece-gumus",
    name: "Gece mavisi & gümüş",
    description: "Soğuk tonlar, modern ve sakin.",
    colors: {
      navy: "#0c1929",
      navySoft: "#152535",
      gold: "#b8c4ce",
      goldDark: "#8a9aa8",
      page: "#eef1f5",
      muted: "#5a6672",
      line: "rgba(12, 25, 41, 0.1)",
    },
  },
  {
    id: "orman-krem",
    name: "Orman & krem",
    description: "Doğal, güven veren yeşil-krem dengesi.",
    colors: {
      navy: "#1a3c34",
      navySoft: "#234a40",
      gold: "#c4a35a",
      goldDark: "#8f7340",
      page: "#f7f5ef",
      muted: "#4d5c56",
      line: "rgba(26, 60, 52, 0.09)",
    },
  },
  {
    id: "bordo-sampanya",
    name: "Bordo & şampanya",
    description: "Sıcak, prestijli kırmızı-altın hissi.",
    colors: {
      navy: "#3d1520",
      navySoft: "#522232",
      gold: "#d4af6a",
      goldDark: "#a67c32",
      page: "#faf6f2",
      muted: "#6b555c",
      line: "rgba(61, 21, 32, 0.1)",
    },
  },
  {
    id: "antrasit-amber",
    name: "Antrasit & amber",
    description: "Koyu nötr zemin, amber vurgular.",
    colors: {
      navy: "#1e2430",
      navySoft: "#2a3140",
      gold: "#e8a54b",
      goldDark: "#b87a2a",
      page: "#f4f5f7",
      muted: "#5c6370",
      line: "rgba(30, 36, 48, 0.1)",
    },
  },
];

export const DEFAULT_THEME_PRESET_ID = THEME_PRESETS[0]!.id;

export function getPresetById(id: string): ThemePaletteMeta | undefined {
  return THEME_PRESETS.find((p) => p.id === id);
}

export function defaultThemeColors(): SiteThemeColors {
  return { ...THEME_PRESETS[0]!.colors };
}
