<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">

    <!--============-->
    <!-- Base Theme -->
    <!--============-->
    <style name="Theme"/>

    <style name="Theme.Base" parent="Theme.Material3.DayNight.NoActionBar">
        <item name="android:forceDarkAllowed" tools:targetApi="29">false</item>
        <item name="android:enforceNavigationBarContrast" tools:targetApi="29">false</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <!--Standard Material colors -->
        <item name="colorPrimary">@color/primaryTachiyomi</item>
        <item name="colorPrimaryInverse">@color/primaryInverseTachiyomi</item>
        <item name="colorPrimaryVariant">@color/primaryVariantTachiyomi</item>
        <item name="colorSurface">@color/background</item> //old colorSecondary
        <item name="colorSurfaceVariant">?colorPrimaryVariant</item> //old colorSecondary
        <item name="colorOnSurface">@color/colorOnSurface</item> //old colorOnSecondary
        <item name="colorSecondary">@color/secondaryTachiyomi</item> //colorAccent
        <item name="colorOnSecondary">@color/md_white_1000</item>
        <item name="colorOnPrimary">@color/onPrimaryTachiyomi</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantTachiyomi</item> // much darker / lighter version of colorSecondary
        <item name="colorPrimaryContainer">@color/primary_container</item>
        <item name="colorSecondaryContainer">@color/secondary_container</item>
        <item name="background">@color/background</item>
        <item name="colorOnBackground">@color/colorOnBackground</item>
        <item name="colorBackgroundFloating">?colorSurface</item>

        <item name="colorTertiary">@color/download_badge</item>
        <item name="colorOnTertiary">@color/black</item>

        <item name="readerBackground">@color/primaryVariantTachiyomi</item>
        <item name="android:listSelector">?attr/colorSecondary</item>
        <item name="android:divider">@color/divider</item>
        <item name="android:listDivider">@drawable/line_divider</item>
        <item name="colorControlHighlight">@color/rippleColorTachiyomi</item>
        <item name="actionModeStyle">@style/Widget.Tachiyomi.ActionMode</item>
        <item name="materialSwitchStyle">@style/Widget.Material3.CompoundButton.MaterialSwitch</item>
        <item name="materialCardViewOutlinedStyle">@style/Widget.Tachiyomi.CardView.Outlined</item>
        <item name="materialCardViewFilledStyle">@style/Widget.Tachiyomi.CardView.Filled</item>
        <item name="materialCardViewElevatedStyle">@style/Widget.Tachiyomi.CardView.Elevated</item>
        <item name="switchPreferenceCompatStyle">@style/Widget.Tachiyomi.SwitchPreferenceCompat</item>
        <item name="android:colorBackground">?background</item>
        <item name="android:textColorSecondary">@color/text_color_secondary</item>
        <item name="android:textColorHint">@color/text_color_hint</item>
        <item name="textAppearanceButton">@style/TextAppearance.Tachiyomi.Button</item>
        <item name="textAppearanceBodySecondary">@style/TextAppearance.Tachiyomi.BodySecondary</item>
        <item name="android:textColorPrimaryInverse">@color/textColorPrimaryInverse</item>
        <item name="switchStyle">@style/Widget.Tachiyomi.CompoundButton.Switch</item>
        <item name="sliderStyle">@style/Widget.Tachiyomi.Slider</item>
        <item name="checkboxStyle">@style/Widget.Tachiyomi.CompoundButton.CheckBox</item>
        <item name="radioButtonStyle">@style/Widget.Tachiyomi.CompoundButton.RadioButton</item>
        <item name="bottomNavigationStyle">@style/Widget.Tachiyomi.BottomNavigationView</item>
        <item name="materialButtonStyle">@style/Widget.Tachiyomi.Button.Primary</item>
        <item name="navigationRailStyle">@style/Widget.Tachiyomi.NavigationRail</item>
        <item name="elevationOverlayEnabled">false</item>

        <!-- Handles RTL Text -->
        <item name="android:textAlignment">gravity</item>
        <item name="android:textDirection">locale</item>

        <!-- Themes -->
        <item name="windowActionModeOverlay">true</item>
        <item name="bottomSheetDialogTheme">@style/BottomSheetDialogTheme</item>
        <item name="actionBarTheme">@style/Theme.ActionBar.DayNight</item>
        <item name="preferenceTheme">@style/Tachiyomi.PreferenceTheme</item>
        <item name="materialAlertDialogTheme">@style/Theme.Widget.Yokai.AlertDialog</item>

        <!-- Custom Attributes-->
        <item name="actionBarTintColor">?attr/colorOnBackground</item>
        <item name="tabBarIconColor">?attr/colorSecondary</item>
        <item name="tabBarIconInactive">@color/colorPrimaryInactive</item>
        <item name="android:statusBarColor">@color/status_bar</item>
        <item name="android:navigationBarColor">#B3000000</item>
        <item name="android:colorEdgeEffect">?attr/colorSecondary</item>
        <item name="tabHighlightBackground">@color/secondary_alpha</item>
        <item name="mainActionBarSize">56dp</item>

        <item name="android:windowLightStatusBar">@bool/isLightMode</item>
        <item name="android:windowLightNavigationBar" tools:targetApi="27">@bool/isLightMode</item>
    </style>

    <style name="Theme.Tachiyomi" parent="Theme.Base"/>

    <style name="ThemeOverlay.Tachiyomi.Amoled" parent="">
        <item name="colorSurface">@color/md_black_1000</item>
        <item name="colorPrimaryVariant">@color/md_black_1000</item>
        <item name="background">@color/md_black_1000</item>
        <item name="readerBackground">@color/md_black_1000</item>
    </style>

    <style name="Theme.Tachiyomi.FlatLime">
        <item name="colorPrimary">@color/primaryLime</item>
        <item name="colorPrimaryVariant">@color/primaryVariantLime</item>
        <item name="colorOnPrimary">@color/onPrimaryLime</item>
        <item name="colorPrimaryInverse">@color/primaryInverseLime</item>
        <item name="colorSecondary">@color/secondaryLime</item>
        <item name="colorOnSecondary">@color/textColorPrimaryInverse</item>
        <item name="colorControlHighlight">@color/rippleColorLime</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantLime</item>
        <item name="colorSurface">@color/backgroundLime</item>
        <item name="background">@color/backgroundLime</item>
        <item name="colorTertiary">@color/downloadBadgeLime</item>
        <item name="colorOnTertiary">@color/colorOnDownloadBadgeDayNight</item>
    </style>

    <style name="Theme.Tachiyomi.MidnightDusk">
        <item name="colorPrimary">@color/primaryDuskDawn</item>
        <item name="colorPrimaryInverse">@color/primaryInverseDuskDawn</item>
        <item name="colorPrimaryVariant">@color/primaryVariantDuskDawn</item>
        <item name="colorOnPrimary">@color/onPrimaryDuskDawn</item>
        <item name="colorSecondary">@color/secondaryDuskDawn</item>
        <item name="colorControlHighlight">@color/rippleColorDuskDawn</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantDuskDawn</item>
        <item name="colorSurface">@color/backgroundDuskDawn</item>
        <item name="background">@color/backgroundDuskDawn</item>
        <item name="colorOnBackground">@color/colorOnBackgroundDuskDawn</item>
        <item name="actionBarTintColor">@color/appBarTextDuskDawn</item>
    </style>

    <style name="Theme.Tachiyomi.SapphireDusk">
        <item name="colorPrimary">@color/primaryTealSapphire</item>
        <item name="colorPrimaryInverse">@color/primaryInverseTealSapphire</item>
        <item name="colorPrimaryVariant">@color/primaryVariantTealSapphire</item>
        <item name="colorOnPrimary">@color/onPrimaryTealSapphire</item>
        <item name="colorSecondary">@color/secondaryTealSapphire</item>
        <item name="colorOnSecondary">@color/colorOnDownloadBadgeDayNight</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantTealSapphire</item>
        <item name="colorTertiary">@color/downloadBadgeDayNightInverse</item>
        <item name="colorOnTertiary">?android:textColorPrimaryInverse</item>
        <item name="colorControlHighlight">@color/rippleColorTealSapphire</item>
        <item name="tabBarIconColor">@color/tabBarIconColorTealSapphire</item>
        <item name="background">@color/backgroundTealSapphire</item>
        <item name="colorOnBackground">@color/colorOnBackgroundTealSapphire</item>
        <item name="colorSurface">@color/backgroundTealSapphire</item>
        <item name="actionBarTintColor">@color/appBarTextTealSapphire</item>
    </style>

    <style name="Theme.Tachiyomi.Lavender">
        <item name="colorPrimary">@color/lavender_primary</item>
        <item name="colorPrimaryInverse">@color/lavender_primary_inverse</item>
        <item name="colorPrimaryVariant">@color/lavender_primary_variant</item>
        <item name="colorOnPrimary">@color/lavender_on_primary</item>
        <item name="colorSecondary">@color/lavender_secondary</item>
        <item name="colorOnSecondary">@color/lavender_on_secondary</item>
        <item name="colorSecondaryVariant">@color/lavender_secondary_variant</item>
        <item name="colorTertiary">@color/lavender_tertiary</item>
        <item name="colorOnTertiary">@color/lavender_on_tertiary</item>
        <item name="colorControlHighlight">@color/lavender_highlight</item>
        <item name="tabBarIconColor">@color/lavender_tab_bar_icon</item>
        <item name="background">@color/lavender_background</item>
        <item name="colorOnBackground">@color/lavender_on_background</item>
        <item name="colorSurface">@color/lavender_surface</item>
        <item name="actionBarTintColor">@color/lavender_on_surface</item>
        <item name="elevationOverlayColor">@color/lavender_elevation_overlay</item>
    </style>

    <style name="Theme.Tachiyomi.Strawberries">
        <item name="colorPrimary">@color/primaryStrawberry</item>
        <item name="colorPrimaryVariant">@color/primaryVariantStrawberry</item>
        <item name="colorPrimaryInverse">@color/primaryInverseStrawberry</item>
        <item name="colorOnPrimary">@color/onPrimaryStrawberry</item>
        <item name="colorSurface">@color/backgroundStrawberries</item>
        <item name="colorSecondary">@color/secondaryStrawberry</item>
        <item name="colorControlHighlight">@color/rippleColorStrawberry</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantStrawberry</item>
        <item name="background">@color/backgroundStrawberries</item>
    </style>

    <!--== Tako Theme ==-->
    <style name="Theme.Tachiyomi.Tako">
        <item name="colorPrimary">@color/primaryTako</item>
        <item name="colorPrimaryInverse">@color/primaryInverseTako</item>
        <item name="colorOnPrimary">@color/onPrimaryTako</item>
        <item name="colorSecondary">@color/secondaryTako</item>
        <item name="colorOnSecondary">@color/onSecondaryTako</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantTako</item>
        <item name="colorPrimaryVariant">@color/primaryVariantTako</item>
        <item name="colorTertiary">@color/downloadBadgeDayNight</item>
        <item name="colorOnTertiary">@color/colorOnDownloadBadgeDayNight</item>
        <item name="tabBarIconColor">@color/tabBarIconColorTako</item>
        <item name="colorControlHighlight">@color/rippleColorTako</item>
        <item name="colorSurface">@color/backgroundTako</item>
        <item name="actionBarTintColor">@color/actionTintTako</item>
        <item name="background">@color/backgroundTako</item>
        <item name="tabBarIconInactive">@color/inactiveTabTako</item>
    </style>

    <!--== Yotsuba Theme ==-->
    <style name="Theme.Tachiyomi.Yotsuba">
        <item name="colorPrimary">@color/primaryYotsuba</item>
        <item name="colorPrimaryVariant">@color/primaryVariantYotsuba</item>
        <item name="colorPrimaryInverse">@color/primaryInverseYotsuba</item>
        <item name="colorOnPrimary">@color/onPrimaryYotsuba</item>
        <item name="colorSecondary">@color/secondaryYotsuba</item>
        <item name="colorControlHighlight">@color/rippleColorYotsuba</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantYotsuba</item>
    </style>

    <!--== Yin Yang theme ==-->
    <style name="Theme.Tachiyomi.YinYang">
        <!-- Theme colors -->
        <item name="colorPrimary">@color/primaryYinYang</item>
        <item name="colorPrimaryVariant">@color/primaryVariantYinYang</item>
        <item name="colorOnPrimary">@color/onPrimaryYinYang</item>
        <item name="colorPrimaryInverse">@color/primaryInverseYinYang</item>
        <item name="colorSecondary">@color/secondaryYinYang</item>
        <item name="colorControlHighlight">@color/rippleColorYinYang</item>
        <item name="colorOnSecondary">@color/onSecondaryYinYang</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantYinYang</item>
        <item name="colorTertiary">@color/downloadBadgeDayNight</item>
        <item name="colorOnTertiary">@color/colorOnDownloadBadgeDayNight</item>
    </style>

    <!--== Doki Theme ==-->
    <style name="Theme.Tachiyomi.Doki">
        <item name="colorPrimary">@color/primaryDoki</item>
        <item name="colorPrimaryVariant">@color/primaryVariantDoki</item>
        <item name="colorOnPrimary">@color/onPrimaryDoki</item>
        <item name="colorPrimaryInverse">@color/primaryInverseDoki</item>
        <item name="colorSecondary">@color/secondaryDoki</item>
        <item name="colorOnSecondary">@color/textColorPrimaryInverse</item>
        <item name="colorControlHighlight">@color/rippleColorDoki</item>
        <item name="colorSecondaryVariant">@color/secondaryVariantDoki</item>
        <item name="colorSurface">@color/backgroundDoki</item>
        <item name="background">@color/backgroundDoki</item>
        <item name="colorOnTertiary">@color/colorOnDownloadBadgeDayNight</item>
    </style>
    <style name="Theme.Tachiyomi.Monet"/>

    <!--===============-->
    <!-- Launch Screen -->
    <!--===============-->

    <!-- Splash -->
    <style name="Theme.Tachiyomi.SplashScreen" parent="Theme.SplashScreen">
        <item name="windowSplashScreenBackground">@color/splashBackground</item>
        <item name="windowSplashScreenAnimatedIcon">@drawable/ic_yokai_splash</item>
        <item name="postSplashScreenTheme">@style/Theme.Tachiyomi</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:navigationBarColor">@android:color/transparent</item>
        <item name="android:windowLightStatusBar">false</item>
        <item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
    </style>

    <style name="Theme.OSS" parent="Theme.Tachiyomi.Monet">
        <item name="colorPrimary">?colorPrimaryVariant</item>
        <item name="android:statusBarColor">?colorPrimaryVariant</item>
        <item name="windowActionBar">true</item>
        <item name="windowNoTitle">false</item>
    </style>
</resources>