#pragma once

#include <cstdint>
#include <string>

namespace poe2::ui {

// Cấu trúc màu 32-bit ARGB chuẩn Windows GDI / DirectX
struct Color {
    uint8_t b{0};
    uint8_t g{0};
    uint8_t r{0};
    uint8_t a{255};

    constexpr Color() = default;
    constexpr Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha = 255)
        : b(blue), g(green), r(red), a(alpha) {}

    constexpr uint32_t ToArgb() const noexcept {
        return (static_cast<uint32_t>(a) << 24) |
               (static_cast<uint32_t>(r) << 16) |
               (static_cast<uint32_t>(g) << 8)  |
               static_cast<uint32_t>(b);
    }
};

namespace colors {
    inline constexpr Color White{255, 255, 255, 255};
    inline constexpr Color BlueMagic{136, 136, 255, 255};
    inline constexpr Color YellowRare{255, 255, 119, 255};
    inline constexpr Color OrangeUnique{175, 96, 37, 255};
    inline constexpr Color BrickRed{255, 51, 51, 255};
    inline constexpr Color DangerOrange{255, 153, 0, 255};
    inline constexpr Color RewardGreen{0, 255, 127, 255};
    inline constexpr Color CyanStrongbox{0, 210, 211, 255};
    inline constexpr Color DarkBg{16, 18, 24, 230};       // 90% opacity dark slate
    inline constexpr Color DarkerBg{10, 12, 16, 245};
    inline constexpr Color GoldBorder{200, 155, 60, 255}; // PoE Gold
    inline constexpr Color GrayText{160, 160, 160, 255};
    inline constexpr Color SubduedText{110, 110, 110, 255};
    inline constexpr Color GreenSuccess{46, 204, 113, 255};
    inline constexpr Color YellowWarning{241, 196, 15, 255};
}

struct Rect {
    int x{0};
    int y{0};
    int width{0};
    int height{0};

    constexpr bool Contains(int px, int py) const noexcept {
        return px >= x && px <= (x + width) && py >= y && py <= (y + height);
    }
};

struct Point {
    int x{0};
    int y{0};
};

} // namespace poe2::ui
