#pragma once

#include "CoreMinimal.h"
#include "Fonts/SlateFontInfo.h"
#include "Styling/SlateBrush.h"
#include "Layout/Margin.h"
#include "Templates/SubclassOf.h"
#include "Engine/Texture2D.h"
#include "UIStyleTypes.h"
#include "UIStyleTokens.generated.h"

class UCommonTextStyle;

/**
 * Tokens de estilo da UI organizados em 3 camadas (design tokens):
 *
 *   1. Primitive (FUIStylePalette) — paleta crua "Aurora Arcana".
 *      Espelha Tools/Templates/Zeus_Widget/shared/styles.css (:root).
 *   2. Semantic (FUIStyleSemantic) — papéis (Accent, Surface, OnSurface...)
 *      que referenciam a primitive. Trocar de tema mexe sobretudo aqui.
 *   3. Component (FUIStyle*) — por componente, consome a camada semantic.
 *
 * Defaults faithful ao tema padrão; tudo é sobrescrito por linha em
 * DT_UI_Styles (FUIStyleRow). Cores em FColor(R,G,B[,A]) sRGB convertidas
 * implicitamente para FLinearColor.
 */

// =====================================================================
//  1. Primitive — paleta Aurora Arcana
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStylePalette
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Bg0 = FLinearColor(FColor(7, 10, 18));            // --bg-0 #070A12

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Bg1 = FLinearColor(FColor(11, 16, 32));           // --bg-1 #0B1020

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Panel = FLinearColor(FColor(12, 18, 34, 235));    // --panel rgba(..,.92)

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Panel2 = FLinearColor(FColor(17, 24, 42));        // --panel-2 #11182A

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Panel3 = FLinearColor(FColor(14, 20, 36));        // --panel-3 #0E1424

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Border = FLinearColor(FColor(58, 75, 120));       // --border #3A4B78

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor BorderSoft = FLinearColor(FColor(58, 75, 120, 140)); // --border-soft

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Gold = FLinearColor(FColor(201, 167, 90));        // --gold #C9A75A

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor GoldHi = FLinearColor(FColor(231, 200, 115));     // --gold-hi #E7C873

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Blue = FLinearColor(FColor(78, 163, 255));        // --blue #4EA3FF

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Violet = FLinearColor(FColor(123, 92, 255));      // --violet #7B5CFF

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Text = FLinearColor(FColor(244, 240, 230));       // --text #F4F0E6

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Text2 = FLinearColor(FColor(174, 182, 200));      // --text-2 #AEB6C8

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor TextDim = FLinearColor(FColor(105, 115, 138));    // --text-dim #69738A

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Danger = FLinearColor(FColor(217, 92, 92));       // --danger #D95C5C

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Online = FLinearColor(FColor(80, 216, 144));      // --online #50D890

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Palette")
	FLinearColor Warn = FLinearColor(FColor(230, 180, 80));        // --warn #E6B450
};

// =====================================================================
//  2. Semantic — papéis (referenciam a primitive)
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleSemantic
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor Accent = FLinearColor(FColor(201, 167, 90));      // Gold

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor AccentHover = FLinearColor(FColor(231, 200, 115)); // GoldHi

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor Focus = FLinearColor(FColor(78, 163, 255));       // Blue

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor Glow = FLinearColor(FColor(123, 92, 255));        // Violet

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor SurfaceBase = FLinearColor(FColor(7, 10, 18));    // Bg0

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor Surface = FLinearColor(FColor(12, 18, 34, 235));  // Panel

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor SurfaceRaised = FLinearColor(FColor(17, 24, 42)); // Panel2

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor SurfaceSunken = FLinearColor(FColor(14, 20, 36)); // Panel3

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor OutlineStrong = FLinearColor(FColor(58, 75, 120)); // Border

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor OutlineSoft = FLinearColor(FColor(58, 75, 120, 140)); // BorderSoft

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor OnSurface = FLinearColor(FColor(244, 240, 230));  // Text

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor OnSurfaceMuted = FLinearColor(FColor(174, 182, 200)); // Text2

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor OnSurfaceDim = FLinearColor(FColor(105, 115, 138)); // TextDim

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor Danger = FLinearColor(FColor(217, 92, 92));       // Danger

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor Success = FLinearColor(FColor(80, 216, 144));     // Online

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Semantic")
	FLinearColor Warning = FLinearColor(FColor(230, 180, 80));     // Warn
};

