<?xml version="1.0" encoding="UTF-8" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
                    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                    xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
                    xmlns:converters="clr-namespace:BookReader.Converters">

    <toolkit:InvertedBoolConverter x:Key="InvertedBoolConverter" />
    <toolkit:IsStringNotNullOrEmptyConverter x:Key="IsNotNullOrEmptyConverter" />

    <converters:ProgressToWidthConverter x:Key="ProgressToWidthConverter" />
    <converters:ByteArrayToImageSourceConverter x:Key="ByteArrayToImageConverter" />

    <Color x:Key="AppBackground">#F5E8D6</Color>
    <Color x:Key="AppBackgroundDeep">#EBC9AE</Color>
    <Color x:Key="SurfaceColor">#FFF8F0</Color>
    <Color x:Key="SurfaceMuted">#F7E8D9</Color>
    <Color x:Key="SurfaceStrong">#EED7C0</Color>
    <Color x:Key="InkColor">#27160E</Color>
    <Color x:Key="InkSoftColor">#6E5648</Color>
    <Color x:Key="BorderColor">#DEC2AA</Color>
    <Color x:Key="AccentColor">#A65436</Color>
    <Color x:Key="AccentDarkColor">#6F311D</Color>
    <Color x:Key="AccentSoftColor">#DFA98D</Color>
    <Color x:Key="SuccessColor">#2F7D5A</Color>
    <Color x:Key="WarningColor">#C47A3E</Color>
    <Color x:Key="DangerColor">#B64932</Color>
    <Color x:Key="TabBarColor">#2B1B15</Color>

    <LinearGradientBrush x:Key="AppBackgroundBrush" StartPoint="0,0" EndPoint="1,1">
        <GradientStop Color="{StaticResource AppBackground}" Offset="0.0" />
        <GradientStop Color="{StaticResource AppBackgroundDeep}" Offset="1.0" />
    </LinearGradientBrush>

    <Style TargetType="NavigationPage">
        <Setter Property="BarBackgroundColor" Value="{StaticResource TabBarColor}" />
        <Setter Property="BarTextColor" Value="White" />
    </Style>

    <Style TargetType="Shell">
        <Setter Property="Shell.BackgroundColor" Value="{StaticResource TabBarColor}" />
        <Setter Property="Shell.ForegroundColor" Value="White" />
        <Setter Property="Shell.TitleColor" Value="White" />
        <Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource TabBarColor}" />
        <Setter Property="Shell.TabBarForegroundColor" Value="#C9B4A6" />
        <Setter Property="Shell.TabBarTitleColor" Value="#C9B4A6" />
        <Setter Property="Shell.TabBarUnselectedColor" Value="#9E8474" />
    </Style>

    <Style x:Key="PageTitleStyle" TargetType="Label">
        <Setter Property="FontSize" Value="28" />
        <Setter Property="FontFamily" Value="OpenSansSemibold" />
        <Setter Property="TextColor" Value="{StaticResource InkColor}" />
        <Setter Property="LineBreakMode" Value="WordWrap" />
    </Style>

    <Style x:Key="PageSubtitleStyle" TargetType="Label">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="TextColor" Value="{StaticResource InkSoftColor}" />
        <Setter Property="LineBreakMode" Value="WordWrap" />
    </Style>

    <Style x:Key="SectionTitleStyle" TargetType="Label">
        <Setter Property="FontSize" Value="18" />
        <Setter Property="FontFamily" Value="OpenSansSemibold" />
        <Setter Property="TextColor" Value="{StaticResource InkColor}" />
    </Style>

    <Style x:Key="CaptionStyle" TargetType="Label">
        <Setter Property="FontSize" Value="12" />
        <Setter Property="TextColor" Value="{StaticResource InkSoftColor}" />
    </Style>

    <Style x:Key="CardBorderStyle" TargetType="Border">
        <Setter Property="BackgroundColor" Value="{StaticResource SurfaceColor}" />
        <Setter Property="Stroke" Value="{StaticResource BorderColor}" />
        <Setter Property="StrokeThickness" Value="1" />
        <Setter Property="StrokeShape" Value="RoundRectangle 24" />
        <Setter Property="Padding" Value="18" />
    </Style>

    <Style x:Key="MutedCardBorderStyle" TargetType="Border">
        <Setter Property="BackgroundColor" Value="{StaticResource SurfaceMuted}" />
        <Setter Property="Stroke" Value="{StaticResource BorderColor}" />
        <Setter Property="StrokeThickness" Value="1" />
        <Setter Property="StrokeShape" Value="RoundRectangle 24" />
        <Setter Property="Padding" Value="18" />
    </Style>

    <Style x:Key="PrimaryButtonStyle" TargetType="Button">
        <Setter Property="BackgroundColor" Value="{StaticResource AccentColor}" />
        <Setter Property="TextColor" Value="White" />
        <Setter Property="CornerRadius" Value="18" />
        <Setter Property="Padding" Value="18,12" />
        <Setter Property="FontFamily" Value="OpenSansSemibold" />
        <Setter Property="FontSize" Value="14" />
    </Style>

    <Style x:Key="SecondaryButtonStyle" TargetType="Button">
        <Setter Property="BackgroundColor" Value="{StaticResource SurfaceStrong}" />
        <Setter Property="TextColor" Value="{StaticResource InkColor}" />
        <Setter Property="CornerRadius" Value="18" />
        <Setter Property="Padding" Value="18,12" />
        <Setter Property="FontFamily" Value="OpenSansSemibold" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="BorderColor" Value="{StaticResource BorderColor}" />
        <Setter Property="BorderWidth" Value="1" />
    </Style>

    <Style x:Key="TonalButtonStyle" TargetType="Button">
        <Setter Property="BackgroundColor" Value="#E9D7C3" />
        <Setter Property="TextColor" Value="{StaticResource InkColor}" />
        <Setter Property="CornerRadius" Value="14" />
        <Setter Property="Padding" Value="14,10" />
        <Setter Property="FontSize" Value="13" />
    </Style>

    <Style x:Key="AppSearchBarStyle" TargetType="SearchBar">
        <Setter Property="BackgroundColor" Value="{StaticResource SurfaceColor}" />
        <Setter Property="TextColor" Value="{StaticResource InkColor}" />
        <Setter Property="PlaceholderColor" Value="{StaticResource InkSoftColor}" />
        <Setter Property="CancelButtonColor" Value="{StaticResource AccentColor}" />
        <Setter Property="HeightRequest" Value="52" />
    </Style>

    <Style x:Key="AppEntryStyle" TargetType="Entry">
        <Setter Property="BackgroundColor" Value="{StaticResource SurfaceColor}" />
        <Setter Property="TextColor" Value="{StaticResource InkColor}" />
        <Setter Property="PlaceholderColor" Value="{StaticResource InkSoftColor}" />
        <Setter Property="HeightRequest" Value="52" />
    </Style>

    <Style x:Key="AppPickerStyle" TargetType="Picker">
        <Setter Property="BackgroundColor" Value="{StaticResource SurfaceColor}" />
        <Setter Property="TextColor" Value="{StaticResource InkColor}" />
        <Setter Property="HeightRequest" Value="52" />
        <Setter Property="TitleColor" Value="{StaticResource InkSoftColor}" />
    </Style>

    <Style x:Key="ReaderSliderStyle" TargetType="Slider">
        <Setter Property="MinimumTrackColor" Value="{StaticResource AccentColor}" />
        <Setter Property="MaximumTrackColor" Value="{StaticResource SurfaceStrong}" />
        <Setter Property="ThumbColor" Value="{StaticResource AccentDarkColor}" />
    </Style>
</ResourceDictionary>
