<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--
        Control styles. Where WPF needed full ControlTemplate overrides to
        achieve the Wild Dragon look, WinUI 3's built-in VisualStateManager
        handles hover / pressed / focus states cleanly, so most styles here
        just set surface properties (background, foreground, padding, corner
        radius) and the framework handles state.

        The few exceptions — rail icon button, ISO toggle pill — re-template
        because their interaction model (Teams-style hover wash; status-coded
        pill that preserves background on hover) doesn't fit the default
        Button template.
    -->

    <!-- ════════════ TextBlock (typographic ramp) ════════════ -->

    <Style x:Key="TextDisplay" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextDisplaySize}"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="Foreground" Value="{ThemeResource FgPrimary}"/>
        <Setter Property="LineHeight" Value="26"/>
    </Style>

    <Style x:Key="TextTitle" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextTitleSize}"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="Foreground" Value="{ThemeResource FgPrimary}"/>
    </Style>

    <Style x:Key="TextHeading" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextHeadingSize}"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="Foreground" Value="{ThemeResource FgPrimary}"/>
    </Style>

    <Style x:Key="TextBody" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextBodySize}"/>
        <Setter Property="Foreground" Value="{ThemeResource FgPrimary}"/>
    </Style>

    <Style x:Key="TextSubtle" TargetType="TextBlock" BasedOn="{StaticResource TextBody}">
        <Setter Property="Foreground" Value="{ThemeResource FgSecondary}"/>
    </Style>

    <Style x:Key="TextCaption" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextCaptionSize}"/>
        <Setter Property="FontWeight" Value="Medium"/>
        <Setter Property="Foreground" Value="{ThemeResource FgTertiary}"/>
        <Setter Property="CharacterSpacing" Value="80"/>
    </Style>

    <Style x:Key="TextMono" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="{ThemeResource FontMono}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextMonoSize}"/>
        <Setter Property="Foreground" Value="{ThemeResource FgSecondary}"/>
    </Style>

    <!-- ════════════ Button hierarchy ════════════
         Primary  — single per surface, the brand action.    Cyan fill, near-black text.
         Secondary — common operator actions.                Transparent + bordered.
         Tertiary  — inline dismissals, low-frequency.        Text-only.
         Destructive — Stop / Leave / Delete.                Coral border + text.
    -->

    <Style x:Key="ButtonPrimary" TargetType="Button">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextBodySize}"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="Background" Value="{ThemeResource AccentCyanSurface}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource AccentCyanSurface}"/>
        <Setter Property="Foreground" Value="{ThemeResource FgOnAccent}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="16,8"/>
        <Setter Property="CornerRadius" Value="{ThemeResource RadiusM}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

    <Style x:Key="ButtonSecondary" TargetType="Button">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextBodySize}"/>
        <Setter Property="FontWeight" Value="Medium"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{ThemeResource BorderStrong}"/>
        <Setter Property="Foreground" Value="{ThemeResource FgPrimary}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="14,7"/>
        <Setter Property="CornerRadius" Value="{ThemeResource RadiusM}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

    <Style x:Key="ButtonTertiary" TargetType="Button">
        <Setter Property="FontFamily" Value="{ThemeResource FontSans}"/>
        <Setter Property="FontSize" Value="{ThemeResource TextBodySize}"/>
        <Setter Property="FontWeight" Value="Medium"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Foreground" Value="{ThemeResource FgSecondary}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="10,6"/>
        <Setter Property="CornerRadius" Value="{ThemeResource RadiusM}"/>
    </Style>

    <Style x:Key="ButtonDestructive" TargetType="Button" BasedOn="{StaticResource ButtonSecondary}">
        <Setter Property="BorderBrush" Value="{ThemeResource AccentCoral}"/>
        <Setter Property="Foreground" Value="{ThemeResource AccentCoral}"/>
    </Style>

    <!-- Title-bar caption buttons. 46x32 to match Windows 11 standard. The
         close button gets a coral-red hover treatment via VSM override
         (handled per-button inline since WinUI 3's default Close-button
         red is the wrong red for our palette). -->
    <Style x:Key="ButtonCaption" TargetType="Button">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="{ThemeResource FgPrimary}"/>
        <Setter Property="Width" Value="46"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

    <!-- Rail icon button. Vertical-square 48x48 with rounded fill on hover.
         Used in the left rail; the icon (FontIcon) sits inside as Content. -->
    <Style x:Key="ButtonRailIcon" TargetType="Button">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="{ThemeResource FgSecondary}"/>
        <Setter Property="Width" Value="48"/>
        <Setter Property="Height" Value="48"/>
        <Setter Property="Margin" Value="0,4"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="CornerRadius" Value="{ThemeResource RadiusM}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

    <!-- ════════════ Card / Pill / Status containers ════════════ -->

    <Style x:Key="CardBorder" TargetType="Border">
        <Setter Property="Background" Value="{ThemeResource BgSurface}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource BorderSubtle}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="CornerRadius" Value="{ThemeResource RadiusL}"/>
        <Setter Property="Padding" Value="16"/>
    </Style>

    <Style x:Key="PillBorder" TargetType="Border">
        <Setter Property="Background" Value="{ThemeResource BgElevated}"/>
        <Setter Property="CornerRadius" Value="{ThemeResource RadiusPill}"/>
        <Setter Property="Padding" Value="10,4"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
    </Style>

</ResourceDictionary>
