#pragma once

#include "CoreMinimal.h"
#include "Fonts/SlateFontInfo.h"
#include "Styling/SlateBrush.h"
#include "Styling/SlateTypes.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 Hyper "Buttons": 7 sub-mapas independentes
// indexados pela MESMA chave FName de variante (autor define livremente:
// "Default", "Square", "Topbar", "Home_Main_Menu", ...). UUIButton_Base.Variant
// é FName e busca o pedaço necessário em cada sub-mapa. ButtonStyle traz
// FButtonStyle do Slate completo (Normal/Hovered/Pressed/Disabled como
// FSlateBrush, Foregrounds, Padding, Sounds).
// =====================================================================
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleButton
{
	GENERATED_BODY()

	FUIStyleButton()
	{
		// Defaults "no draw" pra não pintar branco quando o brush estiver vazio
		// (regra Hyper — ver feedback_slatebrush_empty_white). Autor preenche
		// no DT_UI_Styles.
		FButtonStyle DefaultStyle;
		DefaultStyle.Normal.DrawAs   = ESlateBrushDrawType::NoDrawType;
		DefaultStyle.Hovered.DrawAs  = ESlateBrushDrawType::NoDrawType;
		DefaultStyle.Pressed.DrawAs  = ESlateBrushDrawType::NoDrawType;
		DefaultStyle.Disabled.DrawAs = ESlateBrushDrawType::NoDrawType;
		ButtonStyle.Add(TEXT("Default"), DefaultStyle);

		FSlateBrush DefaultStroke;
		DefaultStroke.DrawAs = ESlateBrushDrawType::NoDrawType;
		ButtonStroke.Add(TEXT("Default"), DefaultStroke);

		ButtonFont.Add(TEXT("Default"), FSlateFontInfo());

		ButtonTextColorRegular.Add(TEXT("Default"),  FLinearColor::White);
		ButtonTextColorHovered.Add(TEXT("Default"),  FLinearColor::White);
		ButtonTextColorSelected.Add(TEXT("Default"), FLinearColor::White);

		ButtonIconColor.Add(TEXT("Default"), FLinearColor::White);
	}

	/** FButtonStyle do Slate por variante: Normal/Hovered/Pressed/Disabled
	 *  como FSlateBrush completo + Foregrounds + Padding + Sounds. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FButtonStyle> ButtonStyle;

	/** Stroke/contorno como brush independente (texturizável). Hoje o
	 *  UUIButton_Base não consome este campo automaticamente — quem precisa
	 *  de stroke decora o FSlateBrush dentro de ButtonStyle.Normal via
	 *  OutlineSettings. Reservado pra evolução com 2 Borders empilhados. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FSlateBrush> ButtonStroke;

	/** Fonte do texto por variante. */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FSlateFontInfo> ButtonFont;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FLinearColor> ButtonTextColorRegular;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FLinearColor> ButtonTextColorHovered;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FLinearColor> ButtonTextColorSelected;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Button")
	TMap<FName, FLinearColor> ButtonIconColor;
};

