<!-- PRE-GENERATED (design session). DB manager popup (plain WPF). Mirrors design intent:
     현재 상태 · 데이터 출처 · 업데이트 진행. Renders now via DesignProfileDbService stub. -->
<ui:FluentWindow x:Class="DansoriEQ.App.DbManagerWindow"
        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"
        xmlns:ctrl="clr-namespace:DansoriEQ.App.Controls"
        Title="프로파일 데이터베이스" Height="620" Width="640"
        WindowStartupLocation="CenterOwner" ResizeMode="CanResize"
        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="Accent"  Color="#4CC2FF"/>
        <SolidColorBrush x:Key="TextDim" Color="#A8ABB4"/>
        <SolidColorBrush x:Key="TextMute" Color="#767A83"/>
        <Style x:Key="Lbl" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource TextMute}"/>
            <Setter Property="FontSize" Value="11"/>
        </Style>
        <Style x:Key="Val" TargetType="TextBlock">
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="FontWeight" Value="SemiBold"/>
            <Setter Property="Margin" Value="0,2,0,0"/>
        </Style>
    </Window.Resources>

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

        <ui:TitleBar Grid.Row="0" Title="프로파일 데이터베이스"
                     Foreground="#F2F3F5" Padding="14,6"/>

        <DockPanel Grid.Row="1" Margin="20,4,20,20">

        <!-- buttons (bottom-most) -->
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,14,0,0">
            <Button x:Name="BtnUpdate" Content="지금 업데이트" Click="BtnUpdate_Click"
                    Height="36" Padding="16,0" Margin="0,0,8,0"
                    Background="{StaticResource Accent}" Foreground="#04222F" FontWeight="Bold" BorderThickness="0"/>
            <Button x:Name="BtnClose" Content="닫기" Click="BtnClose_Click"
                    Height="36" Padding="16,0"
                    Background="{StaticResource Card}" Foreground="{StaticResource TextDim}" BorderBrush="{StaticResource Stroke}"/>
        </StackPanel>

        <!-- progress (above buttons) -->
        <Grid DockPanel.Dock="Bottom" Margin="0,12,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <ctrl:EqBarsFx x:Name="LoadBars" Grid.Column="0" Margin="0,0,12,0"
                           VerticalAlignment="Center" Visibility="Collapsed"/>
            <ProgressBar x:Name="UpdateProgress" Grid.Column="1" Height="8" Minimum="0" Maximum="100" Value="0"
                         Background="{StaticResource Card2}" Foreground="{StaticResource Accent}" BorderThickness="0"/>
            <TextBlock x:Name="TxtProgress" Grid.Column="2" Text="대기 중" Margin="12,0,0,0"
                       Foreground="{StaticResource TextMute}" FontSize="12" VerticalAlignment="Center"/>
        </Grid>

        <!-- content -->
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <StackPanel>
                <!-- current status -->
                <Border Background="{StaticResource Card}" BorderBrush="{StaticResource Stroke}" BorderThickness="1"
                        CornerRadius="12" Padding="16" Margin="0,0,0,14">
                    <StackPanel>
                        <TextBlock Text="현재 상태" Foreground="{StaticResource TextDim}" FontWeight="Bold" Margin="0,0,0,12"/>
                        <UniformGrid Columns="3">
                            <StackPanel Margin="0,0,0,12">
                                <TextBlock Style="{StaticResource Lbl}" Text="전체 프로파일"/>
                                <TextBlock x:Name="TxtTotal" Style="{StaticResource Val}" FontSize="20"/>
                            </StackPanel>
                            <StackPanel Margin="0,0,0,12">
                                <TextBlock Style="{StaticResource Lbl}" Text="이어폰(IEM)"/>
                                <TextBlock x:Name="TxtIem" Style="{StaticResource Val}"/>
                            </StackPanel>
                            <StackPanel Margin="0,0,0,12">
                                <TextBlock Style="{StaticResource Lbl}" Text="헤드폰"/>
                                <TextBlock x:Name="TxtHp" Style="{StaticResource Val}"/>
                            </StackPanel>
                            <StackPanel Margin="0,0,0,12">
                                <TextBlock Style="{StaticResource Lbl}" Text="최근 업데이트"/>
                                <TextBlock x:Name="TxtUpdated" Style="{StaticResource Val}"/>
                            </StackPanel>
                            <StackPanel Margin="0,0,0,12">
                                <TextBlock Style="{StaticResource Lbl}" Text="DB 크기"/>
                                <TextBlock x:Name="TxtSize" Style="{StaticResource Val}"/>
                            </StackPanel>
                            <StackPanel Margin="0,0,0,12">
                                <TextBlock Style="{StaticResource Lbl}" Text="스키마"/>
                                <TextBlock x:Name="TxtSchema" Style="{StaticResource Val}"/>
                            </StackPanel>
                        </UniformGrid>
                        <TextBlock Style="{StaticResource Lbl}" Text="파일 경로"/>
                        <TextBlock x:Name="TxtPath" Foreground="{StaticResource TextDim}" FontSize="12" TextWrapping="Wrap"/>
                    </StackPanel>
                </Border>

                <!-- sources -->
                <Border Background="{StaticResource Card}" BorderBrush="{StaticResource Stroke}" BorderThickness="1"
                        CornerRadius="12" Padding="16">
                    <StackPanel>
                        <TextBlock Text="데이터 출처 (Sources)" Foreground="{StaticResource TextDim}" FontWeight="Bold" Margin="0,0,0,10"/>
                        <ItemsControl x:Name="SourcesList">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Border Background="{StaticResource Card2}" CornerRadius="9" Padding="12,10" Margin="0,0,0,8">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>
                                            <StackPanel Grid.Column="0">
                                                <TextBlock Text="{Binding Name}" FontWeight="SemiBold" FontSize="13"/>
                                                <TextBlock FontSize="11" Foreground="{StaticResource TextMute}">
                                                    <Run Text="{Binding License}"/><Run Text=" · "/><Run Text="{Binding ProfileCount, StringFormat={}{0:N0}개}"/>
                                                </TextBlock>
                                            </StackPanel>
                                            <Border Grid.Column="1" CornerRadius="20" Padding="9,2" Margin="8,0" VerticalAlignment="Center" Background="#2D2D33">
                                                <TextBlock Text="{Binding DistributableText}" FontSize="11" Foreground="{StaticResource TextDim}"/>
                                            </Border>
                                            <TextBlock Grid.Column="2" Text="{Binding StatusText}" VerticalAlignment="Center" FontSize="11" Foreground="{StaticResource TextDim}"/>
                                        </Grid>
                                    </Border>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <TextBlock FontSize="11" Foreground="{StaticResource TextMute}" TextWrapping="Wrap" Margin="0,4,0,0"
                                   Text="※ '배포 제한' 출처는 로컬 사용만 가능하며 배포 빌드에서 제외됩니다. UI에는 구분 없이 함께 표시됩니다."/>
                    </StackPanel>
                </Border>
            </StackPanel>
        </ScrollViewer>
        </DockPanel>

        <!-- neon frame so the popup separates from the dark background -->
        <Border Grid.RowSpan="2" Margin="4" CornerRadius="10" IsHitTestVisible="False"
                BorderBrush="#4CC2FF" BorderThickness="1.5" Panel.ZIndex="999">
            <Border.Effect>
                <DropShadowEffect Color="#4CC2FF" BlurRadius="20" ShadowDepth="0" Opacity="0.45"/>
            </Border.Effect>
        </Border>
    </Grid>
</ui:FluentWindow>