// =====================================================================
//  3. Component
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleText
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	FSlateFontInfo TitleFont;       // Cinzel ExtraBold (display)

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	FSlateFontInfo SectionFont;     // Cinzel Bold (section title)

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	FSlateFontInfo BodyFont;        // Rajdhani Regular

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	FSlateFontInfo ButtonFont;      // Rajdhani Bold

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	FSlateFontInfo LabelFont;       // Rajdhani Bold (label/caps)

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	bool bLabelUppercase = true;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	float TitleLetterSpacing = 0.f; // informativo (RichText/futuro)
};

/**
 * Uma categoria tipográfica nomeada do tema. As categorias NÃO são fixas em
 * C++: o autor cria as que quiser ("Title", "Section", "Body", "Label", …)
 * no mapa FUIStyle.TextRoles do DT_UI_Styles. O UUICommonText_Base só
 * referencia o nome (dropdown vem do DT).
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUITextStyle
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	FSlateFontInfo Font;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	FLinearColor Color = FLinearColor(FColor(244, 240, 230));

	/** Caixa-alta (ex.: labels/eyebrows). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Text")
	bool bUppercase = false;
};

// =====================================================================
// FUIStyleButton — padrão multi-map (Hyper-style). 3 sub-mapas com a MESMA
// chave (nome da variante: "Primary", "Secondary", "Danger", "Ghost", ou
// customizada). UUIButton_Base.Variant é FName e busca em cada sub-mapa.
// O struct FUIStyleButtonVariant (composto, FLAT) permanece com a forma
// antiga — assim o hook BP_ApplyUIStyle dos WBP_Master continua funcional.
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleButtonBackground
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgNormal = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgHover = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgPressed = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgDisabled = FLinearColor(0.f, 0.f, 0.f, 0.42f);

	/** Textura opcional como background (Hyper-style). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TObjectPtr<UTexture2D> BackgroundTexture = nullptr;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FMargin BackgroundMargin = FMargin(8.f);
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleButtonStroke
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BorderNormal = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BorderHover = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button", meta = (ClampMin = "0"))
	float BorderWidth = 1.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button", meta = (ClampMin = "0"))
	float CornerRadius = 8.f;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleButtonFont
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor TextColor = FLinearColor::White;

	/** CommonTextStyle define fonte/tamanho/peso; TextColor sobrescreve a cor. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TSubclassOf<UCommonTextStyle> TextStyle;
};

/**
 * View FLAT composta da variante de botão (Background + Stroke + Font).
 * Mantida com a forma antiga (BgNormal/BgHover/.../TextStyle no topo) para
 * NÃO QUEBRAR o hook BP_ApplyUIStyle nos WBP_Master existentes. É construída
 * pelo UUIButton_Base::ResolveVariant a partir dos 3 sub-mapas do tema.
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleButtonVariant
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgNormal = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgHover = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgPressed = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BgDisabled = FLinearColor(0.f, 0.f, 0.f, 0.42f);

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BorderNormal = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor BorderHover = FLinearColor::Transparent;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FLinearColor TextColor = FLinearColor::White;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TSubclassOf<UCommonTextStyle> TextStyle;

	// Campos extras vindos das sub-categorias (background texture + stroke):
	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Button")
	TObjectPtr<UTexture2D> BackgroundTexture = nullptr;

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Button")
	FMargin BackgroundMargin = FMargin(8.f);

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Button")
	float BorderWidth = 1.f;

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Button")
	float CornerRadius = 8.f;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleButton
{
	GENERATED_BODY()

	FUIStyleButton()
	{
		// ---- Backgrounds (Primary/Secondary/Danger/Ghost) ----
		FUIStyleButtonBackground PriBg;
		PriBg.BgNormal   = FLinearColor(FColor(201, 167, 90));   // gold
		PriBg.BgHover    = FLinearColor(FColor(231, 200, 115));  // gold-hi
		PriBg.BgPressed  = FLinearColor(FColor(201, 167, 90));
		PriBg.BgDisabled = FLinearColor(FColor(201, 167, 90, 107));
		Backgrounds.Add(TEXT("Primary"), PriBg);

		FUIStyleButtonBackground SecBg;
		SecBg.BgNormal   = FLinearColor(FColor(17, 24, 42));     // panel-2
		SecBg.BgHover    = FLinearColor(FColor(22, 32, 58));
		SecBg.BgPressed  = FLinearColor(FColor(17, 24, 42));
		Backgrounds.Add(TEXT("Secondary"), SecBg);

		FUIStyleButtonBackground DngBg;
		DngBg.BgNormal   = FLinearColor(FColor(217, 92, 92, 36));
		DngBg.BgHover    = FLinearColor(FColor(217, 92, 92, 66));
		DngBg.BgPressed  = FLinearColor(FColor(217, 92, 92, 36));
		Backgrounds.Add(TEXT("Danger"), DngBg);

		FUIStyleButtonBackground GhoBg;
		GhoBg.BgNormal   = FLinearColor::Transparent;
		GhoBg.BgHover    = FLinearColor(FColor(22, 32, 58, 128));
		GhoBg.BgPressed  = FLinearColor::Transparent;
		Backgrounds.Add(TEXT("Ghost"), GhoBg);

		// ---- Strokes ----
		FUIStyleButtonStroke PriS;
		PriS.BorderNormal = FLinearColor(FColor(201, 167, 90));
		PriS.BorderHover  = FLinearColor(FColor(231, 200, 115));
		Strokes.Add(TEXT("Primary"), PriS);

		FUIStyleButtonStroke SecS;
		SecS.BorderNormal = FLinearColor(FColor(58, 75, 120));
		SecS.BorderHover  = FLinearColor(FColor(78, 163, 255));
		Strokes.Add(TEXT("Secondary"), SecS);

		FUIStyleButtonStroke DngS;
		DngS.BorderNormal = FLinearColor(FColor(217, 92, 92));
		DngS.BorderHover  = FLinearColor(FColor(217, 92, 92));
		Strokes.Add(TEXT("Danger"), DngS);

		FUIStyleButtonStroke GhoS;
		GhoS.BorderNormal = FLinearColor(FColor(58, 75, 120, 140));
		GhoS.BorderHover  = FLinearColor(FColor(78, 163, 255));
		Strokes.Add(TEXT("Ghost"), GhoS);

		// ---- Fonts ----
		FUIStyleButtonFont PriF; PriF.TextColor = FLinearColor(FColor(10, 10, 18));
		Fonts.Add(TEXT("Primary"), PriF);
		FUIStyleButtonFont SecF; SecF.TextColor = FLinearColor(FColor(244, 240, 230));
		Fonts.Add(TEXT("Secondary"), SecF);
		FUIStyleButtonFont DngF; DngF.TextColor = FLinearColor(FColor(240, 182, 182));
		Fonts.Add(TEXT("Danger"), DngF);
		FUIStyleButtonFont GhoF; GhoF.TextColor = FLinearColor(FColor(174, 182, 200));
		Fonts.Add(TEXT("Ghost"), GhoF);
	}

	/** Cores/textura de fundo por variante (chave FName). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FUIStyleButtonBackground> Backgrounds;

	/** Borda (cor, espessura, raio) por variante. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FUIStyleButtonStroke> Strokes;

	/** Tipografia (cor de texto, CommonTextStyle) por variante. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FUIStyleButtonFont> Fonts;

	// Globais comuns às variantes:
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	FMargin Padding = FMargin(22.f, 12.f);

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	float MinHeight = 48.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	float HoverScale = 1.02f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	float PressedScale = 0.98f;

	/** Tamanho por silhueta (Square/Rectangle/Topbar/Header). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<EUIButtonShape, FVector2D> ShapeSizes;
};

/**
 * Espelha 1:1 o Struct_UI_Style_Panels do Hyper: só os dois mapas de brush
 * (fundo + contorno) indexados por EUIPanelTexture. É o que o UI_Panel_Master
 * do Hyper expõe editável na instância (Details). EditAnywhere/ReadWrite para
 * o designer ajustar brush por widget; o tema (DT) só faz seed/fallback.
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIPanelBrushSet
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel|Texture")
	TMap<EUIPanelTexture, FSlateBrush> PanelBackground;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel|Texture")
	TMap<EUIPanelTexture, FSlateBrush> PanelOutline;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStylePanel
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FLinearColor Bg = FLinearColor(FColor(12, 18, 34, 235));       // Panel

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FLinearColor BgRaised = FLinearColor(FColor(17, 24, 42));      // Panel2

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FLinearColor BgSunken = FLinearColor(FColor(14, 20, 36));      // Panel3

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FLinearColor BorderColor = FLinearColor(FColor(58, 75, 120));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FLinearColor BorderSoftColor = FLinearColor(FColor(58, 75, 120, 140));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	float CornerRadius = 12.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	float CornerRadiusSmall = 10.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	float BorderWidth = 1.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FMargin Padding = FMargin(30.f);

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FMargin PaddingSmall = FMargin(20.f);

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FLinearColor CardSelectedBorder = FLinearColor(FColor(201, 167, 90)); // Accent

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
	FLinearColor CardSelectedBg = FLinearColor(FColor(24, 32, 58));

	/**
	 * Modo texturizado (espelha Struct_UI_Style_Panels do Hyper): brush por
	 * EUIPanelTexture. PanelBackground = fundo; PanelOutline = contorno.
	 * Se vazio p/ a chave, o painel usa o modo cor (RoundedBox) acima.
	 */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel|Texture")
	TMap<EUIPanelTexture, FSlateBrush> PanelBackground;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel|Texture")
	TMap<EUIPanelTexture, FSlateBrush> PanelOutline;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleBorders
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	FLinearColor Color = FLinearColor(FColor(58, 75, 120));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	FLinearColor SoftColor = FLinearColor(FColor(58, 75, 120, 140));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	float Width = 1.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	float Radius = 12.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	float RadiusSmall = 8.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	FLinearColor RuleColor = FLinearColor(FColor(201, 167, 90, 166)); // Gold ~.65

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	float RuleThickness = 2.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Borders")
	float RuleSoftThickness = 1.f;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleProgressBar
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar")
	FLinearColor TrackColor = FLinearColor(FColor(14, 20, 36));    // Panel3

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar")
	FLinearColor BorderColor = FLinearColor(FColor(58, 75, 120, 140));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar")
	float Height = 10.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar")
	float CornerRadius = 6.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar")
	float BorderWidth = 1.f;

	/** Cor de preenchimento por tipo (Health/Mana/XP...). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar")
	TMap<EUIProgressBarType, FLinearColor> FillByType;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleTooltip
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Tooltip")
	FLinearColor Bg = FLinearColor(FColor(17, 24, 42));            // Panel2

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Tooltip")
	FLinearColor BorderColor = FLinearColor(FColor(58, 75, 120));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Tooltip")
	float CornerRadius = 10.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Tooltip")
	float BorderWidth = 1.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Tooltip")
	FMargin Padding = FMargin(18.f, 14.f);

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Tooltip")
	FSlateFontInfo Font;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Tooltip")
	FLinearColor TextColor = FLinearColor(FColor(244, 240, 230));  // Text
};

// =====================================================================
// FUIStyleSpinner — padrão multi-map (Hyper-style). Sub-mapas por categoria
// (Colors, Layouts) com a MESMA CHAVE de variante. Permite criar variantes
// como "Default", "Small", "Loading", etc.
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleSpinnerColors
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner")
	FLinearColor Color = FLinearColor(FColor(201, 167, 90));   // Gold

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner")
	FLinearColor TrackColor = FLinearColor(FColor(58, 75, 120, 140));
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleSpinnerLayout
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner")
	float Radius = 28.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner")
	float Thickness = 3.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner", meta = (ClampMin = "1"))
	int32 NumberOfPieces = 8;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner", meta = (ClampMin = "0.05"))
	float Period = 0.9f;
};

/** View FLAT composta da variante de Spinner. */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleSpinnerVariant
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Spinner")
	FUIStyleSpinnerColors Colors;

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Spinner")
	FUIStyleSpinnerLayout Layout;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleSpinner
{
	GENERATED_BODY()

	FUIStyleSpinner()
	{
		Colors.Add(TEXT("Default"), FUIStyleSpinnerColors());
		Layouts.Add(TEXT("Default"), FUIStyleSpinnerLayout());
	}

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner")
	TMap<FName, FUIStyleSpinnerColors> Colors;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Spinner")
	TMap<FName, FUIStyleSpinnerLayout> Layouts;
};

