<Window x:Class="AxCopilot.Views.ShortcutHelpWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="AX Copilot &#8212; &#xB2E8;&#xCD95;&#xD0A4; &#xBB34;&#xC5C7;&#xC774; &#xC788;&#xB098;&#xC694;"
        Width="540" Height="620"
        MinWidth="480" MinHeight="500"
        WindowStyle="None"
        AllowsTransparency="True"
        UseLayoutRounding="True"
        SnapsToDevicePixels="True"
        Background="Transparent"
        ResizeMode="CanResize"
        WindowStartupLocation="CenterOwner"
        ShowInTaskbar="False"
        KeyDown="Window_KeyDown"
        MouseDown="Window_MouseDown">

    <Grid Margin="16">
        <Border CornerRadius="16" Background="{DynamicResource LauncherBackground}">
            <Border.Effect>
                <DropShadowEffect Color="Black" BlurRadius="20" ShadowDepth="4" Opacity="0.22"/>
            </Border.Effect>
        </Border>
        <Border Background="{DynamicResource LauncherBackground}" CornerRadius="16" ClipToBounds="True">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="56"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="52"/>
                </Grid.RowDefinitions>

                <!-- ── 헤더 ── -->
                <Border Grid.Row="0" CornerRadius="16,16,0,0">
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                            <GradientStop Color="#1A1B2E" Offset="0"/>
                            <GradientStop Color="#3B4ECC" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <Grid Margin="20,0">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                            <TextBlock Text="&#xE7C3;" FontFamily="Segoe MDL2 Assets"
                                       FontSize="16" Foreground="#88AAFFCC"
                                       VerticalAlignment="Center" Margin="0,0,10,0"/>
                            <TextBlock Text="&#xB2E8;&#xCD95;&#xD0A4; &#xBB34;&#xC5C7;&#xC774; &#xC788;&#xB098;&#xC694;" FontSize="15" FontWeight="SemiBold"
                                       Foreground="White" VerticalAlignment="Center"/>
                        </StackPanel>
                        <Button Width="28" Height="28" HorizontalAlignment="Right"
                                Background="Transparent" BorderThickness="0" Cursor="Hand"
                                Click="Close_Click">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Border x:Name="Bd" CornerRadius="7" Background="Transparent">
                                        <TextBlock Text="&#xE711;" FontFamily="Segoe MDL2 Assets"
                                                   FontSize="10" Foreground="#88AAFFCC"
                                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="Bd" Property="Background" Value="#22FFFFFF"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                    </Grid>
                </Border>

                <!-- ── 내용 ── -->
                <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"
                              HorizontalScrollBarVisibility="Disabled"
                              Padding="0,0,4,0">
                    <StackPanel Margin="20,16,20,8">

                        <!-- 탐색 -->
                        <TextBlock Text="&#xD0D0;&#xC0C9;" FontSize="10" FontWeight="SemiBold"
                                   Foreground="{DynamicResource SecondaryText}" Margin="2,0,0,6"/>
                        <ItemsControl x:Name="NavigationItems"/>

                        <!-- 파일 동작 -->
                        <TextBlock Text="&#xD30C;&#xC77C; &#xB3D9;&#xC791;" FontSize="10" FontWeight="SemiBold"
                                   Foreground="{DynamicResource SecondaryText}" Margin="2,14,0,6"/>
                        <ItemsControl x:Name="FileActionItems"/>

                        <!-- 뷰 전환 -->
                        <TextBlock Text="&#xBDF0; &#xC804;&#xD658;" FontSize="10" FontWeight="SemiBold"
                                   Foreground="{DynamicResource SecondaryText}" Margin="2,14,0,6"/>
                        <ItemsControl x:Name="ViewItems"/>

                        <!-- 실행 및 검색 -->
                        <TextBlock Text="&#xC2E4;&#xD589; &#xBC0F; &#xAE30;&#xD0C0;" FontSize="10" FontWeight="SemiBold"
                                   Foreground="{DynamicResource SecondaryText}" Margin="2,14,0,6"/>
                        <ItemsControl x:Name="RunItems"/>

                        <!-- 예약어 -->
                        <TextBlock Text="&#xC785;&#xB825; &#xC608;&#xC57D;&#xC5B4;" FontSize="10" FontWeight="SemiBold"
                                   Foreground="{DynamicResource SecondaryText}" Margin="2,14,0,6"/>
                        <ItemsControl x:Name="PrefixItems"/>

                    </StackPanel>
                </ScrollViewer>

                <!-- ── 리사이즈 그립 ── -->
                <Border Grid.Row="2"
                        HorizontalAlignment="Right" VerticalAlignment="Bottom"
                        Width="20" Height="20" Margin="0,0,2,2"
                        Cursor="SizeNWSE" Background="Transparent"
                        Panel.ZIndex="100"
                        MouseLeftButtonDown="ResizeGrip_MouseLeftButtonDown">
                    <Canvas Width="13" Height="13">
                        <Rectangle Canvas.Left="10" Canvas.Top="10" Width="2.5" Height="2.5" RadiusX="1.2" RadiusY="1.2" Fill="#70AAAACC"/>
                        <Rectangle Canvas.Left="6"  Canvas.Top="10" Width="2.5" Height="2.5" RadiusX="1.2" RadiusY="1.2" Fill="#50AAAACC"/>
                        <Rectangle Canvas.Left="10" Canvas.Top="6"  Width="2.5" Height="2.5" RadiusX="1.2" RadiusY="1.2" Fill="#50AAAACC"/>
                        <Rectangle Canvas.Left="2"  Canvas.Top="10" Width="2.5" Height="2.5" RadiusX="1.2" RadiusY="1.2" Fill="#30AAAACC"/>
                        <Rectangle Canvas.Left="6"  Canvas.Top="6"  Width="2.5" Height="2.5" RadiusX="1.2" RadiusY="1.2" Fill="#30AAAACC"/>
                        <Rectangle Canvas.Left="10" Canvas.Top="2"  Width="2.5" Height="2.5" RadiusX="1.2" RadiusY="1.2" Fill="#30AAAACC"/>
                    </Canvas>
                </Border>

                <!-- ── 푸터 ── -->
                <Border Grid.Row="2" BorderBrush="{DynamicResource BorderColor}" BorderThickness="0,1,0,0"
                        Background="{DynamicResource ItemBackground}">
                    <Grid Margin="20,0">
                        <!-- 왼쪽: 테마 색상 토글 + Esc 안내 -->
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Center">
                            <CheckBox x:Name="ThemeColorChk"
                                      Content="테마 색상으로 표시"
                                      FontSize="11"
                                      Foreground="{DynamicResource SecondaryText}"
                                      Checked="ThemeColorChk_Changed"
                                      Unchecked="ThemeColorChk_Changed"
                                      Margin="0,0,0,2"/>
                            <TextBlock Text="Esc 또는 클릭하면 닫힙니다"
                                       FontSize="10" Foreground="{DynamicResource SecondaryText}"
                                       Opacity="0.6"/>
                        </StackPanel>
                        <Button Content="&#xB2EB;&#xAE30;" HorizontalAlignment="Right"
                                Click="Close_Click" Width="72" Height="32"
                                Background="#4B5EFC" Foreground="White"
                                FontSize="12" FontWeight="SemiBold"
                                BorderThickness="0" Cursor="Hand">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Border Background="{TemplateBinding Background}" CornerRadius="8"
                                            Padding="{TemplateBinding Padding}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" Value="#3B4EEC"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                    </Grid>
                </Border>
            </Grid>
        </Border>
    </Grid>
</Window>
