import type { BossGroupId } from "../game/bossCatalog";
import type { BossId, HealerClassId, InventoryItem } from "../game/types";
import type { GearProgress } from "../game/progression/gear";
import type { CollectionLog, MaterialStack } from "../game/progression/loot";

export type SaveSlotId = 1 | 2 | 3;
export type AppScreen = "login" | "saves" | "home" | "profile" | "gear" | "settings" | "mode" | "game";
export type GameModeId = "roguelike-pve" | "rogue-trials" | "dungeons" | "roguelike-pvp" | "stadium-pvp";

export interface CollectionDrop {
  id: string;
  name: string;
  icon: string;
  rarity: "Common" | "Uncommon" | "Rare" | "Epic" | "Legendary";
  count: number;
  chance: string;
  itemLevel?: number;
  kind: "group-drop" | "pet";
}

export interface GroupBossCollection {
  bossId: BossId;
  bossName: string;
  kills: number;
  pet: CollectionDrop;
}

export interface BossGroupCollection {
  groupId: BossGroupId;
  groupLetter: string;
  groupName: string;
  coreMechanic: string;
  defeated: boolean;
  drops: CollectionDrop[];
  bosses: GroupBossCollection[];
}

export interface HunterStats {
  totalBossKills: number;
  flawlessClears: number;
  alliesSaved: number;
  healingDone: number;
  bossKills: Record<string, number>;
  highestRoguelikeRound: number;
  highestRogueTrialsEndlessKills: number;
}

export interface HealerProgress {
  level: number;
  inventory: InventoryItem[];
}

export interface HunterSave {
  schemaVersion: 5;
  slotId: SaveSlotId;
  hunterName: string;
  activeClassId: HealerClassId;
  healers: Record<HealerClassId, HealerProgress>;
  location: string;
  playSeconds: number;
  updatedAt: string;
  stats: HunterStats;
  materials: MaterialStack[];
  collectionLog: CollectionLog;
  gearProgress: GearProgress;
}

export interface SaveSlotState {
  id: SaveSlotId;
  local: HunterSave | null;
  online: HunterSave | null;
}

export interface GameSettings {
  masterVolume: number;
  reducedMotion: boolean;
  damageNumbers: boolean;
  largeText: boolean;
}
