// Type definition for badge template cfg_json stored on templates.
export interface BadgeTemplateCfg {
    hide_badge_header?: boolean;
    hide_badge_footer?: boolean;
    show_qr_front?: boolean;
    show_qr_back?: boolean;

    // Per-field hide toggles
    hide_title?: boolean;
    hide_affiliations?: boolean;
    hide_location?: boolean;

    // Alignment overrides
    align?: {
        name?: string;
        title?: string;
        affiliations?: string;
        location?: string;
    };

    // QR alignment
    qr_alignment?: {
        front?: string;
        back?: string;
    };

    // Layout fit height overrides
    fit_heights?: Record<string, string>;

    // Body text color: either a Tailwind `text-*` class or a hex color like `#112233`.
    body_text_color?: string;

    // Background image bleed: how far the background image extends past the physical
    // card edge on all four sides. Prevents white borders when the printer clips at the
    // card boundary. Any CSS length is valid: "0.125in", "3mm", "9px".
    // Leave unset (or "0") for no bleed.
    bleed?: string;

    // Header image vertical offset. CSS length applied as margin-top on the badge_header div.
    // Default (unset) = "2rem" (matches the prior hardcoded mt-8).
    // Negative values shift the image toward the top edge; larger values push it down.
    // Any CSS length works: "-0.5in", "1rem", "8px".
    header_margin_top?: string;

    // Border drawn below the badge header image. Set header_border_color to enable.
    // Unset = no border (default). Any valid CSS hex color.
    header_border_color?: string;
    // Thickness of the header bottom border. Any CSS length. Default "2px" when color is set.
    header_border_width?: string;
    // Per-side padding of the badge_header div. Any CSS length. Unset = 0.5rem (Tailwind p-2 default).
    // Bottom padding creates space between the header image and the border line (e.g. "1.45in").
    header_padding_top?: string;
    header_padding_right?: string;
    header_padding_bottom?: string;
    header_padding_left?: string;

    // Punch-out hole markers: show X overlays at the physical badge clip slot positions.
    // Slots are pre-perforated on the badge stock — markers guide attendees to push them out.
    // Hole dimensions: 5/8in wide × 1/8in tall, 1/4in from top, 3/8in from left/right edges.
    // Center hole: horizontally centered, same vertical position.
    // Colors: per-slot _fg/_bg override the shared fg/bg fallback. Unset = component defaults.
    // fg = stroke + line color (hex). bg = rectangle fill color (hex).
    punch_holes?: {
        left?: boolean;
        right?: boolean;
        center?: boolean;
        fg?: string;             // shared fallback stroke/line color
        bg?: string;             // shared fallback fill color
        left_fg?: string;
        left_bg?: string;
        left_rainbow?: boolean;  // animated hue-rotate; overrides fg/bg base color with saturated red
        right_fg?: string;
        right_bg?: string;
        right_rainbow?: boolean;
        center_fg?: string;
        center_bg?: string;
        center_rainbow?: boolean;
        slow_pulse?: boolean;    // when true: slow breathing pulse instead of fast linear cycle
        // Extra horizontal inset per side (mm) beyond the 1mm base safety margin.
        // Shrinks the visible marker width to keep it inside the physical hole on
        // printers or badge stock with variance. Default 2 when unset (see view component).
        inset_x_mm?: number;
    };

    // Allow arbitrary extra keys to preserve forward-compatibility.
    [key: string]: any;
}
