<Window x:Class="PerformanceMonitorDashboard.PurgeNowDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Purge Now"
        Height="320" Width="500"
        WindowStartupLocation="CenterOwner"
        ResizeMode="NoResize"
        Background="{DynamicResource BackgroundBrush}">
    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0" x:Name="HeaderText" TextWrapping="Wrap" FontSize="13" FontWeight="Bold"
                   Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,12"/>

        <TextBlock Grid.Row="1" Text="Purge mode:" Margin="0,0,0,4"
                   Foreground="{DynamicResource ForegroundBrush}"/>

        <ComboBox Grid.Row="2" x:Name="ModeComboBox" Height="28" Margin="0,0,0,12"
                  SelectionChanged="ModeComboBox_SelectionChanged">
            <ComboBoxItem Content="Use configured retention" IsSelected="True" Tag="configured"/>
            <ComboBoxItem Content="1 day" Tag="1"/>
            <ComboBoxItem Content="3 days" Tag="3"/>
            <ComboBoxItem Content="7 days" Tag="7"/>
            <ComboBoxItem Content="Custom..." Tag="custom"/>
            <ComboBoxItem x:Name="AllItem" Content="All — TRUNCATE everything" Tag="all"
                          Foreground="{DynamicResource ErrorBrush}"/>
        </ComboBox>

        <StackPanel Grid.Row="3" x:Name="CustomDaysPanel" Orientation="Horizontal" Margin="0,0,0,12"
                    Visibility="Collapsed">
            <TextBlock Text="Retention (days):" VerticalAlignment="Center" Margin="0,0,8,0"
                       Foreground="{DynamicResource ForegroundBrush}"/>
            <TextBox x:Name="CustomDaysBox" Width="80" Height="26" Padding="6,0,6,0"
                     VerticalContentAlignment="Center"
                     Text="14" PreviewTextInput="CustomDaysBox_PreviewTextInput"/>
        </StackPanel>

        <TextBlock Grid.Row="4" x:Name="WarningText" TextWrapping="Wrap" FontSize="11"
                   Foreground="{DynamicResource ErrorBrush}" Margin="0,4,0,8"/>

        <StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button x:Name="PurgeButton" Content="Purge" Width="80" Height="28" Margin="0,0,8,0" Click="Purge_Click"/>
            <Button Content="Cancel" Width="80" Height="28" Click="Cancel_Click" IsCancel="True"/>
        </StackPanel>
    </Grid>
</Window>
