<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:hc="clr-namespace:HandyControl.Controls;assembly=HandyControl"
                    xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
                    xmlns:panels="clr-namespace:Reloaded.Mod.Launcher.Controls.Panels;assembly=Reloaded-II"
                    xmlns:converters="clr-namespace:Reloaded.Mod.Launcher.Converters;assembly=Reloaded-II">

    <Color x:Key="LightPrimaryColor">#793939</Color>
    <Color x:Key="PrimaryColor">#B66363</Color>
    <Color x:Key="DarkPrimaryColor">#B66363</Color>

    <Color x:Key="LightDangerColor">#450c0f</Color>
    <Color x:Key="DangerColor">#db3340</Color>
    <Color x:Key="DarkDangerColor">#db3340</Color>

    <Color x:Key="LightWarningColor">#4c3a0f</Color>
    <Color x:Key="WarningColor">#e9af20</Color>
    <Color x:Key="DarkWarningColor">#e9af20</Color>

    <Color x:Key="LightInfoColor">#003c44</Color>
    <Color x:Key="InfoColor">#00bcd4</Color>
    <Color x:Key="DarkInfoColor">#00bcd4</Color>

    <Color x:Key="LightSuccessColor">#113a1b</Color>
    <Color x:Key="SuccessColor">#2db84d</Color>
    <Color x:Key="DarkSuccessColor">#2db84d</Color>

    <Color x:Key="PrimaryTextColor">White</Color>
    <Color x:Key="SecondaryTextColor">#757575</Color>
    <Color x:Key="ThirdlyTextColor">#3f3f46</Color>
    <Color x:Key="ReverseTextColor">#212121</Color>
    <Color x:Key="TextIconColor">White</Color>

    <!-- <Color x:Key="BorderColor">#3f3f46</Color> -->
    <Color x:Key="SecondaryBorderColor">#00000000</Color>
    <!-- <Color x:Key="BackgroundColor">#eeeeee</Color> -->
    <Color x:Key="RegionColor">#1c1c1c</Color>
    <Color x:Key="SecondaryRegionColor">#2d2d30</Color>
    <Color x:Key="ThirdlyRegionColor">#424242</Color>
    <Color x:Key="TitleColor">#793939</Color>
    <Color x:Key="SecondaryTitleColor">#793939</Color>

    <Color x:Key="DefaultColor">#686868</Color>
    <Color x:Key="DarkDefaultColor">#686868</Color>

    <!-- <Color x:Key="AccentColor">#B66363</Color> -->
    <Color x:Key="DarkAccentColor">#B66363</Color>

    <Color x:Key="DarkMaskColor">#40000000</Color>
    <Color x:Key="DarkOpacityColor">#40000000</Color>
    <system:UInt32 x:Key="BlurGradientValue">0x99000000</system:UInt32>

    <!-- HandyControl Specific Fixes -->

    <!-- Fix Frames -->
    <Style TargetType="{x:Type Frame}" x:Key="DefaultFrame"/>
    <Style TargetType="{x:Type Frame}" BasedOn="{StaticResource DefaultFrame}" />

    <!-- Fix ComboBoxes -->
    <Style TargetType="{x:Type ToggleButton}" x:Key="DefaultToggleButtonStyle"/>
    <Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource DefaultToggleButtonStyle}"/>

    <!-- Fix Carousel for Controller -->
    <Style x:Key="CarouselItemBaseStyle" TargetType="hc:CarouselItem">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:CarouselItem">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplate="{Binding ItemTemplate,RelativeSource={RelativeSource AncestorType=hc:Carousel}}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CarouselPateButton" BasedOn="{StaticResource BaseStyle}" TargetType="RadioButton">
        <Setter Property="Margin" Value="5,0"/>
        <Setter Property="Width" Value="10"/>
        <Setter Property="Height" Value="10"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Border CornerRadius="5" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value=".9"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Opacity" Value=".6"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ReloadedCarousel" TargetType="hc:Carousel">
        <Setter Property="PageButtonStyle" Value="{StaticResource CarouselPateButton}"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource CarouselItemBaseStyle}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:Carousel">
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="FrameworkElement.MouseEnter">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Storyboard.TargetName="GridTop" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:.1"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="FrameworkElement.MouseLeave">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Storyboard.TargetName="GridTop" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:.1"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                    <hc:SimplePanel ClipToBounds="True">
                        <StackPanel x:Name="PART_Panel" Orientation="Horizontal"/>
                        <!--<ItemsPresenter x:Name="PART_ItemsControl" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Left"/>-->
                        <hc:SimplePanel x:Name="GridTop" Opacity="0">
                            <Button Command="interactivity:ControlCommands.Prev" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0" 
                                    Style="{StaticResource ButtonCustom}" FocusVisualStyle="{DynamicResource ReloadedFocusVisual}">
                                <Border Width="50" Height="100" Background="{DynamicResource DarkOpacityBrush}" CornerRadius="4">
                                    <Path Margin="16" Fill="White" Style="{StaticResource LeftPathStyle}"/>
                                </Border>
                            </Button>
                            <Button Command="interactivity:ControlCommands.Next" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,30,0" 
                                    Style="{StaticResource ButtonCustom}" FocusVisualStyle="{DynamicResource ReloadedFocusVisual}">
                                <Border Width="50" Height="100" Background="{DynamicResource DarkOpacityBrush}" CornerRadius="4">
                                    <Path Margin="16" Fill="White" Style="{StaticResource RightPathStyle}"/>
                                </Border>
                            </Button>
                        </hc:SimplePanel>
                        <StackPanel Name="PART_PanelPage" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,20"/>
                    </hc:SimplePanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Uses CaptionedCarouselItem as values. -->
    <Style x:Key="ReloadedCarouselWithCaptions" TargetType="hc:Carousel" BasedOn="{StaticResource ReloadedCarousel}">
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <panels:OverlappingElementsPanel Width="{Binding Path=Width, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type hc:Carousel}}, Mode=OneWay}">

                        <!-- Image -->
                        <Image Source="{Binding BitmapImage}" />

                        <!-- Caption -->
                        <Border Panel.ZIndex="1" VerticalAlignment="Bottom" Style="{x:Null}" OverridesDefaultStyle="True" Background="{StaticResource TooltipBackgroundColorBrush}"
                                Visibility="{Binding Caption, Converter={x:Static converters:StringToVisibilityConverter.Instance}}">
                            <TextBlock Text="{Binding Caption}" Style="{StaticResource DownloadModTitleTextBlock}" OverridesDefaultStyle="True"
                                       HorizontalAlignment="Center" TextWrapping="WrapWithOverflow"/>
                        </Border>
                    </panels:OverlappingElementsPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:Carousel">
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="FrameworkElement.MouseEnter">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Storyboard.TargetName="GridTop" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:.1"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="FrameworkElement.MouseLeave">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Storyboard.TargetName="GridTop" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:.1"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                    <hc:SimplePanel ClipToBounds="True">
                        <StackPanel x:Name="PART_Panel" Orientation="Horizontal"/>
                        <!--<ItemsPresenter x:Name="PART_ItemsControl" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Left"/>-->
                        <hc:SimplePanel x:Name="GridTop" Opacity="0">
                            <Button Command="interactivity:ControlCommands.Prev" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0" 
                                    Style="{StaticResource ButtonCustom}" FocusVisualStyle="{DynamicResource ReloadedFocusVisual}">
                                <Border Width="50" Height="100" Background="{DynamicResource DarkOpacityBrush}" CornerRadius="4">
                                    <Path Margin="16" Fill="White" Style="{StaticResource LeftPathStyle}"/>
                                </Border>
                            </Button>
                            <Button Command="interactivity:ControlCommands.Next" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,30,0" 
                                    Style="{StaticResource ButtonCustom}" FocusVisualStyle="{DynamicResource ReloadedFocusVisual}">
                                <Border Width="50" Height="100" Background="{DynamicResource DarkOpacityBrush}" CornerRadius="4">
                                    <Path Margin="16" Fill="White" Style="{StaticResource RightPathStyle}"/>
                                </Border>
                            </Button>
                        </hc:SimplePanel>
                        <StackPanel Name="PART_PanelPage" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,30"/>
                    </hc:SimplePanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Tags in Reloaded Style -->
    <Style TargetType="hc:TagContainer" BasedOn="{StaticResource TagContainerBaseStyle}">
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Focusable" Value="False" />
    </Style>

    <Style x:Key="ReloadedTag" BasedOn="{StaticResource TagBaseStyle}" TargetType="{x:Type hc:Tag}">
        <Setter Property="Content" Value="{Binding .}" />
        <Setter Property="Margin" Value="5" />
        <Setter Property="Focusable" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource ReloadedFocusVisual}" />

        <Style.Triggers>
            <Trigger Property="UIElement.IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource AccentColorBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>