<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ForzaUI"
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <!-- Sizes -->
    <System:Double x:Key="A_Size_ColumnWidth">123</System:Double>
    <System:Double x:Key="A_Size_HeaderRowHeight">50</System:Double>
    <System:Double x:Key="A_Size_RowHeight">50</System:Double>
    <System:Double x:Key="A_Size_FooterRowHeight">50</System:Double>
    <GridLength x:Key="A_GridLength_Column_Spacer_Width">18</GridLength>
    <GridLength x:Key="A_GridLength_Column_Spacer_WidthLarge">72</GridLength>
    <GridLength x:Key="A_GridLength_Column_TimeData_Width">150</GridLength>

    <Thickness x:Key="A_Margin_Cell">26, 0</Thickness>


    <!-- Colors -->
    <Color x:Key="A_Color_DarkPanelHeader">#272d33</Color>
    <Color x:Key="A_Color_DarkPanelBackground">#99323a41</Color>
    <Color x:Key="A_Color_ScrollBarBackground">#AAE0E2DC</Color>


    <!-- Brushes -->
    <SolidColorBrush x:Key="A_Brush_ScrollBarBackground" Color="{StaticResource A_Color_ScrollBarBackground}" />

    <!-- Font Sizes -->
    <System:Double x:Key="A_CapHeight_DriverListHeading">22</System:Double>
    <System:Double x:Key="A_CapHeight_Cell">18</System:Double>

    <!-- Fonts -->
    <Style x:Key="A_Style_FZTextBlock_DriverListPosition" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonC}" >
        <Setter Property="CapHeight" Value="{StaticResource A_CapHeight_DriverListHeading}" />
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <!-- Dont change text color if the background is different -->
                    <Condition Binding="{Binding Path=(Tag), ElementName=PositionBox}" Value="NoCustomColor" />
                    <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}" />
            </MultiDataTrigger>
            
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_DriverListHeading" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}" >
        <Setter Property="CapHeight" Value="18" />
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Left" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_LeaderboardRow" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}" >
        <Setter Property="CapHeight" Value="{StaticResource A_CapHeight_Cell}" />
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}" />
        <Setter Property="Margin" Value="0" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                <Setter Property="FontFamily"
                        Value="Horizon_A" />
            </DataTrigger>
            <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HighlightText}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_LeaderboardRowValue" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" >
        <Setter Property="FontFamily" Value="Horizon_B_tf" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                <Setter Property="FontFamily"
                        Value="Horizon_A_tf" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ClubTag" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" />

    <!-- ListBoxItem Style -->
    <Style x:Key="A_Style_ListBoxItem_DriverList" TargetType="ListBoxItem">
        <Setter Property="OverridesDefaultStyle"  Value="True" />
        <Setter Property="Height" Value="{StaticResource A_Size_RowHeight}" />
        <Setter Property="Margin" Value="0,0,0,4" />
    </Style>


    <!-- Cell Styles -->
    <Style x:Key="A_Style_Cell" TargetType="Control">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Width" Value="{StaticResource A_Size_ColumnWidth}" />
        <Setter Property="Margin" Value="{StaticResource A_Margin_Cell}" />
    </Style>


    <!-- Cell Templates -->
    


    <!-- Row Styles -->
    <Style x:Key="A_Style_HeaderRow" TargetType="FrameworkElement">
        <Setter Property="Height" Value="{StaticResource A_Size_HeaderRowHeight}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Focusable" Value="False"/>
    </Style>

    <Style x:Key="A_Style_FooterRow" TargetType="Control">
        <Setter Property="Height" Value="{StaticResource A_Size_FooterRowHeight}" />
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_Cell_Class">
        <Control Style="{StaticResource H_Style_TemplatedElement_CarClassBadge}"
                local:BindingProxy.A="{Binding PerformanceIndex}"
                local:BindingProxy.B="{Binding ClassID}"
                Height="35"
                x:Name="CarClassControl"/>
    </ControlTemplate>
    
    <!-- Animations -->
    <Storyboard x:Key="A_Storyboard_LeaderboardItem_Selected">
        <DoubleAnimationUsingKeyFrames 
            Storyboard.TargetName="RowContent"
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                    Value="1.0">
            </DiscreteDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames 
            Storyboard.TargetName="RowContent"
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                    Value="1.0">
            </DiscreteDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

    <Storyboard x:Key="A_Storyboard_LeaderboardItem_Unselected">
        <DoubleAnimationUsingKeyFrames 
            Storyboard.TargetName="RowContent"
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" >
            <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.0" EasingFunction="{local:CircleEasing}" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames 
            Storyboard.TargetName="RowContent"
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" >
            <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.0" EasingFunction="{local:CircleEasing}" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames 
            Storyboard.TargetName="RowContent"
            Storyboard.TargetProperty="(local:ZPanel.ZOffset)">
            <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0" EasingFunction="{local:CircleEasing}"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</ResourceDictionary>