#pragma once

// ==========================================================
// item_types.hpp - Data Models for POE2 Item Inspection
// Poe2VisualTool v2.0.0 (100% C++23 Native Fusion)
// ==========================================================

#include <string>
#include <vector>
#include <cstdint>

namespace inspector {

enum class ItemCategory : uint32_t {
    Waystone = 0,
    Weapon,
    BodyArmour,
    Helmet,
    Boots,
    Gloves,
    Shield,
    Quiver,
    Ring,
    Amulet,
    Belt,
    Jewel,
    Charm,
    Flask,
    Currency,
    Other
};

inline constexpr std::string_view GetCategoryName(ItemCategory cat) noexcept {
    switch (cat) {
        case ItemCategory::Waystone: return "Waystone";
        case ItemCategory::Weapon: return "Weapon";
        case ItemCategory::BodyArmour: return "Body Armour";
        case ItemCategory::Helmet: return "Helmet";
        case ItemCategory::Boots: return "Boots";
        case ItemCategory::Gloves: return "Gloves";
        case ItemCategory::Shield: return "Shield";
        case ItemCategory::Quiver: return "Quiver";
        case ItemCategory::Ring: return "Ring";
        case ItemCategory::Amulet: return "Amulet";
        case ItemCategory::Belt: return "Belt";
        case ItemCategory::Jewel: return "Jewel";
        case ItemCategory::Charm: return "Charm";
        case ItemCategory::Flask: return "Flask";
        case ItemCategory::Currency: return "Currency";
        case ItemCategory::Other:
        default: return "Item";
    }
}

enum class ItemRarity : uint32_t {
    Normal = 0,
    Magic,
    Rare,
    Unique,
    Currency,
    Gem
};

enum class AffixType : uint32_t {
    Prefix = 0,
    Suffix,
    Implicit,
    Unknown
};

enum class ModSeverity : uint32_t {
    Brick = 0,       // 🔴 Dark Red: Breaks build / instant death (Reflect, No Regen)
    Dangerous,       // 🟠 Orange: High risk (-Max Res, Extra Crit, Reduced Recovery)
    Neutral,         // ⚪ White: Normal property
    Crafting,        // 🟣 Purple/Yellow: Open affix slot / crafting potential
    Reward,          // 🟢 Green: High map bonus (Quantity, Rarity, Pack Size)
    GodRoll          // 🌟 Gold/Deep Green: Tier 1 max roll
};

struct InspectionMod {
    std::string text;
    AffixType affixType = AffixType::Unknown;
    ModSeverity severity = ModSeverity::Neutral;
    std::string category;
    std::string description;
    int tier = 0;
    std::string colorHex = "#FFFFFF";
    int originalOrder = 0;
};

struct ItemInspectionReport {
    std::string itemName;
    std::string itemClass;
    std::string baseType;
    ItemCategory category = ItemCategory::Other;
    ItemRarity rarity = ItemRarity::Normal;
    int itemLevel = 0;
    int quality = 0;
    bool isBrick = false;
    int safetyScore = 100;
    int qualityScore = 0;

    int openPrefixes = 0;
    int openSuffixes = 0;
    int maxPrefixes = 0;
    int maxSuffixes = 0;

    std::string summary;
    std::vector<InspectionMod> rawMods;
    std::vector<InspectionMod> orderedModifiers;
    std::vector<std::string> properties;
    std::vector<std::string> redMods;
    std::vector<std::string> greenMods;
    std::vector<std::string> yellowMods;
    std::vector<std::string> neutralMods;
    std::string sockets;
    bool isCorrupted = false;
};

} // namespace inspector
