export interface Profile {
  id: string;
  name: string;
  created_at: string;
}

export interface GuideListItem {
  gid: string;
  name: string;
  last_synced_at: string | null;
  total_quests: number;
  completed_quests: number;
  image_url?: string;
}

export interface CombatType {
  name: string;
  column: number;
}

export interface Resource {
  quantity: number;
  name: string;
}

export interface CombatIndicator {
  combat_type: string;
  count: string;
  label?: string;
  evitable?: boolean;
}

export interface QuestItem {
  name: string;
  completed: boolean;
  combat_indicators: CombatIndicator[];
  note: string | null;
  url: string | null;
}

export interface InstructionItem {
  text: string;
}

export interface GroupItem {
  note: string | null;
  quests: QuestItem[];
}

export type SectionItem =
  | { type: "Quest"; name: string; completed: boolean; combat_indicators: CombatIndicator[]; note: string | null; url: string | null }
  | { type: "Instruction"; text: string }
  | { type: "Group"; note: string | null; quests: QuestItem[] };

export interface Section {
  name: string;
  items: SectionItem[];
}

export interface GuideData {
  name: string;
  gid: string;
  effect: string;
  recommended_level: number | null;
  combat_legend: CombatType[];
  resources: Resource[];
  sections: Section[];
}

export interface SyncResult {
  synced: number;
  errors: string[];
}

export type RichSegment =
  | { type: "Text"; text: string }
  | { type: "QuestLink"; text: string; href: string };

export interface QuestStep {
  index: number;
  text: string;
  images: string[];
  launch_position: string | null;
  rich_text: RichSegment[];
}
