<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:GitHub.UI"
    xmlns:sharedControls="clr-namespace:GitHub.Shared.Controls"
    mc:Ignorable="d">

    <!-- TextBox -->

    <Style x:Key="GitHubTextBox" TargetType="{x:Type TextBox}">
        <Setter Property="BorderBrush" Value="{DynamicResource GitHubTextBoxBorderBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource GitHubTextBoxForegroundBrush}" />
        <Setter Property="FontFamily" Value="{DynamicResource GitHubFontFamilyNormal}" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Padding" Value="3,3,3,0" />
        <Setter Property="Margin" Value="12,0,12,0" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="ToolTipService.ShowDuration" Value="30000" />
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="ContextMenu" Value="{DynamicResource DefaultContextMenu}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid>
                        <Border x:Name="Bd" CornerRadius="2" ClipToBounds="True" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <Border CornerRadius="0" BorderBrush="Black" BorderThickness="0,1,0,0" Margin="2,-2,2,0" Opacity="0.4">
                                <Border.Effect>
                                    <DropShadowEffect Direction="270" ShadowDepth="0" BlurRadius="4" Opacity="1" />
                                </Border.Effect>
                            </Border>
                        </Border>

                        <Grid Margin="3,1,0,0">
                            <ScrollViewer x:Name="PART_ContentHost" Padding="{TemplateBinding Padding}" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" VerticalAlignment="Top" Margin="0" />
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource GitHubTextBoxMouseOverBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocusWithin" Value="True">
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource GitHubAccentBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource GitHubTextBox}" />

    <!-- RoundedPromptTextBox -->
    <Style x:Key="RoundedPromptTextBox" TargetType="{x:Type sharedControls:PromptTextBox}" BasedOn="{StaticResource GitHubTextBox}">
        <Setter Property="Background" Value="White" />
        <Setter Property="BorderBrush" Value="#D1D1D1" />
        <Setter Property="Foreground" Value="{DynamicResource GitHubTextBrush}" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Height" Value="24" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type sharedControls:PromptTextBox}">
                    <Grid>
                        <Border x:Name="Bd" CornerRadius="2" ClipToBounds="True" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <Border CornerRadius="0" BorderBrush="Black" BorderThickness="0,1,0,0" Margin="2,-2,2,0" Opacity="0.4">
                                <Border.Effect>
                                    <DropShadowEffect Direction="270" ShadowDepth="0" BlurRadius="4" Opacity="1" />
                                </Border.Effect>
                            </Border>
                        </Border>

                        <Grid Margin="1,0,0,0">
                            <ScrollViewer x:Name="PART_ContentHost" Padding="{TemplateBinding Padding}" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" VerticalAlignment="Top" Margin="0" />
                            <Label x:Name="PromptLabel" HorizontalAlignment="Left"
                                 Foreground="{DynamicResource GitHubTextBrush}"
                                 FontSize="{TemplateBinding FontSize}" Margin="2,0,0,0" Padding="{TemplateBinding Padding}" Opacity="0"
                                 Target="{Binding ElementName=Bd}"
                                 SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Focusable="False" IsHitTestVisible="False"
                                 VerticalAlignment="Top">
                                <TextBlock Text="{TemplateBinding PromptText}" TextTrimming="CharacterEllipsis" />
                            </Label>
                        </Grid>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource GitHubTextBoxMouseOverBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocusWithin" Value="True">
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource GitHubAccentBrush}" />
                        </Trigger>
                        <DataTrigger Binding="{Binding Text.Length, RelativeSource={RelativeSource Self}}" Value="0">
                            <Setter Property="Opacity" TargetName="PromptLabel" Value="0.7" />
                            <Setter Property="Foreground" Value="Transparent" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- PasswordBox -->
    <Style x:Key="GitHubPasswordBox" TargetType="{x:Type PasswordBox}">
        <Setter Property="BorderBrush" Value="{DynamicResource GitHubTextBoxBorderBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource GitHubTextBoxForegroundBrush}" />
        <Setter Property="FontFamily" Value="{DynamicResource GitHubFontFamilyNormal}" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Padding" Value="3,2,3,3" />
        <Setter Property="Margin" Value="12,0,12,0" />
        <Setter Property="Width" Value="Auto" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
                  SnapsToDevicePixels="True">
                        <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource GitHubTextBoxMouseOverBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocusWithin" Value="True">
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource GitHubAccentBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type PasswordBox}" BasedOn="{StaticResource GitHubPasswordBox}" />
    <!-- End PasswordBox -->

    <!-- Label -->
    <Style x:Key="GitHubLabel" TargetType="{x:Type Label}">
        <Setter Property="Foreground" Value="{DynamicResource GitHubTextBrush}" />
    </Style>
    <Style TargetType="{x:Type Label}" BasedOn="{StaticResource GitHubLabel}" />
    <!-- End Label -->

    <!-- Textblock -->
    <Style x:Key="GitHubTextBlock" TargetType="{x:Type TextBlock}">
        <Setter Property="Foreground" Value="{DynamicResource GitHubTextBrush}" />
        <Setter Property="FontFamily" Value="{DynamicResource GitHubFontFamilyNormal}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="ToolTipService.ShowDuration" Value="30000" />
    </Style>
    <Style x:Key="GitHubH1TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource GitHubTextBlock}">
        <Setter Property="FontSize" Value="30" />
        <Setter Property="FontWeight" Value="Light" />
        <Setter Property="Margin" Value="24,10,0,6" />
        <Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />
    </Style>
    <Style x:Key="GitHubH2TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource GitHubH1TextBlock}">
        <Setter Property="FontSize" Value="20" />
    </Style>
    <Style x:Key="GitHubDescriptionTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource GitHubTextBlock}">
        <Setter Property="Margin" Value="24,0" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="Foreground" Value="{DynamicResource GitHubTextSecondaryBrush}" />
    </Style>
    <!-- End Textblock -->

    <!-- ToolTip -->
    <Style x:Key="GitHubToolTip" TargetType="{x:Type ToolTip}">
        <Setter Property="Margin" Value="0" />
        <Setter Property="FontSize" Value="10pt" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="HasDropShadow" Value="False" />
        <Setter Property="Padding" Value="5,1,5,3" />
        <Setter Property="Background" Value="#f9f9f9" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#20000000" />
        <Setter Property="Foreground" Value="#494949" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolTip">
                    <Grid>
                        <Rectangle Margin="2,2,0,0" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
                       Fill="{TemplateBinding Background}" Opacity="0" StrokeThickness="0" />
                        <Border Opacity="0.95" Margin="4,2,4,5" SnapsToDevicePixels="True"
                    Background="{TemplateBinding Background}" BorderBrush="#cacaca" BorderThickness="1" Width="{TemplateBinding Width}"
                    Height="{TemplateBinding Height}">
                            <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="Left" VerticalAlignment="Top" />
                            <Border.Effect>
                                <DropShadowEffect ShadowDepth="1" Direction="270" BlurRadius="4" Opacity="0.2" />
                            </Border.Effect>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource GitHubToolTip}" />
    <!-- End ToolTip -->

    <LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
        <GradientStop Color="#ABADB3" Offset="0.05" />
        <GradientStop Color="#E2E3EA" Offset="0.07" />
        <GradientStop Color="#E3E9EF" Offset="1" />
    </LinearGradientBrush>
    <Style x:Key="{x:Type TextBoxBase}" BasedOn="{x:Null}" TargetType="{x:Type TextBoxBase}">
        <Setter Property="Foreground" Value="{DynamicResource GitHubTextBrush}" />
        <Setter Property="Background" Value="White" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{x:Type Hyperlink}" TargetType="{x:Type Hyperlink}">
        <Setter Property="Foreground" Value="{DynamicResource GHBlueLinkButtonTextBrush}" />
        <Setter Property="TextDecorations" Value="None" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="{DynamicResource GHBlueLinkButtonHoverBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground"  Value="{DynamicResource GHBlueLinkButtonDisabledTextBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="LockIconPath" TargetType="{x:Type Path}">
        <Setter Property="Data" Value="F1M2,9C2,9 2,16 2,16 2,16 9,16 9,16 9,16 9,15.891 9,15.699L9,15C9,15 3,15 3,15 3,15 3,14 3,14 3,14 9,14 9,14L9,13C9,13 3,13 3,13 3,13 3,12 3,12 3,12 9,12 9,12L9,11C9,11 3,11 3,11 3,11 3,10 3,10 3,10 9,10 9,10 9,9.438 9,9 9,9 9,9 2,9 2,9z M7,3C5.895,3 5,3.895 5,5 5,6.105 5,8 5,8 5,8 9,8 9,8 9,8 9,5.707 9,5 9,3.895 8.105,3 7,3z M7,1C9.209,1 11,2.791 11,5 11,5.298 11,5.822 11,6.441L11,8 11.57,8C11.844,8 12,8 12,8 12.552,8 13,8.448 13,9 13,9 13,16 13,16 13,16.552 12.552,17 12,17 12,17 2,17 2,17 1.448,17 1,16.552 1,16 1,16 1,9 1,9 1,8.448 1.448,8 2,8 2,8 2.156,8 2.43,8L3,8 3,6.869C3,6.203 3,5.552 3,5 3,2.791 4.791,1 7,1z" />
        <Setter Property="Fill" Value="#CACACA" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Margin" Value="12,0,0,1" />
        <Setter Property="Width" Value="16" />
    </Style>

    <Style x:Key="PublicRepoIconPath" TargetType="{x:Type Path}">
        <Setter Property="Data" Value="F1M2,13C2,13 2,14 2,14 2,14 1.975,15 2.969,15 3.236,15 3.594,15 4,15 4,15 4,14 4,14 4,14 7,14 7,14 7,14 7,15 7,15 9.031,15 10.969,15 10.969,15 10.969,15 12,14.963 12,14 12,13.5 12,13 12,13 8.937,13 4.075,13 2,13z M5,10C5,10 6,10 6,10 6,10 6,11 6,11 6,11 5,11 5,11 5,11 5,10 5,10z M5,8C5,8 6,8 6,8 6,8 6,9 6,9 6,9 5,9 5,9 5,9 5,8 5,8z M5,6C5,6 6,6 6,6 6,6 6,7 6,7 6,7 5,7 5,7 5,7 5,6 5,6z M5,4C5,4 6,4 6,4 6,4 6,5 6,5 6,5 5,5 5,5 5,5 5,4 5,4z M4,3C4,3 4,12 4,12 4,12 6,12 6,12 6,12 12,12 12,12 12,12 12,3 12,3 12,3 4,3 4,3z M2,2C2,2 12,2 12,2 12,2 12.969,1.77 13,3 13,3 13,12 13,12 13,12 13,15 13,15 13,15 13.044,16 12,16 10.866,16 8.917,16 7,16 7,16 7,18 7,18 7,18 5.5,16.5 5.5,16.5 5.5,16.5 4,18 4,18 4,18 4,16 4,16 3.216,16 2.521,16 2,16 1.054,16 1.003,15.151 1.001,15 1.001,15 1,15 1,15 1,15 1,7.585 1,3 1,1.982 2,2 2,2z" />
        <Setter Property="Fill" Value="#CACACA" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Margin" Value="12,1,0,0" />
        <Setter Property="Width" Value="16" />
    </Style>

    <Style x:Key="LocalRepoIconPath" TargetType="{x:Type Path}">
        <Setter Property="Data" Value="F1M11.33,1.988C11.33,1.988 16.012,7 16.012,7 16.012,7 11.33,12.013 11.33,12.013 11.33,12.013 9.993,10.58 9.993,10.58 9.993,10.58 13.336,7 13.336,7 13.336,7 9.992,3.42 9.992,3.42 9.992,3.42 11.33,1.988 11.33,1.988z M6.67,1.988C6.67,1.988 8.008,3.42 8.008,3.42 8.008,3.42 4.664,7 4.664,7 4.664,7 8.008,10.58 8.008,10.58 8.008,10.58 6.67,12.012 6.67,12.012 6.67,12.012 1.988,7 1.988,7 1.988,7 6.67,1.988 6.67,1.988z" />
        <Setter Property="Fill" Value="#CACACA" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Margin" Value="10,0,2,0" />
        <Setter Property="Width" Value="16" />
    </Style>
</ResourceDictionary>
