import type { CompanyId } from "@/core/auth/types";

export type SignatureVariant = "full" | "reply" | "minimal";

export interface SignatureColors {
  prefix: string;
  name: string;
  title: string;
  address: string;
  phone: string;
  website: string;
  motto: string;
}

export interface SignatureLayout {
  greenLineWidth: number;
  gutterWidth: number;
  iconTextSpacing: number;
  iconVerticalOffset: number;
  mottoSpacing: number;
  sectionSpacing: number;
  titleSpacing: number;
  logoSpacing: number;
  /** Logo scale factor (0.5–2.0, default 1.0) */
  logoScale: number;
}

export interface SignatureBanner {
  imageUrl: string;
  linkUrl: string;
  alt: string;
  width: number;
  height: number;
}

export interface CompanyBranding {
  id: CompanyId;
  name: string;
  accent: string;
  logo: { png: string; svg: string };
  slashGrey: { png: string; svg: string };
  slashAccent: { png: string; svg: string };
  /** Logo dimensions (width × height) for the signature HTML */
  logoDimensions?: { width: number; height: number };
  address: string[];
  website: string;
  motto: string;
  defaultColors: SignatureColors;
}

export interface SignatureConfig {
  id?: string;
  label?: string;
  prefix: string;
  name: string;
  title: string;
  phone: string;
  company: CompanyId;
  colors: SignatureColors;
  layout: SignatureLayout;
  variant: SignatureVariant;
  useSvg: boolean;
  /** Override the default company address */
  addressOverride?: string[];
  /** Optional promotional banner below signature */
  banner?: SignatureBanner;
}

export interface SavedSignature {
  id: string;
  label: string;
  config: SignatureConfig;
  createdAt: string;
  updatedAt: string;
}