/**
 * Override manual por instância (modo bUseTheme = false). 3 brushes diretos
 * pros 3 Borders do painel — designer edita o brush bruto no Details.
 * Default = NoDrawType pra não pintar branco quando vazio (regra Hyper).
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIPanelBrushSet
{
	GENERATED_BODY()

	FUIPanelBrushSet()
	{
		PanelBackground.DrawAs    = ESlateBrushDrawType::NoDrawType;
		PanelOutline.DrawAs       = ESlateBrushDrawType::NoDrawType;
		PanelOutlineEffect.DrawAs = ESlateBrushDrawType::NoDrawType;
	}

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel|Brush")
	FSlateBrush PanelBackground;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel|Brush")
	FSlateBrush PanelOutline;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel|Brush")
	FSlateBrush PanelOutlineEffect;
};

/**
 * Espelha 1:1 o Struct_UI_Style_Panels do Hyper. 3 brushes por categoria
 * (FName livre): fundo, contorno e efeito sobre o contorno. Categorias são
 * editadas direto no DT_UI_Styles — UUIPanel_Base resolve via dropdown
 * dinâmico (meta=GetOptions).
 *
 * Migração: assets v1 tinham TMap<EUIPanelTexture, ...>; os campos
 * *_DEPRECATED preservam essas keys via PropertyRedirect no DefaultEngine.ini.
 * PostSerialize copia legacy→ByName no PostLoad — após re-save no editor,
 * o legacy fica vazio e o asset só carrega o ByName.
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStylePanel
{
	GENERATED_BODY()

	// ---- Novo (FName livre) -------------------------------------------

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel|Texture")
	TMap<FName, FSlateBrush> PanelBackgroundByName;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel|Texture")
	TMap<FName, FSlateBrush> PanelOutlineByName;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel|Texture")
	TMap<FName, FSlateBrush> PanelOutlineEffectByName;

	// ---- Legacy (carrega assets antigos via CoreRedirect) -------------
	//
	// Não aparecem no Details (DeprecatedProperty); persistem só pra leitura
	// do asset pré-migração. PostSerialize copia o conteúdo pros campos
	// ByName e zera os legacy.

	UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use PanelBackgroundByName (FName)."))
	TMap<EUIPanelTexture, FSlateBrush> PanelBackground_DEPRECATED;

	UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use PanelOutlineByName (FName)."))
	TMap<EUIPanelTexture, FSlateBrush> PanelOutline_DEPRECATED;

	UPROPERTY(meta = (DeprecatedProperty, DeprecationMessage = "Use PanelOutlineEffectByName (FName)."))
	TMap<EUIPanelTexture, FSlateBrush> PanelOutlineEffect_DEPRECATED;

	/** Chamado automaticamente após Serialize. Migra dados legacy→ByName. */
	void PostSerialize(const FArchive& Ar);
};

template<>
struct TStructOpsTypeTraits<FUIStylePanel> : public TStructOpsTypeTraitsBase2<FUIStylePanel>
{
	enum
	{
		WithPostSerialize = true,
	};
};

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;
};

/**
 * Variante completa de ProgressBar: materiais por layer (Fill/BG/Track/Edge/Shimmer)
 * + parametros visuais (DrawStyle, CornerRadius, Border) + toggles de efeito.
 *
 * Material nulo = nao sobrescreve o brush do WBP (usa o que esta atribuido la).
 * Aplicada pelo UUIProgressBar_Base quando bUseTheme=true via Variant FName.
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleProgressBarVariant
{
	GENERATED_BODY()

	// ---- Materiais (opcionais; nullptr = mantem brush do WBP) ----

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Materials")
	TObjectPtr<UMaterialInterface> FillMaterial;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Materials")
	TObjectPtr<UMaterialInterface> BackgroundMaterial;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Materials")
	TObjectPtr<UMaterialInterface> TrackGridMaterial;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Materials")
	TObjectPtr<UMaterialInterface> EdgeMaterial;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Materials")
	TObjectPtr<UMaterialInterface> ShimmerMaterial;

	// ---- Style (forma + bordas) ----

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Style")
	EUIProgressBarStyle DrawStyle = EUIProgressBarStyle::Rounded;

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

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Style")
	bool bShowBorder = false;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Style")
	FLinearColor BorderColour = FLinearColor(0.f, 0.f, 0.f, 0.8f);

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

	// ---- Toggles de efeito ----

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Effects")
	bool bShowTrackGrid = false;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Effects")
	bool bShowEdge = false;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar|Effects")
	bool bShowShimmer = false;
};

/**
 * ProgressBar — padrao multi-map Hyper-style. Variantes (HP/MP/XP/Cast/...) sao
 * editadas direto no DT_UI_Styles; cada UUIProgressBar_Base referencia uma key
 * FName (dropdown via meta=GetOptions resolve esse mapa em runtime+editor).
 */
USTRUCT(BlueprintType)
struct ZMMO_API FUIStyleProgressBar
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|ProgressBar")
	TMap<FName, FUIStyleProgressBarVariant> Variants;
};

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;
};