// =====================================================================
// FUIStyleCheckBox — padrão multi-map (Hyper-style). Sub-mapas por categoria
// visual (Fills, Strokes, Layouts) com a MESMA CHAVE de variante. Cada
// UUICheckBox_Base referencia o nome (FName Variant) e o C++ compõe.
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleCheckBoxFill
{
	GENERATED_BODY()

	/** Preenchimento da caixa quando marcada. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	FLinearColor BoxColor = FLinearColor(FColor(201, 167, 90));     // Gold

	/** Cor do "tique"/glifo de check. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	FLinearColor CheckColor = FLinearColor(FColor(18, 22, 34));     // Bg0

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	FLinearColor HoveredColor = FLinearColor(FColor(224, 196, 130));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	FLinearColor PressedColor = FLinearColor(FColor(178, 146, 74));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	FLinearColor DisabledColor = FLinearColor(FColor(90, 96, 112, 140));
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleCheckBoxStroke
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	FLinearColor BorderColor = FLinearColor(FColor(58, 75, 120, 140));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox", meta = (ClampMin = "0"))
	float BorderThickness = 1.5f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox", meta = (ClampMin = "0"))
	float CornerRadius = 4.f;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleCheckBoxLayout
{
	GENERATED_BODY()

	/** Lado da caixa (px). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox", meta = (ClampMin = "8"))
	float BoxSize = 22.f;
};

/** View FLAT composta da variante de CheckBox — usada pelo BP hook. */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleCheckBoxVariant
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|CheckBox")
	FUIStyleCheckBoxFill Fill;

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|CheckBox")
	FUIStyleCheckBoxStroke Stroke;

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|CheckBox")
	FUIStyleCheckBoxLayout Layout;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleCheckBox
{
	GENERATED_BODY()

	FUIStyleCheckBox()
	{
		Fills.Add(TEXT("Default"), FUIStyleCheckBoxFill());
		Strokes.Add(TEXT("Default"), FUIStyleCheckBoxStroke());
		Layouts.Add(TEXT("Default"), FUIStyleCheckBoxLayout());
	}

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	TMap<FName, FUIStyleCheckBoxFill> Fills;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	TMap<FName, FUIStyleCheckBoxStroke> Strokes;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|CheckBox")
	TMap<FName, FUIStyleCheckBoxLayout> Layouts;
};

// =====================================================================
// FUIStyleInput — padrão multi-map (estilo Hyper): sub-mapas independentes
// por categoria visual (Backgrounds, Strokes, Typography). O widget escolhe
// um nome único de variante (ex.: "Box") que existe em CADA sub-mapa;
// reaproveita-se sem dor (ex.: mesma Stroke em vários Backgrounds).
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleInputBackground
{
	GENERATED_BODY()

	/**
	 * Brush completo do background (Image, Image Size, Matiz, Desenhar como,
	 * Ladrilhos, Margin/9-slice, UV). Mesma UI de FSlateBrush exposta no UMG.
	 * Se Brush.ResourceObject for nulo, pinta cor sólida (procedural — DrawAs
	 * = Image sem textura).
	 */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	FSlateBrush Brush;

	/** Tint multiplicado por cima do Brush em estado de hover. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	FLinearColor HoveredColor = FLinearColor::White;

	/** Tint multiplicado por cima do Brush em estado de focus. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	FLinearColor FocusedColor = FLinearColor::White;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleInputStroke
{
	GENERATED_BODY()

	/**
	 * Brush completo da borda (Image, Image Size, Matiz, Desenhar como,
	 * Ladrilhos, Margin). Use textura 9-slice (DrawAs=Box) ou Image para
	 * stroke decorada estilo Hyper Search.
	 */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	FSlateBrush Brush;

	/** Espessura procedural (efeito visual; usado por widgets que renderizam stroke vector). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input", meta = (ClampMin = "0"))
	float BorderThickness = 1.f;

	/** Raio do canto procedural (efeito visual; usado por widgets que renderizam RoundedBox). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input", meta = (ClampMin = "0"))
	float CornerRadius = 6.f;
};

USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleInputTypography
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	FLinearColor TextColor = FLinearColor(FColor(244, 240, 230));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	FLinearColor HintColor = FLinearColor(FColor(150, 160, 180, 200));

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input", meta = (ClampMin = "1"))
	float Size = 16.f;

	/** Fonte específica desta tipografia. Se vazia, usa FUIStyle.Text.BodyFont. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	FSlateFontInfo FontOverride;
};

/**
 * View "composta" da variante (Background + Stroke + Typography). Não é
 * editada diretamente no DT — é o que o UUIInput_Base monta ao resolver
 * a chave Variant nos 3 sub-mapas. Mantida aqui para uso no C++.
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleInputVariant
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Input")
	FUIStyleInputBackground Background;

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Input")
	FUIStyleInputStroke Stroke;

	UPROPERTY(BlueprintReadOnly, Category = "UI Style|Input")
	FUIStyleInputTypography Typography;
};

/**
 * Campo de texto — padrão multi-map (Hyper-style). 3 sub-mapas independentes
 * com a MESMA CHAVE (nome da variante: "Box", "Outline", "Underline",
 * "Search", ou customizada). O UUIInput_Base usa Variant=FName e busca o
 * pedaço em cada sub-mapa; assim dá pra reaproveitar (ex.: a mesma Stroke
 * em variantes com Backgrounds diferentes).
 *
 * Construtor já popula com defaults bonitos inspirados na Login.
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleInput
{
	GENERATED_BODY()

	FUIStyleInput()
	{
		auto MakeBg = [](const FLinearColor& Tint)
		{
			FUIStyleInputBackground B;
			B.Brush.TintColor = FSlateColor(Tint);
			B.Brush.DrawAs    = ESlateBrushDrawType::Image;
			return B;
		};

		// ---- Backgrounds ----
		Backgrounds.Add(TEXT("Box"),       MakeBg(FLinearColor(FColor(9, 13, 24, 235))));
		Backgrounds.Add(TEXT("Outline"),   MakeBg(FLinearColor(0, 0, 0, 0)));
		Backgrounds.Add(TEXT("Underline"), MakeBg(FLinearColor(0, 0, 0, 0)));
		Backgrounds.Add(TEXT("Search"),    MakeBg(FLinearColor(FColor(17, 24, 42))));

		auto MakeStroke = [](const FLinearColor& Tint, float Thickness, float Radius)
		{
			FUIStyleInputStroke S;
			S.Brush.TintColor      = FSlateColor(Tint);
			S.Brush.DrawAs         = ESlateBrushDrawType::Box;
			S.Brush.Margin         = FMargin(4.f);
			S.BorderThickness      = Thickness;
			S.CornerRadius         = Radius;
			return S;
		};

		// ---- Strokes ----
		Strokes.Add(TEXT("Box"),       MakeStroke(FLinearColor(FColor(58, 75, 120, 140)), 1.f, 6.f));
		Strokes.Add(TEXT("Outline"),   MakeStroke(FLinearColor(FColor(58, 75, 120)),       1.f, 6.f));
		Strokes.Add(TEXT("Underline"), MakeStroke(FLinearColor(FColor(58, 75, 120, 160)), 2.f, 0.f));
		Strokes.Add(TEXT("Search"),    MakeStroke(FLinearColor(FColor(58, 75, 120, 140)), 1.f, 18.f));

		// ---- Typography ----
		FUIStyleInputTypography DefaultType;
		DefaultType.TextColor = FLinearColor(FColor(244, 240, 230));
		DefaultType.HintColor = FLinearColor(FColor(150, 160, 180, 200));
		DefaultType.Size      = 16.f;
		Typography.Add(TEXT("Box"),       DefaultType);
		Typography.Add(TEXT("Outline"),   DefaultType);
		Typography.Add(TEXT("Underline"), DefaultType);
		Typography.Add(TEXT("Search"),    DefaultType);
	}

	/** Cores/textura de fundo por variante (chave FName). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	TMap<FName, FUIStyleInputBackground> Backgrounds;

	/** Borda (cor, espessura, arredondamento) por variante. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	TMap<FName, FUIStyleInputStroke> Strokes;

	/** Tipografia (cor de texto/hint, tamanho, fonte) por variante. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input")
	TMap<FName, FUIStyleInputTypography> Typography;

	/** Padding interno do campo (px, uniforme) — comum a todas variantes. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input", meta = (ClampMin = "0"))
	float Padding = 10.f;

	/** Altura mínima do campo (px). */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input", meta = (ClampMin = "0"))
	float MinHeight = 44.f;

	/** Largura mínima PADRÃO do campo (px). Designer mostra esse tamanho. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Input", meta = (ClampMin = "0"))
	float MinWidth = 240.f;
};
