import type { CompanyId } from "@/core/auth/types";
import type { CompanyBranding, SignatureColors } from "../types";

const BELETAGE_COLORS: SignatureColors = {
  prefix: "#54504F",
  name: "#54504F",
  title: "#A7A9AA",
  address: "#A7A9AA",
  phone: "#54504F",
  website: "#54504F",
  motto: "#22B5AB",
};

const URBAN_SWITCH_COLORS: SignatureColors = {
  prefix: "#345476",
  name: "#345476",
  title: "#6B7280",
  address: "#6B7280",
  phone: "#345476",
  website: "#345476",
  motto: "#345476",
};

const STUDII_COLORS: SignatureColors = {
  prefix: "#000D1A",
  name: "#000D1A",
  title: "#6B7280",
  address: "#6B7280",
  phone: "#000D1A",
  website: "#0182A1",
  motto: "#0182A1",
};

const ADDR_CHRISTESCU = [
  "str. G-ral Constantin Christescu, nr. 12",
  "Cluj-Napoca, Cluj 400416",
  "România",
] as const;
const ADDR_UNIRII = [
  "str. Unirii, nr. 3, sc. 3 ap. 26",
  "Cluj-Napoca, Cluj 400432",
  "România",
] as const;
const ADDR_ALBAC = [
  "Str. Albac, nr. 2, ap. 1",
  "Cluj-Napoca, Cluj 400459",
  "România",
] as const;

/** Address option keys shared across all companies */
export type AddressKey = "christescu" | "unirii" | "albac";

/** Available address options for Beletage (toggle between offices) */
export const BELETAGE_ADDRESSES: Record<AddressKey, string[]> = {
  christescu: [...ADDR_CHRISTESCU],
  unirii: [...ADDR_UNIRII],
  albac: [...ADDR_ALBAC],
};

/** Available address options for Urban Switch */
export const US_ADDRESSES: Record<AddressKey, string[]> = {
  christescu: [...ADDR_CHRISTESCU],
  unirii: [...ADDR_UNIRII],
  albac: [...ADDR_ALBAC],
};

/** Available address options for Studii de Teren */
export const SDT_ADDRESSES: Record<AddressKey, string[]> = {
  christescu: [...ADDR_CHRISTESCU],
  unirii: [...ADDR_UNIRII],
  albac: [...ADDR_ALBAC],
};

export const COMPANY_BRANDING: Record<CompanyId, CompanyBranding> = {
  beletage: {
    id: "beletage",
    name: "Beletage SRL",
    accent: "#22B5AB",
    logo: {
      png: "https://beletage.ro/img/Semnatura-Logo.png",
      svg: "https://beletage.ro/img/Logo-Beletage.svg",
    },
    slashGrey: {
      png: "https://beletage.ro/img/Grey-slash.png",
      svg: "https://beletage.ro/img/Grey-slash.svg",
    },
    slashAccent: {
      png: "https://beletage.ro/img/Green-slash.png",
      svg: "https://beletage.ro/img/Green-slash.svg",
    },
    logoDimensions: { width: 162, height: 24 },
    address: [...ADDR_CHRISTESCU],
    website: "www.beletage.ro",
    motto: "we make complex simple",
    defaultColors: BELETAGE_COLORS,
  },
  "urban-switch": {
    id: "urban-switch",
    name: "Urban Switch SRL",
    accent: "#345476",
    logo: {
      png: "/logos/logo-us-light.svg",
      svg: "/logos/logo-us-light.svg",
    },
    slashGrey: {
      png: "/logos/us-dash-grey.svg",
      svg: "/logos/us-dash-grey.svg",
    },
    slashAccent: {
      png: "/logos/us-dash-accent.svg",
      svg: "/logos/us-dash-accent.svg",
    },
    logoDimensions: { width: 140, height: 24 },
    address: [...ADDR_CHRISTESCU],
    website: "www.urbanswitch.ro",
    motto: "shaping urban futures",
    defaultColors: URBAN_SWITCH_COLORS,
  },
  "studii-de-teren": {
    id: "studii-de-teren",
    name: "Studii de Teren SRL",
    accent: "#0182A1",
    logo: {
      png: "/logos/logo-sdt-light.svg",
      svg: "/logos/logo-sdt-light.svg",
    },
    slashGrey: {
      png: "/logos/sdt-dot-grey.svg",
      svg: "/logos/sdt-dot-grey.svg",
    },
    slashAccent: {
      png: "/logos/sdt-dot-accent.svg",
      svg: "/logos/sdt-dot-accent.svg",
    },
    logoDimensions: { width: 71, height: 24 },
    address: [...ADDR_CHRISTESCU],
    website: "www.studiideteren.ro",
    motto: "ground truth, measured right",
    defaultColors: STUDII_COLORS,
  },
  group: {
    id: "group",
    name: "Grup Companii",
    accent: "#64748b",
    logo: { png: "", svg: "" },
    slashGrey: {
      png: "https://beletage.ro/img/Grey-slash.png",
      svg: "https://beletage.ro/img/Grey-slash.svg",
    },
    slashAccent: { png: "", svg: "" },
    address: ["Cluj-Napoca, Cluj", "România"],
    website: "",
    motto: "",
    defaultColors: BELETAGE_COLORS,
  },
};

export function getBranding(company: CompanyId): CompanyBranding {
  return COMPANY_BRANDING[company];
}
