import type { CalendarEventColor, CalendarView } from "./types";

export const CALENDAR_VIEWS: CalendarView[] = ["month", "week", "day"];

/** Vertical range rendered by the week/day time grids (full day by default). */
export const DAY_START_HOUR = 0;
export const DAY_END_HOUR = 24;

/** Pixel height of one hour row in the time grid — drives scroll math. */
export const HOUR_HEIGHT = 56;

/** Time grid auto-scrolls to this hour on mount so mornings are visible. */
export const DEFAULT_SCROLL_HOUR = 7;

/** Max event chips shown inside a month cell before collapsing to "+N more". */
export const MONTH_CELL_MAX_EVENTS = 3;

export const DEFAULT_EVENT_COLOR: CalendarEventColor = "blue";

/**
 * Token-backed color classes per event color. All values reference existing
 * `--color-status-*` utilities from `globals.css` — no hardcoded hex.
 * `block`/`chip` = filled surfaces; `dot` = the small month-chip indicator.
 */
export const EVENT_COLOR_CLASSES: Record<
  CalendarEventColor,
  { block: string; chip: string; dot: string }
> = {
  blue: {
    block:
      "bg-status-service-started-light text-status-service-started border-status-service-started/25",
    chip: "text-status-service-started",
    dot: "bg-status-service-started",
  },
  sky: {
    block:
      "bg-status-confirm-light text-status-confirm border-status-confirm/25",
    chip: "text-status-confirm",
    dot: "bg-status-confirm",
  },
  amber: {
    block:
      "bg-status-under-review-light text-status-under-review border-status-under-review/25",
    chip: "text-status-under-review",
    dot: "bg-status-under-review",
  },
  green: {
    block:
      "bg-status-completed-light text-status-completed border-status-completed/25",
    chip: "text-status-completed",
    dot: "bg-status-completed",
  },
  red: {
    block:
      "bg-status-cancelled-light text-status-cancelled border-status-cancelled/25",
    chip: "text-status-cancelled",
    dot: "bg-status-cancelled",
  },
  purple: {
    block:
      "bg-status-in-the-way-light text-status-in-the-way border-status-in-the-way/25",
    chip: "text-status-in-the-way",
    dot: "bg-status-in-the-way",
  },
  gray: {
    block: "bg-status-closed-light text-status-closed border-status-closed/25",
    chip: "text-status-closed",
    dot: "bg-status-closed",
  },
};
