<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Win11Debloat" 
        MinWidth="1130" MinHeight="600"
        MaxWidth="1400"
        ResizeMode="CanResize" 
        SnapsToDevicePixels="True"
        WindowStartupLocation="CenterScreen"
        WindowStyle="None"
        AllowsTransparency="True"
        Background="Transparent"
        Foreground="{DynamicResource FgColor}">
    <Window.Resources>
        <!-- ComboBox Style -->
        <Style TargetType="ComboBox">
            <Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Margin" Value="0,4,0,12"/>
            <Setter Property="MinHeight" Value="33"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid>
                            <!-- Left accent line -->
                            <Border x:Name="ClosedAccentLine" Width="3" Height="18" HorizontalAlignment="Left" VerticalAlignment="Stretch" Background="{DynamicResource ButtonBg}" CornerRadius="1.5" Panel.ZIndex="2"/>
                            <ToggleButton x:Name="ToggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Focusable="False" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
                                <ToggleButton.Style>
                                    <Style TargetType="ToggleButton">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="ToggleButton">
                                                    <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4">
                                                        <TextBlock x:Name="Arrow"
                                                                Text="&#xE70D;"
                                                                FontFamily="Segoe Fluent Icons"
                                                                FontSize="10"
                                                                HorizontalAlignment="Right"
                                                                VerticalAlignment="Center"
                                                                Margin="0,0,8,0"
                                                                Foreground="{DynamicResource FgColor}"
                                                                RenderTransformOrigin="0.5,0.5">
                                                            <TextBlock.RenderTransform>
                                                                <RotateTransform x:Name="ArrowRotation" Angle="0"/>
                                                            </TextBlock.RenderTransform>
                                                        </TextBlock>
                                                    </Border>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource ComboHoverColor}"/>
                                                        </Trigger>
                                                        <Trigger Property="IsChecked" Value="True">
                                                            <Trigger.EnterActions>
                                                                <BeginStoryboard>
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="Arrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="180" Duration="0:0:0.2">
                                                                            <DoubleAnimation.EasingFunction>
                                                                                <CubicEase EasingMode="EaseOut"/>
                                                                            </DoubleAnimation.EasingFunction>
                                                                        </DoubleAnimation>
                                                                    </Storyboard>
                                                                </BeginStoryboard>
                                                            </Trigger.EnterActions>
                                                            <Trigger.ExitActions>
                                                                <BeginStoryboard>
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="Arrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="0" Duration="0:0:0.2">
                                                                            <DoubleAnimation.EasingFunction>
                                                                                <CubicEase EasingMode="EaseOut"/>
                                                                            </DoubleAnimation.EasingFunction>
                                                                        </DoubleAnimation>
                                                                    </Storyboard>
                                                                </BeginStoryboard>
                                                            </Trigger.ExitActions>
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </ToggleButton.Style>
                            </ToggleButton>
                            <ContentPresenter x:Name="ContentPresenter"
                                            IsHitTestVisible="False"
                                            Margin="10,0,20,0"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Center"
                                            Content="{TemplateBinding SelectionBoxItem}"
                                            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
                            <Popup x:Name="Popup"
                                Placement="Bottom"
                                IsOpen="{TemplateBinding IsDropDownOpen}"
                                AllowsTransparency="True"
                                Focusable="False"
                                PopupAnimation="Fade"
                                StaysOpen="False"
                                PlacementTarget="{Binding ElementName=ToggleButton}"
                                VerticalOffset="1"
                                HorizontalOffset="0">
                                <Grid x:Name="DropDown" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                    <Border x:Name="DropDownBorder"
                                            Background="{DynamicResource ComboItemBgColor}"
                                            BorderBrush="{DynamicResource BorderColor}"
                                            BorderThickness="1"
                                            CornerRadius="4"
                                            Padding="5,4,5,1">
                                        <ScrollViewer Margin="0,2,0,0"
                                                    VerticalScrollBarVisibility="Auto"
                                                    HorizontalScrollBarVisibility="Disabled">
                                            <ItemsPresenter Margin="0,0,0,1"/>
                                        </ScrollViewer>
                                    </Border>
                                </Grid>
                            </Popup>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="SelectedIndex" Value="0">
                                <Setter TargetName="ClosedAccentLine" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="SelectedIndex" Value="-1">
                                <Setter TargetName="ClosedAccentLine" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="ClosedAccentLine" Property="Visibility" Value="Collapsed"/>
                                <Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
                                <Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
                                <Setter Property="Opacity" Value="0.6"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ComboBoxItem Style -->
        <Style TargetType="ComboBoxItem">
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Padding" Value="10,8"/>
            <Setter Property="Margin" Value="0,0,0,4"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBoxItem">
                        <Grid>
                            <Border x:Name="ItemBorder"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Padding="{TemplateBinding Padding}"
                                    CornerRadius="4">
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                            <!-- Left accent line -->
                            <Border x:Name="AccentLine"
                                    Width="3"
                                    Height="15"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Stretch"
                                    Background="{DynamicResource ButtonBg}"
                                    CornerRadius="1.5"
                                    Margin="0"
                                    Visibility="Collapsed"/>
                        </Grid>
                        <ControlTemplate.Triggers> 
                            <Trigger Property="IsSelected" Value="True">
                                <Setter TargetName="AccentLine" Property="Visibility" Value="Visible"/>
                                <Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource ComboItemSelectedColor}"/>
                            </Trigger>
                            <Trigger Property="IsHighlighted" Value="True">
                                <Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource ComboItemHoverColor}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- TextBlock Label Style -->
        <Style x:Key="LabelStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Margin" Value="0,0,0,2"/>
        </Style>

        <!-- Label Border Style for ComboBox labels -->
        <Style x:Key="LabelBorderStyle" TargetType="Border">
            <Setter Property="CornerRadius" Value="4"/>
            <Setter Property="Padding" Value="6,2"/>
            <Setter Property="Margin" Value="-4,-2,-4,0"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
        </Style>

        <!-- Category card border style -->
        <Style x:Key="CategoryCardBorderStyle" TargetType="Border">
            <Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="CornerRadius" Value="4"/>
            <Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
            <Setter Property="Padding" Value="16,12,16,2"/>
            <Setter Property="Margin" Value="0,0,0,16"/>
        </Style>

        <!-- Category header text style -->
        <Style x:Key="CategoryHeaderTextBlock" TargetType="TextBlock">
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="Margin" Value="0,0,0,13"/>
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
        </Style>

        <!-- Category header icon style -->
        <Style x:Key="CategoryHeaderIcon" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe Fluent Icons"/>
            <Setter Property="FontSize" Value="19"/>
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="Margin" Value="0,0,8,12"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>

        <!-- Category help link button/text styles -->
        <Style x:Key="CategoryHelpLinkButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Margin" Value="6,1,0,13"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Focusable" Value="False"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Foreground" Value="{DynamicResource ButtonHover}"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Foreground" Value="{DynamicResource ButtonPressed}"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="CategoryHelpLinkTextStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Foreground">
                <Setter.Value>
                    <Binding RelativeSource="{RelativeSource AncestorType=Button}" Path="Foreground"/>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Overview changes text style -->
        <Style x:Key="OverviewNoChangesTextStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="Margin" Value="0,0,0,8"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontStyle" Value="Italic"/>
        </Style>

        <Style x:Key="OverviewChangeBulletStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="Margin" Value="0,0,0,8"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="TextWrapping" Value="Wrap"/>
        </Style>

        <!-- TextBox Style for search -->
        <Style TargetType="TextBox">
            <Setter Property="CaretBrush" Value="{DynamicResource FgColor}"/>
        </Style>

        <!-- User TextBox Style with disabled state -->
        <Style x:Key="UserTextBoxStyle" TargetType="TextBox">
            <Setter Property="CaretBrush" Value="{DynamicResource FgColor}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="FontSize" Value="13"/>
            <Setter Property="Margin" Value="1,0,0,1"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Padding" Value="0"/>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
                    <Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
                    <Setter Property="Opacity" Value="0.6"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- User TextBox Border Style with disabled state -->
        <Style x:Key="UserTextBoxBorderStyle" TargetType="Border">
            <Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="CornerRadius" Value="4"/>
            <Setter Property="Padding" Value="8,6"/>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
                    <Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
                    <Setter Property="Opacity" Value="0.6"/>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource ComboHoverColor}"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- CheckBox Style -->
        <Style TargetType="CheckBox">
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Padding" Value="4,2"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <Border Background="{TemplateBinding Background}" BorderThickness="0" CornerRadius="4" Padding="{TemplateBinding Padding}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border x:Name="CheckBoxBorder" Grid.Column="0" Width="18" Height="18" Background="{DynamicResource CheckBoxBgColor}" BorderBrush="{DynamicResource CheckBoxBorderColor}" BorderThickness="1" CornerRadius="4" Margin="0,0,8,0">
                                    <TextBlock x:Name="CheckMark" Text="&#xE73E;" FontFamily="Segoe Fluent Icons" FontSize="12" Foreground="{DynamicResource ButtonBg}" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
                                </Border>
                                <ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="0,0,0,2"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource CheckBoxHoverColor}"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
                                <Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonBg}"/>
                                <Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
                                <Setter TargetName="CheckMark" Property="Foreground" Value="White"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonDisabled}"/>
                                <Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
                                <Setter Property="Opacity" Value="0.6"/>
                                <Setter TargetName="CheckMark" Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsMouseOver" Value="True"/>
                                    <Condition Property="IsChecked" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonHover}"/>
                                <Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- CheckBox style for feature toggles -->
        <Style x:Key="FeatureCheckboxStyle" TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
            <Setter Property="Margin" Value="-4,-2,-4,10"/>
            <Setter Property="Padding" Value="4,2"/>
        </Style>

        <!-- CheckBox style for apps panels -->
        <Style x:Key="AppsPanelCheckBoxStyle" TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
            <Setter Property="Margin" Value="2,3,2,3"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
        </Style>

        <!-- TextBlock style for App ID column in apps table -->
        <Style x:Key="AppIdTextStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{DynamicResource AppIdColor}"/>
            <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>

        <!-- TextBlock style for App Name column in apps table -->
        <Style x:Key="AppNameTextStyle" TargetType="TextBlock">
            <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>

        <!-- TextBlock style for Description column in apps table -->
        <Style x:Key="AppDescTextStyle" TargetType="TextBlock">
            <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="8,0,8,0"/>
        </Style>

        <!-- Column widths for the apps table row grid -->
        <GridLength x:Key="AppTableCol0Width">160</GridLength>
        <GridLength x:Key="AppTableCol1Width">1*</GridLength>
        <GridLength x:Key="AppTableCol2Width">286</GridLength>

        <!-- Title Bar Button Style -->
        <Style x:Key="TitleBarButton" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Width" Value="46"/>
            <Setter Property="Height" Value="32"/>
            <Setter Property="FontFamily" Value="Segoe Fluent Icons"/>
            <Setter Property="FontSize" Value="10"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" BorderThickness="0" CornerRadius="0,8,0,0">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="CloseButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource CloseHover}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="TitlebarButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" BorderThickness="0" CornerRadius="0">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- SearchBox Border Style -->
        <Style x:Key="SearchBoxBorderStyle" TargetType="Border">
            <Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="CornerRadius" Value="4"/>
            <Setter Property="Width" Value="300"/>
            <Setter Property="Padding" Value="8,6"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource ComboHoverColor}"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- ContextMenu Style -->
        <Style TargetType="ContextMenu">
            <Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Padding" Value="4"/>
            <Setter Property="HasDropShadow" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ContextMenu">
                        <Border Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="4"
                                Padding="{TemplateBinding Padding}">
                            <StackPanel IsItemsHost="True"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- MenuItem Style -->
        <Style TargetType="MenuItem">
            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Padding" Value="8,6"/>
            <Setter Property="Height" Value="32"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="MenuItem">
                        <Border Background="{TemplateBinding Background}"
                                BorderThickness="0"
                                CornerRadius="4"
                                Padding="{TemplateBinding Padding}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="24"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <ContentPresenter Grid.Column="0" ContentSource="Icon" 
                                                VerticalAlignment="Center"
                                                HorizontalAlignment="Center"/>
                                <ContentPresenter Grid.Column="1" ContentSource="Header" 
                                                VerticalAlignment="Center"
                                                Margin="8,0,0,1"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="True">
                                <Setter Property="Background" Value="{DynamicResource ComboItemHoverColor}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" Value="{DynamicResource ComboItemSelectedColor}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <Border BorderBrush="{DynamicResource BorderColor}" 
            BorderThickness="1" 
            CornerRadius="8" 
            Background="{DynamicResource BgColor}"
            Margin="25">
        <Border.Effect>
            <DropShadowEffect Color="Black" 
                            Opacity="0.15" 
                            BlurRadius="20" 
                            ShadowDepth="0" 
                            Direction="0"/>
        </Border.Effect>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="32"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <!-- Resize Borders -->
            <Rectangle x:Name="ResizeLeft" Width="5" HorizontalAlignment="Left" Fill="Transparent" Cursor="SizeWE" Grid.Row="0" Grid.RowSpan="3" Panel.ZIndex="100"/>
            <Rectangle x:Name="ResizeRight" Width="5" HorizontalAlignment="Right" Fill="Transparent" Cursor="SizeWE" Grid.Row="0" Grid.RowSpan="3" Panel.ZIndex="100"/>
            <Rectangle x:Name="ResizeTop" Height="5" VerticalAlignment="Top" Fill="Transparent" Cursor="SizeNS" Grid.Row="0" Panel.ZIndex="100"/>
            <Rectangle x:Name="ResizeBottom" Height="5" VerticalAlignment="Bottom" Fill="Transparent" Cursor="SizeNS" Grid.Row="2" Panel.ZIndex="100"/>
            <Rectangle x:Name="ResizeTopLeft" Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="Transparent" Cursor="SizeNWSE" Grid.Row="0" Panel.ZIndex="101"/>
            <Rectangle x:Name="ResizeTopRight" Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Top" Fill="Transparent" Cursor="SizeNESW" Grid.Row="0" Panel.ZIndex="101"/>
            <Rectangle x:Name="ResizeBottomLeft" Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Bottom" Fill="Transparent" Cursor="SizeNESW" Grid.Row="2" Panel.ZIndex="101"/>
            <Rectangle x:Name="ResizeBottomRight" Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Bottom" Fill="Transparent" Cursor="SizeNWSE" Grid.Row="2" Panel.ZIndex="101"/>

            <!-- Custom Title Bar -->
            <Grid Grid.Row="0" x:Name="TitleBar">
                <Border Background="{DynamicResource BgColor}" CornerRadius="8,8,0,0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" 
                                   Text="Win11Debloat" 
                                   Foreground="{DynamicResource FgColor}"
                                   VerticalAlignment="Center" 
                                   Margin="12,0,0,0"
                                   FontSize="12"/>
                        <StackPanel Grid.Column="1" Orientation="Horizontal">
                            <Button x:Name="KofiBtn" Content="&#xEB52;" FontFamily="Segoe Fluent Icons" FontSize="15" Style="{StaticResource TitlebarButton}" ToolTip="Support the creator" AutomationProperties.Name="Support the creator"/>
                            <Button x:Name="MenuBtn" Content="&#xE700;" FontFamily="Segoe Fluent Icons" FontSize="15" Style="{StaticResource TitlebarButton}" ToolTip="Options" AutomationProperties.Name="Options">
                                <Button.ContextMenu>
                                    <ContextMenu x:Name="MainMenu">
                                        <MenuItem x:Name="MenuDocumentation" Header="Documentation" AutomationProperties.Name="Documentation">
                                            <MenuItem.Icon>
                                                <TextBlock Text="&#xe736;" FontFamily="Segoe MDL2 Assets" FontSize="16" Foreground="{DynamicResource FgColor}"/>
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem x:Name="MenuReportBug" Header="Report a bug" AutomationProperties.Name="Report a bug">
                                            <MenuItem.Icon>
                                                <TextBlock Text="&#xEBE8;" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem x:Name="MenuLogs" Header="Logs" AutomationProperties.Name="Logs">
                                            <MenuItem.Icon>
                                                <TextBlock Text="&#xf000;" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem x:Name="MenuAbout" Header="About" AutomationProperties.Name="About">
                                            <MenuItem.Icon>
                                                <TextBlock Text="&#xE946;" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
                                            </MenuItem.Icon>
                                        </MenuItem>
                                    </ContextMenu>
                                </Button.ContextMenu>
                            </Button>
                            <Button x:Name="CloseBtn" Content="&#xE8BB;" Style="{StaticResource CloseButton}" ToolTip="Close" AutomationProperties.Name="Close"/>
                        </StackPanel>
                    </Grid>
                </Border>
            </Grid>

            <!-- Main Content with Tabs -->
            <TabControl Grid.Row="1" Background="Transparent" BorderThickness="0" Margin="0" Padding="0" Name="MainTabControl">
                <TabControl.Resources>
                    <Style TargetType="TabItem">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="TabItem">
                                    <Border Name="Border" Background="{DynamicResource SecondaryButtonBg}" BorderThickness="0" CornerRadius="0" Padding="10,10" Margin="0">
                                        <ContentPresenter ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource ButtonBg}"/>
                                            <Setter Property="Foreground" Value="White"/>
                                        </Trigger>
                                        <Trigger Property="IsSelected" Value="False">
                                            <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </TabControl.Resources>
                <TabControl.ItemContainerStyle>
                    <Style TargetType="TabItem">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </Style>
                </TabControl.ItemContainerStyle>

                <!-- Home Tab -->
                <TabItem Header="Home" x:Name="HomeTab">
                    <Grid>
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="600">
                            <!-- Logo -->
                            <Viewbox Width="220" Height="220" Margin="0,32,0,10" HorizontalAlignment="Center">
                                <Grid Width="220" Height="220">
                                    <!-- Windows logo style icon -->
                                    <Path x:Name="LogoFallback" Data="M0,0 L80,0 L80,80 L0,80 Z M90,0 L170,0 L170,80 L90,80 Z M0,90 L80,90 L80,170 L0,170 Z M90,90 L170,90 L170,170 L90,170 Z" 
                                        Fill="{DynamicResource ButtonBg}" Stretch="Uniform" Margin="10"/>
                                    <!-- Sparkle effects -->
                                    <Canvas HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="45" Height="45" Margin="0,0,2,2">
                                        <Path Canvas.Left="10" Canvas.Top="16" Data="M12,0 L14,10 L24,12 L14,14 L12,24 L10,14 L0,12 L10,10 Z" 
                                              Fill="{DynamicResource AccentColor}" Width="38" Height="38" Stretch="Uniform"/>
                                        <Path Canvas.Left="0" Canvas.Top="0" Data="M6,0 L7,5 L12,6 L7,7 L6,12 L5,7 L0,6 L5,5 Z" 
                                              Fill="{DynamicResource AccentColor}" Width="20" Height="20" Stretch="Uniform"/>
                                        <Path Canvas.Left="35" Canvas.Top="8" Data="M4,0 L5,3 L8,4 L5,5 L4,8 L3,5 L0,4 L3,3 Z" 
                                              Fill="{DynamicResource AccentColor}" Width="15" Height="15" Stretch="Uniform"/>
                                    </Canvas>
                                    <!-- Actual logo image if available -->
                                    <Image x:Name="LogoImage" Stretch="Uniform"/>
                                </Grid>
                            </Viewbox>
                            
                            <!-- Title -->
                            <TextBlock Text="Welcome to Win11Debloat" FontSize="28" FontWeight="Bold" Foreground="{DynamicResource FgColor}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Foreground="{DynamicResource FgColor}" FontSize="16" LineHeight="22" HorizontalAlignment="Center" Margin="0,0,0,30">
                                <Run Text="Your clean Windows experience is just a few clicks away!"/>
                            </TextBlock>
                            
                            <!-- Action Buttons -->
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,20,0,0">
                                <Button x:Name="HomeDefaultModeBtn" Width="180" Height="50" Style="{DynamicResource PrimaryButtonStyle}" Margin="0,0,12,0" AutomationProperties.Name="Default Mode">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                        <TextBlock Text="&#xe735;" FontFamily="Segoe Fluent Icons" FontSize="16" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                        <TextBlock Text="Default Mode" ToolTip="Quickly select the recommended settings" FontWeight="SemiBold" VerticalAlignment="Center" FontSize="17" Margin="0,0,0,2"/>
                                    </StackPanel>
                                </Button>
                                <Button x:Name="HomeStartBtn" Width="180" Height="50" Style="{DynamicResource SecondaryButtonStyle}" AutomationProperties.Name="Custom Setup">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                        <TextBlock Text="&#xe90f;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                        <TextBlock Text="Custom Setup" ToolTip="Manually select your preferred settings" FontWeight="SemiBold" VerticalAlignment="Center" FontSize="17" Margin="0,0,0,2"/>
                                    </StackPanel>
                                </Button>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </TabItem>

                <!-- App Removal Tab -->
                <TabItem Header="App Removal">
                    <DockPanel>
                        <Border DockPanel.Dock="Top" Padding="20,10,20,0">
                            <StackPanel>
                                <TextBlock Text="App Removal" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
                                <TextBlock Text="Select which apps you want to remove from your system" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>

                                <!-- Filter Options -->
                                <Grid Margin="0,0,0,12">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="10"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    
                                    <StackPanel Orientation="Horizontal" Grid.Column="0">
                                        <Button x:Name="DefaultAppsBtn" Content="Select Default Apps" ToolTip="Select the default selection of apps" Style="{DynamicResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Default Apps"/>
                                        <Button x:Name="LoadLastUsedAppsBtn" Content="Select Last Used Selection" ToolTip="Select the apps that were selected the last time Win11Debloat was run" Style="{DynamicResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Selection"/>
                                        <Button x:Name="ClearAppSelectionBtn" Content="Clear Selection" ToolTip="Clear all selected apps" Style="{DynamicResource SecondaryButtonStyle}" Height="32"  Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
                                    </StackPanel>
                                    
                                    <CheckBox x:Name="OnlyInstalledAppsBox" Grid.Column="2" Content="Only show installed apps" IsChecked="False" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" AutomationProperties.Name="Only show installed apps"/>

                                    <Border x:Name="AppSearchBorder" Grid.Column="4">
                                        <Border.Style>
                                            <Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ElementName=AppSearchBox, Path=IsFocused}" Value="True">
                                                        <Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Border.Style>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
                                            <TextBlock x:Name="AppSearchPlaceholder" Grid.Column="1" Text="Search app" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
                                            <TextBox x:Name="AppSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text="" AutomationProperties.Name="Search app"/>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </StackPanel>
                        </Border>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            
                            <!-- Apps List -->
                            <Grid Grid.Row="0" Margin="20,0,20,10">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <!-- Column Headers -->
                                <Border Grid.Row="0" Background="{DynamicResource TableHeaderColor}" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0">
                                    <Grid Margin="26,6,8,8">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="160"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="300"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Grid.Column="0" Text="Name" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource FgColor}" Margin="16,0,0,0"/>
                                        <TextBlock Grid.Column="1" Text="Description" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource FgColor}" Margin="24,0,0,0"/>
                                        <TextBlock Grid.Column="2" Text="App ID" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource FgColor}"/>
                                    </Grid>
                                </Border>
                                <!-- Apps content -->
                                <Border Grid.Row="1" BorderBrush="{DynamicResource BorderColor}" CornerRadius="0,0,4,4" BorderThickness="1" Background="{DynamicResource CardBgColor}" Padding="0,1,1,1">
                                    <Grid>
                                        <ScrollViewer VerticalScrollBarVisibility="Visible">
                                            <StackPanel x:Name="AppSelectionPanel" Margin="10,4,0,4"/>
                                        </ScrollViewer>
                                        <Border x:Name="LoadingAppsIndicator" CornerRadius="0,0,4,4" Background="{DynamicResource CardBgColor}" Opacity="0.8" Visibility="Collapsed">
                                            <TextBlock Text="Loading apps..." FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource FgColor}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                        </Border>
                                    </Grid>
                                </Border>
                            </Grid>

                            <!-- Status Info -->
                            <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20,0,20,0">
                                <TextBlock x:Name="AppSelectionStatus" Text="" Foreground="{DynamicResource FgColor}" Margin="10,0,0,5" HorizontalAlignment="Left"/>
                            </StackPanel>
                        </Grid>
                    </DockPanel>
                </TabItem>

                <!-- Tweaks Tab -->
                <TabItem Header="Tweaks">
                    <DockPanel>
                        <Border DockPanel.Dock="Top" Padding="20,10,20,0" Background="{DynamicResource BgColor}">
                            <StackPanel>
                                <TextBlock Text="System Tweaks" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
                                <TextBlock Text="Select which tweaks you want to apply to your system, hover over settings for more information" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
                            
                                <!-- Filter Options -->
                                <Grid Margin="0,0,0,12">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    
                                    <StackPanel Grid.Column="0" Orientation="Horizontal">
                                        <Button x:Name="LoadDefaultsBtn" Content="Select Default Settings" ToolTip="Select the settings that are recommended for most people" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Default Settings"/>
                                        <Button x:Name="LoadLastUsedBtn" Content="Select Last Used Settings" ToolTip="Select the settings that were used the last time Win11Debloat was run" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Settings"/>
                                        <Button x:Name="ClearAllTweaksBtn" Content="Clear Selection" ToolTip="Clear all selected tweaks" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
                                    </StackPanel>

                                    <Border x:Name="TweakSearchBorder" Grid.Column="2">
                                        <Border.Style>
                                            <Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding ElementName=TweakSearchBox, Path=IsFocused}" Value="True">
                                                        <Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Border.Style>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
                                            <TextBlock x:Name="TweakSearchPlaceholder" Grid.Column="1" Text="Search setting" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
                                            <TextBox x:Name="TweakSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text=""/>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </StackPanel>
                        </Border>
                        <Grid>
                            <ScrollViewer x:Name="TweaksScrollViewer" VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
                                <Grid x:Name="TweaksGrid" Margin="0,10,0,5">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <!-- Column 1: Dynamically populated -->
                                    <StackPanel Grid.Column="0" x:Name="Column0Panel" Margin="0,0,15,0"/>

                                    <!-- Column 2: Dynamically populated -->
                                    <StackPanel Grid.Column="1" x:Name="Column1Panel" Margin="0,0,15,0"/>

                                    <!-- Column 3: Dynamically populated -->
                                    <StackPanel Grid.Column="2" x:Name="Column2Panel"/>
                                </Grid>
                            </ScrollViewer>
                            <!-- Top fade gradient -->
                            <Border IsHitTestVisible="False" VerticalAlignment="Top" Height="10" Margin="0,-12,20,0" Background="{DynamicResource BgColor}">
                                <Border.OpacityMask>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Color="Black" Offset="0"/>
                                        <GradientStop Color="Black" Offset="0.5"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.OpacityMask>
                            </Border>
                            <!-- Bottom fade gradient -->
                            <Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource BgColor}">
                                <Border.OpacityMask>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Color="Transparent" Offset="0"/>
                                        <GradientStop Color="Black" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.OpacityMask>
                            </Border>
                        </Grid>
                    </DockPanel>
                </TabItem>

                <!-- Deployment Settings Tab -->
                <TabItem Header="Deployment Settings" x:Name="DeploymentSettingsTab">
                    <DockPanel>
                        <Border DockPanel.Dock="Top" Padding="20,10,20,0">
                            <StackPanel>
                                <TextBlock Text="Deployment Settings" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
                                <TextBlock Text="Configure how your changes will be applied and more" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
                            </StackPanel>
                        </Border>

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

                            <Grid Grid.Row="0">
                                <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
                                    <Grid Margin="0,10,0,5">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <!-- Apply Changes To -->
                                        <Border Grid.Row="0" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
                                            <StackPanel>
                                                <TextBlock Text="Apply Changes To" Style="{StaticResource CategoryHeaderTextBlock}"/>
                                                <ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,6" AutomationProperties.Name="Apply Changes To">
                                                    <ComboBoxItem Content="Current User" IsSelected="True"/>
                                                    <ComboBoxItem Content="Other User"/>
                                                    <ComboBoxItem Content="Windows Default User (Sysprep)"/>
                                                </ComboBox>
                                                <StackPanel x:Name="OtherUserPanel" Visibility="Collapsed" Margin="0,0,0,6">
                                                    <TextBlock x:Name="UsernameValidationMessage" Text="" FontStyle="Italic" Foreground="{DynamicResource CloseHover}" FontSize="11" Margin="3,0,0,4" TextWrapping="Wrap"/>
                                                    <Border IsEnabled="{Binding ElementName=OtherUsernameTextBox, Path=IsEnabled}">
                                                        <Border.Style>
                                                            <Style TargetType="Border" BasedOn="{StaticResource UserTextBoxBorderStyle}">
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding ElementName=OtherUsernameTextBox, Path=IsFocused}" Value="True">
                                                                        <Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Border.Style>
                                                        <Grid>
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="Auto"/>
                                                                <ColumnDefinition Width="*"/>
                                                            </Grid.ColumnDefinitions>
                                                            <TextBlock Grid.Column="0" Text="&#xE77B;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
                                                            <TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="1" Text="Enter username" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
                                                            <TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/>
                                                        </Grid>
                                                    </Border>
                                                </StackPanel>
                                                <TextBlock x:Name="UserSelectionDescription" Text="Changes will be applied to the currently logged-in user profile." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
                                            </StackPanel>
                                        </Border>

                                        <!-- App Removal Scope -->
                                        <Border Grid.Row="1" x:Name="AppRemovalScopeSection" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
                                            <StackPanel>
                                                <TextBlock Text="Remove Apps For" Style="{StaticResource CategoryHeaderTextBlock}"/>
                                                <ComboBox x:Name="AppRemovalScopeCombo" Margin="0,0,0,6" AutomationProperties.Name="App Removal Scope">
                                                    <ComboBoxItem x:Name="AppRemovalScopeAllUsers" Content="All users" IsSelected="True"/>
                                                    <ComboBoxItem x:Name="AppRemovalScopeCurrentUser" Content="Current user only"/>
                                                    <ComboBoxItem x:Name="AppRemovalScopeTargetUser" Content="Target user only" Visibility="Collapsed"/>
                                                </ComboBox>
                                                <TextBlock x:Name="AppRemovalScopeDescription" Text="Apps will be removed for all users and from the Windows image to prevent reinstallation for new users." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
                                            </StackPanel>
                                        </Border>

                                        <!-- Options -->
                                        <Border Grid.Row="2" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,3" Margin="0,0,0,16">
                                            <StackPanel>
                                                <TextBlock Text="Options" Style="{StaticResource CategoryHeaderTextBlock}"/>

                                                <!-- Restore Point Option -->
                                                <StackPanel>
                                                    <CheckBox x:Name="RestorePointCheckBox" Style="{StaticResource FeatureCheckboxStyle}" IsChecked="True" Content="Create a system restore point (Recommended)" AutomationProperties.Name="Create a system restore point (Recommended)"/>
                                                </StackPanel>
                                                
                                                <!-- Restart Explorer Option -->
                                                <StackPanel>
                                                    <CheckBox x:Name="RestartExplorerCheckBox" Style="{StaticResource FeatureCheckboxStyle}" Content="Restart the Windows Explorer process to apply all changes immediately" AutomationProperties.Name="Restart the Windows Explorer process to apply all changes immediately"/>
                                                </StackPanel>
                                            </StackPanel>
                                        </Border>
                                    </Grid>
                                </ScrollViewer>
                                <!-- Top fade gradient -->
                                <Border IsHitTestVisible="False" VerticalAlignment="Top" Height="10" Margin="0,-12,20,0" Background="{DynamicResource BgColor}">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                            <GradientStop Color="Black" Offset="0"/>
                                            <GradientStop Color="Black" Offset="0.5"/>
                                            <GradientStop Color="Transparent" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <!-- Bottom fade gradient -->
                                <Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource BgColor}">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                            <GradientStop Color="Transparent" Offset="0"/>
                                            <GradientStop Color="Black" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                            </Grid>

                            <!-- Review & Apply Section -->
                            <StackPanel Grid.Row="1" HorizontalAlignment="Stretch" Background="{DynamicResource BgColor}">
                                <Button x:Name="ReviewChangesBtn" Background="Transparent" BorderThickness="0" Cursor="Hand" HorizontalAlignment="Center" Margin="0,4,0,8" AutomationProperties.Name="Review selected changes">
                                    <Button.Template>
                                        <ControlTemplate TargetType="Button">
                                            <TextBlock x:Name="LinkText" Text="Review selected changes" FontSize="14" Foreground="{DynamicResource ButtonBg}" FontWeight="SemiBold" HorizontalAlignment="Center"/>
                                            <ControlTemplate.Triggers>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonHover}"/>
                                                </Trigger>
                                                <Trigger Property="IsPressed" Value="True">
                                                    <Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonPressed}"/>
                                                </Trigger>
                                            </ControlTemplate.Triggers>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Button x:Name="DeploymentApplyBtn" Style="{DynamicResource PrimaryButtonStyle}" Width="190" Height="44" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                        <TextBlock Text="&#xE73E;" FontFamily="Segoe Fluent Icons" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/>
                                        <TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/>
                                    </StackPanel>
                                </Button>
                            </StackPanel>
                        </Grid>
                    </DockPanel>
                </TabItem>
            </TabControl>

            <!-- Bottom Navigation Buttons -->
            <Grid Grid.Row="2" Height="56" x:Name="BottomNavGrid">
                <Grid Margin="20,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{DynamicResource SecondaryButtonStyle}" Visibility="Collapsed" Margin="10,0,0,0" AutomationProperties.Name="Back">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                            <TextBlock Text="&#xE72B;" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="0,0,8,0" VerticalAlignment="Center"/>
                            <TextBlock Text="Back" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
                        </StackPanel>
                    </Button>
                    
                    <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{DynamicResource PrimaryButtonStyle}" AutomationProperties.Name="Next">
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                <TextBlock Text="Next" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
                                <TextBlock Text="&#xE72A;" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Button>
                    </StackPanel>
                </Grid>
                
                <!-- Progress Indicators - Centered independently -->
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Ellipse x:Name="ProgressIndicator1" Width="10" Height="10" Margin="4,0" Fill="#808080" ToolTip="App Removal"/>
                    <Ellipse x:Name="ProgressIndicator2" Width="10" Height="10" Margin="4,0" Fill="#808080" ToolTip="System Tweaks"/>
                    <Ellipse x:Name="ProgressIndicator3" Width="10" Height="10" Margin="4,0" Fill="#808080" ToolTip="Deployment Settings"/>
                </StackPanel>
            </Grid>
            
            <!-- Modal Overlay for MessageBoxes -->
            <Rectangle x:Name="ModalOverlay" 
                       Grid.RowSpan="3" 
                       Fill="#80000000" 
                       Visibility="Collapsed" 
                       Panel.ZIndex="1000"
                       RadiusX="8"
                       RadiusY="8"
                       Margin="-1"/>
        </Grid>
    </Border>
</Window>
