<!-- PRE-GENERATED (design session). 앱/장치 자동전환 규칙 관리 (M12). -->
<ui:FluentWindow x:Class="DansoriEQ.App.SwitchRulesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
        Title="앱/장치 자동 전환" Height="560" Width="600"
        WindowStartupLocation="CenterOwner"
        ExtendsContentIntoTitleBar="True" WindowBackdropType="Mica"
        Background="#1B1B1F" Foreground="#F2F3F5"
        FontFamily="Segoe UI Variable, Segoe UI" FontSize="14">
    <Window.Resources>
        <SolidColorBrush x:Key="Card"   Color="#26262B"/>
        <SolidColorBrush x:Key="Card2"  Color="#2D2D33"/>
        <SolidColorBrush x:Key="Stroke" Color="#3A3A42"/>
        <SolidColorBrush x:Key="Dim"    Color="#A8ABB4"/>
        <SolidColorBrush x:Key="Mute"   Color="#767A83"/>
        <SolidColorBrush x:Key="Accent" Color="#4CC2FF"/>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ui:TitleBar Grid.Row="0" Title="앱/장치 자동 전환" Foreground="#F2F3F5" Padding="14,6"/>
        <Border Grid.Row="1" Style="{StaticResource NeonPopup}">
    <DockPanel Margin="20">
        <TextBlock DockPanel.Dock="Top" Text="앱/장치 자동 전환" FontSize="21" FontWeight="Bold" Margin="0,0,0,10"/>

        <CheckBox DockPanel.Dock="Top" x:Name="EnableToggle" Content="자동 전환 사용 (앱이 바뀌면 규칙에 맞는 프리셋 적용)"
                  Click="Enable_Changed" Foreground="{StaticResource Dim}" Margin="0,0,0,12"/>

        <Button DockPanel.Dock="Bottom" Content="닫기" Click="Close_Click" HorizontalAlignment="Right"
                Height="36" Padding="18,0" Margin="0,12,0,0"
                Background="{StaticResource Card}" Foreground="{StaticResource Dim}" BorderBrush="{StaticResource Stroke}"/>

        <!-- add rule -->
        <Border DockPanel.Dock="Bottom" Background="{StaticResource Card}" BorderBrush="{StaticResource Stroke}" BorderThickness="1" CornerRadius="10" Padding="12" Margin="0,12,0,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/><ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/><ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <ComboBox x:Name="TriggerCombo" Grid.Column="0" Width="80" SelectedIndex="0" Background="#2D2D33" Foreground="#F2F3F5" Margin="0,0,8,0">
                    <ComboBoxItem>앱</ComboBoxItem>
                    <ComboBoxItem>장치</ComboBoxItem>
                </ComboBox>
                <TextBox x:Name="MatchBox" Grid.Column="1" VerticalContentAlignment="Center" Padding="8,0" Height="32"
                         Background="#2D2D33" Foreground="#F2F3F5" BorderBrush="{StaticResource Stroke}" Margin="0,0,8,0"/>
                <TextBlock Grid.Column="2" Text="→" VerticalAlignment="Center" Margin="0,0,8,0" Foreground="{StaticResource Mute}"/>
                <ComboBox x:Name="PresetCombo" Grid.Column="3" Background="#2D2D33" Foreground="#F2F3F5" Margin="0,0,8,0"/>
                <Button Grid.Column="4" Content="＋ 추가" Click="Add_Click" Height="32" Padding="12,0"
                        Background="{StaticResource Accent}" Foreground="#04222F" FontWeight="Bold" BorderThickness="0"/>
            </Grid>
        </Border>

        <TextBlock DockPanel.Dock="Bottom" Foreground="{StaticResource Mute}" FontSize="12" Margin="0,8,0,0" TextWrapping="Wrap"
                   Text="예: 앱 = 'chrome' → '음악' 프리셋, 앱 = 'game' → '게이밍' 프리셋. 매칭은 프로세스명 부분일치. 규칙 변경은 다음 실행부터 적용됩니다."/>

        <!-- rules list -->
        <Border Background="{StaticResource Card}" BorderBrush="{StaticResource Stroke}" BorderThickness="1" CornerRadius="10" Padding="8">
            <ListBox x:Name="RulesList" BorderThickness="0" Background="Transparent" Foreground="{StaticResource Dim}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" VerticalAlignment="Center">
                                <Run Text="{Binding Trigger}"/><Run Text=" · "/><Run Text="{Binding Match}"/><Run Text="  →  "/><Run Text="{Binding PresetName}"/>
                            </TextBlock>
                            <Button Grid.Column="1" Content="삭제" Tag="{Binding Match}" Click="Delete_Click"
                                    Height="26" Padding="10,0" Background="{StaticResource Card2}" Foreground="{StaticResource Dim}" BorderBrush="{StaticResource Stroke}"/>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Border>
    </DockPanel>
        </Border>
    </Grid>
</ui:FluentWindow>
