<!-- PRE-GENERATED (design session). Shows imported .tweq info + local-DB match status before applying. -->
<ui:FluentWindow x:Class="DansoriEQ.App.PresetInfoWindow"
        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="EQ 프리셋 가져오기" Height="600" Width="560"
        WindowStartupLocation="CenterOwner"
        ExtendsContentIntoTitleBar="True" WindowBackdropType="Mica"
        Background="#1B1B1F" Foreground="#F2F3F5"
        FontFamily="Segoe UI Variable, Segoe UI">
    <Window.Resources>
        <SolidColorBrush x:Key="Card"    Color="#26262B"/>
        <SolidColorBrush x:Key="Card2"   Color="#2D2D33"/>
        <SolidColorBrush x:Key="Stroke"  Color="#3A3A42"/>
        <SolidColorBrush x:Key="TextDim" Color="#A8ABB4"/>
        <SolidColorBrush x:Key="TextMute" Color="#767A83"/>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <ui:TitleBar Grid.Row="0" Title="EQ 프리셋 가져오기" Foreground="#F2F3F5" Padding="14,6"/>

        <Border Grid.Row="1" Style="{StaticResource NeonPopup}">
    <DockPanel Margin="20">
        <TextBlock DockPanel.Dock="Top" Text="이 EQ를 적용할까요?" FontSize="18" FontWeight="Bold" Margin="0,0,0,14"/>

        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,14,0,0">
            <Button Content="적용" Click="Ok_Click" Height="36" Padding="18,0" Margin="0,0,8,0"
                    Background="#4CC2FF" Foreground="#04222F" FontWeight="Bold" BorderThickness="0"/>
            <Button Content="취소" Click="Cancel_Click" Height="36" Padding="18,0"
                    Background="{StaticResource Card}" Foreground="{StaticResource TextDim}" BorderBrush="{StaticResource Stroke}"/>
        </StackPanel>

        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <StackPanel>
                <!-- target -->
                <Border Background="{StaticResource Card}" BorderBrush="{StaticResource Stroke}" BorderThickness="1"
                        CornerRadius="12" Padding="16" Margin="0,0,0,12">
                    <StackPanel>
                        <TextBlock Text="대상 기기" Foreground="{StaticResource TextMute}" FontSize="11"/>
                        <TextBlock x:Name="TxtTarget" FontSize="15" FontWeight="SemiBold" Margin="0,2,0,8"/>
                        <TextBlock x:Name="TxtMeta" Foreground="{StaticResource TextDim}" FontSize="12"/>
                        <TextBlock x:Name="TxtBands" Foreground="{StaticResource TextDim}" FontSize="12" Margin="0,6,0,10"/>
                        <TextBlock Text="작성자 노트" Foreground="{StaticResource TextMute}" FontSize="11"/>
                        <TextBlock x:Name="TxtNote" Foreground="{StaticResource TextDim}" FontSize="12" TextWrapping="Wrap" Margin="0,2,0,0"/>
                    </StackPanel>
                </Border>

                <!-- local DB match status -->
                <Border Background="{StaticResource Card}" BorderBrush="{StaticResource Stroke}" BorderThickness="1"
                        CornerRadius="12" Padding="16" Margin="0,0,0,12">
                    <StackPanel>
                        <TextBlock x:Name="MatchOk" Foreground="#4FD08A" FontSize="12" Visibility="Collapsed"
                                   Text="✓ 로컬 DB에 이 기기 프로파일이 있습니다. 바로 적용/재편집할 수 있습니다."/>
                        <Grid x:Name="MatchMissing" Visibility="Collapsed">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" VerticalAlignment="Center" Foreground="#FFB454" FontSize="12" TextWrapping="Wrap"
                                       Text="⚠ 이 기기 프로파일이 로컬 DB에 없습니다. EQ는 적용되지만, 정확도를 위해 DB를 업데이트해 받는 것을 권장합니다."/>
                            <Button Grid.Column="1" x:Name="BtnUpdateDb" Content="DB 업데이트" Click="BtnUpdateDb_Click"
                                    Height="32" Padding="12,0" Margin="8,0,0,0"
                                    Background="{StaticResource Card2}" Foreground="{StaticResource TextDim}" BorderBrush="{StaticResource Stroke}"/>
                        </Grid>
                    </StackPanel>
                </Border>

                <!-- history -->
                <Border Background="{StaticResource Card}" BorderBrush="{StaticResource Stroke}" BorderThickness="1"
                        CornerRadius="12" Padding="16">
                    <StackPanel>
                        <TextBlock Text="제작 히스토리 (AI 대화)" Foreground="{StaticResource TextDim}" FontWeight="Bold" Margin="0,0,0,10"/>
                        <ItemsControl x:Name="HistoryList">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Border Background="{StaticResource Card2}" CornerRadius="8" Padding="10,8" Margin="0,0,0,6">
                                        <StackPanel>
                                            <TextBlock Text="{Binding Role}" Foreground="{StaticResource TextMute}" FontSize="10" FontWeight="Bold"/>
                                            <TextBlock Text="{Binding Text}" Foreground="{StaticResource TextDim}" FontSize="12" TextWrapping="Wrap" Margin="0,2,0,0"/>
                                        </StackPanel>
                                    </Border>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </StackPanel>
                </Border>
            </StackPanel>
        </ScrollViewer>
    </DockPanel>
        </Border>
    </Grid>
</ui:FluentWindow>
