<Application x:Class="XLAB.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:XLAB"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <LinearGradientBrush x:Key="AppWindowBackgroundBrush" StartPoint="0,0" EndPoint="1,1">
            <GradientStop Color="#FFF8FAFD" Offset="0" />
            <GradientStop Color="#FFF2F6FB" Offset="1" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="AppSurfaceBrush" Color="#FFFFFFFF" />
        <SolidColorBrush x:Key="AppAccentBrush" Color="#FF5C7FA8" />
        <SolidColorBrush x:Key="AppAccentSoftBrush" Color="#FFDDE8F3" />
        <SolidColorBrush x:Key="AppBorderBrush" Color="#FFC9D6E2" />
        <SolidColorBrush x:Key="AppTextBrush" Color="#FF263645" />
        <SolidColorBrush x:Key="AppMutedTextBrush" Color="#FF6B7B88" />
        <SolidColorBrush x:Key="AppButtonBrush" Color="#FFF5F8FC" />
        <SolidColorBrush x:Key="AppButtonHoverBrush" Color="#FFEAF2FA" />
        <SolidColorBrush x:Key="AppSelectionBrush" Color="#FFDDEAF7" />
        <SolidColorBrush x:Key="AppSelectionTextBrush" Color="#FF17324A" />
        <SolidColorBrush x:Key="OpenDocumentTenDaysBrush" Color="#FFF2F8EA" />
        <SolidColorBrush x:Key="OpenDocumentTwentyDaysBrush" Color="#FFFCF4E3" />
        <SolidColorBrush x:Key="OpenDocumentOverdueBrush" Color="#FFFBE7E7" />
        <SolidColorBrush x:Key="OpenDocumentTenDaysIndicatorBrush" Color="#FFB7D79F" />
        <SolidColorBrush x:Key="OpenDocumentTwentyDaysIndicatorBrush" Color="#FFF0C87A" />
        <SolidColorBrush x:Key="OpenDocumentOverdueIndicatorBrush" Color="#FFE2A0A0" />

        <Style TargetType="{x:Type Window}">
            <Setter Property="Background" Value="{StaticResource AppWindowBackgroundBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type GroupBox}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppAccentBrush}" />
        </Style>

        <Style TargetType="{x:Type Button}">
            <Setter Property="Background" Value="{StaticResource AppButtonBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
            <Setter Property="Padding" Value="10,4" />
        </Style>

        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
            <Setter Property="Padding" Value="6,3" />
        </Style>

        <Style TargetType="{x:Type ComboBox}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type DatePicker}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type CheckBox}">
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type RadioButton}">
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type Menu}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type ContextMenu}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
        </Style>

        <Style TargetType="{x:Type MenuItem}">
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
            <Setter Property="Background" Value="Transparent" />
        </Style>

        <Style TargetType="{x:Type ListBox}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
        </Style>

        <Style TargetType="{x:Type ListBoxItem}">
            <Setter Property="Padding" Value="0" />
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{StaticResource AppSelectionBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource AppSelectionTextBrush}" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style TargetType="{x:Type DataGrid}">
            <Setter Property="Background" Value="{StaticResource AppSurfaceBrush}" />
            <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
            <Setter Property="RowBackground" Value="#FFFFFFFF" />
            <Setter Property="AlternatingRowBackground" Value="#FFF7FAFD" />
            <Setter Property="ColumnHeaderStyle">
                <Setter.Value>
                    <Style TargetType="{x:Type DataGridColumnHeader}">
                        <Setter Property="Background" Value="#FFEAF2FA" />
                        <Setter Property="Foreground" Value="{StaticResource AppAccentBrush}" />
                        <Setter Property="BorderBrush" Value="{StaticResource AppBorderBrush}" />
                        <Setter Property="FontWeight" Value="SemiBold" />
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type DataGridRow}">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="Foreground" Value="{StaticResource AppTextBrush}" />
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{StaticResource AppSelectionBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource AppSelectionTextBrush}" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style TargetType="{x:Type DataGridCell}">
            <Setter Property="BorderBrush" Value="#FFDCE5EE" />
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{StaticResource AppSelectionBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource AppSelectionTextBrush}" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Application.Resources>
</Application>
