<resources>
    <!-- Base application theme. -->
    <style name="Theme.SagerNet" parent="Theme.MaterialComponents.DayNight.NoActionBar">
        <item name="actionBarStyle">@style/Widget.MaterialComponents.ActionBar.Solid</item>
        <item name="actionModeCloseDrawable">@drawable/ic_navigation_close</item>
        <item name="colorButtonNormal">?colorAccent</item>
        <item name="android:navigationBarColor">?colorPrimaryDark</item>
        <item name="colorPrimary">@color/material_pink_500</item>
        <item name="colorPrimaryDark">@color/material_pink_700</item>
        <item name="colorAccent">@color/material_pink_accent_200</item>

        <item name="colorMaterial100">@color/material_pink_100</item>
        <item name="colorMaterial300">@color/material_pink_300</item>

        <item name="accentOrTextSecondary">?colorAccent</item>
        <item name="accentOrTextPrimary">?colorAccent</item>
        <item name="primaryOrTextSecondary">?colorPrimary</item>
        <item name="primaryOrTextPrimary">?colorPrimary</item>

        <item name="fabColorBackground">?colorPrimary</item>
        <item name="selectedColorPrimary">?colorPrimary</item>
        <item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
        <item name="tabTextColor">#99FFFFFF</item>
        <item name="tabSelectedTextColor">@color/white</item>
        <item name="tabIndicatorColor">@color/white</item>
        <item name="tabRippleColor">@color/white</item>
        <item name="whiteOrTextPrimary">@color/white</item>

        <item name="windowActionModeOverlay">true</item>

        <!-- Remove ActionBar but keep styles and themes -->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>

        <item name="chipStyle">@style/Widget.MaterialComponents.Chip.Choice.SagerNet</item>

        <item name="itemShapeAppearance">
            @style/ShapeAppearance.MaterialComponents.MediumComponent
        </item>

        <item name="alertDialogTheme">
            @style/ThemeOverlay.MaterialComponents.MaterialAlertDialog.SagerNet
        </item>

        <item name="materialAlertDialogTheme">
            @style/ThemeOverlay.MaterialComponents.MaterialAlertDialog.SagerNet
        </item>

    </style>

    <style name="Theme.SagerNet.Dialog" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
        <item name="actionBarStyle">@style/Widget.MaterialComponents.ActionBar.Solid</item>
        <item name="actionModeCloseDrawable">@drawable/ic_navigation_close</item>
        <item name="colorButtonNormal">?colorAccent</item>
        <item name="android:navigationBarColor">?colorPrimaryDark</item>
        <item name="colorPrimary">@color/material_pink_500</item>
        <item name="colorPrimaryDark">@color/material_pink_700</item>
        <item name="colorAccent">@color/material_pink_accent_200</item>

        <item name="colorMaterial100">@color/material_pink_100</item>
        <item name="colorMaterial300">@color/material_pink_300</item>

        <item name="accentOrTextSecondary">?colorAccent</item>
        <item name="accentOrTextPrimary">?colorAccent</item>
        <item name="primaryOrTextSecondary">?colorPrimary</item>
        <item name="primaryOrTextPrimary">?colorPrimary</item>

        <item name="fabColorBackground">?colorPrimary</item>
        <item name="selectedColorPrimary">?colorPrimary</item>
        <item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
        <item name="tabTextColor">#99FFFFFF</item>
        <item name="tabSelectedTextColor">@color/white</item>
        <item name="tabIndicatorColor">@color/white</item>
        <item name="tabRippleColor">@color/white</item>
        <item name="whiteOrTextPrimary">@color/white</item>

        <item name="windowActionModeOverlay">true</item>

        <!-- Remove ActionBar but keep styles and themes -->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>

        <item name="chipStyle">@style/Widget.MaterialComponents.Chip.Choice.SagerNet</item>

        <item name="itemShapeAppearance">
            @style/ShapeAppearance.MaterialComponents.MediumComponent
        </item>

        <item name="alertDialogTheme">
            @style/ThemeOverlay.MaterialComponents.MaterialAlertDialog.SagerNet
        </item>

        <item name="materialAlertDialogTheme">
            @style/ThemeOverlay.MaterialComponents.MaterialAlertDialog.SagerNet
        </item>

        <item name="windowFixedHeightMajor" type="dimen">95%</item>

    </style>

    <style name="AppearanceFoundation.Title" parent="TextAppearance.AppCompat.Title">
        <item name="android:textColor">?attr/colorOnSurface</item>
        <item name="android:textStyle">bold</item>
    </style>

    <style name="ThemeOverlay.MaterialComponents.MaterialAlertDialog.SagerNet">
        <item name="buttonBarPositiveButtonStyle">
            @style/Widget.MaterialComponents.Button.TextButton.Dialog.Primary
        </item>
        <item name="buttonBarNegativeButtonStyle">
            @style/Widget.MaterialComponents.Button.TextButton.Dialog.Primary
        </item>
        <item name="buttonBarNeutralButtonStyle">
            @style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush.Primary
        </item>
    </style>

    <style name="Widget.MaterialComponents.Button.TextButton.Dialog.Primary">
        <item name="android:textColor">?primaryOrTextPrimary</item>
    </style>

    <style name="Widget.MaterialComponents.Button.TextButton.Dialog.Flush.Primary">
        <item name="android:textColor">?primaryOrTextPrimary</item>
    </style>

    <style name="Widget.MaterialComponents.Chip.Choice.SagerNet">
        <item name="textStartPadding">30dp</item>
        <item name="textEndPadding">30dp</item>
        <item name="chipBackgroundColor">@color/chip_background</item>
        <item name="android:textColor">@color/chip_text_color</item>
        <item name="checkedIconTint">?primaryOrTextPrimary</item>
        <item name="rippleColor">@color/chip_ripple_color</item>
    </style>

    <style name="Theme.SagerNet.Pink_SSR">
        <item name="colorPrimary">@color/color_pink_ssr</item>
        <item name="colorPrimaryDark">@color/color_pink_ssr</item>
        <item name="colorAccent">@color/material_pink_accent_200</item>
        <item name="colorMaterial100">@color/material_pink_accent_100</item>
        <item name="colorMaterial300">@color/color_pink_ssr</item>
    </style>

    <style name="Theme.SagerNet.Amber">
        <item name="colorPrimary">@color/material_amber_500</item>
        <item name="colorPrimaryDark">@color/material_amber_700</item>
        <item name="colorAccent">@color/material_amber_accent_200</item>
        <item name="colorMaterial100">@color/material_amber_100</item>
        <item name="colorMaterial300">@color/material_amber_300</item>
    </style>

    <style name="Theme.SagerNet.Blue">
        <item name="colorPrimary">@color/material_blue_500</item>
        <item name="colorPrimaryDark">@color/material_blue_700</item>
        <item name="colorAccent">@color/material_blue_accent_200</item>
        <item name="colorMaterial100">@color/material_blue_100</item>
        <item name="colorMaterial300">@color/material_blue_300</item>
    </style>

    <style name="Theme.SagerNet.BlueGrey">
        <item name="colorPrimary">@color/material_blue_grey_500</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_700</item>
        <item name="colorAccent">@color/material_blue_grey_200</item>
        <item name="colorMaterial100">@color/material_blue_grey_100</item>
        <item name="colorMaterial300">@color/material_blue_grey_300</item>
    </style>

    <style name="Theme.SagerNet.Brown">
        <item name="colorPrimary">@color/material_brown_500</item>
        <item name="colorPrimaryDark">@color/material_brown_700</item>
        <item name="colorAccent">@color/material_brown_200</item>
        <item name="colorMaterial100">@color/material_brown_100</item>
        <item name="colorMaterial300">@color/material_brown_300</item>
    </style>

    <style name="Theme.SagerNet.Cyan">
        <item name="colorPrimary">@color/material_cyan_500</item>
        <item name="colorPrimaryDark">@color/material_cyan_700</item>
        <item name="colorAccent">@color/material_cyan_accent_200</item>
        <item name="colorMaterial100">@color/material_cyan_100</item>
        <item name="colorMaterial300">@color/material_cyan_300</item>
    </style>

    <style name="Theme.SagerNet.DeepOrange">
        <item name="colorPrimary">@color/material_deep_orange_500</item>
        <item name="colorPrimaryDark">@color/material_deep_orange_700</item>
        <item name="colorAccent">@color/material_deep_orange_accent_200</item>
        <item name="colorMaterial100">@color/material_deep_orange_100</item>
        <item name="colorMaterial300">@color/material_deep_orange_300</item>
    </style>

    <style name="Theme.SagerNet.DeepPurple">
        <item name="colorPrimary">@color/material_deep_purple_500</item>
        <item name="colorPrimaryDark">@color/material_deep_purple_700</item>
        <item name="colorAccent">@color/material_deep_purple_accent_200</item>
        <item name="colorMaterial100">@color/material_deep_purple_100</item>
        <item name="colorMaterial300">@color/material_deep_purple_300</item>
    </style>

    <style name="Theme.SagerNet.Green">
        <item name="colorPrimary">@color/material_green_500</item>
        <item name="colorPrimaryDark">@color/material_green_700</item>
        <item name="colorAccent">@color/material_green_accent_200</item>
        <item name="colorMaterial100">@color/material_green_100</item>
        <item name="colorMaterial300">@color/material_green_300</item>
    </style>

    <style name="Theme.SagerNet.Grey">
        <item name="colorPrimary">@color/material_grey_500</item>
        <item name="colorPrimaryDark">@color/material_grey_700</item>
        <item name="colorAccent">@color/material_grey_200</item>
        <item name="colorMaterial100">@color/material_grey_100</item>
        <item name="colorMaterial300">@color/material_grey_300</item>
    </style>

    <style name="Theme.SagerNet.Indigo">
        <item name="colorPrimary">@color/material_indigo_500</item>
        <item name="colorPrimaryDark">@color/material_indigo_700</item>
        <item name="colorAccent">@color/material_indigo_accent_200</item>
        <item name="colorMaterial100">@color/material_indigo_100</item>
        <item name="colorMaterial300">@color/material_indigo_300</item>
    </style>

    <style name="Theme.SagerNet.LightBlue">
        <item name="colorPrimary">@color/material_light_blue_500</item>
        <item name="colorPrimaryDark">@color/material_light_blue_700</item>
        <item name="colorAccent">@color/material_light_blue_accent_200</item>
        <item name="colorMaterial100">@color/material_light_blue_100</item>
        <item name="colorMaterial300">@color/material_light_blue_300</item>
    </style>

    <style name="Theme.SagerNet.LightGreen">
        <item name="colorPrimary">@color/material_light_green_500</item>
        <item name="colorPrimaryDark">@color/material_light_green_700</item>
        <item name="colorAccent">@color/material_light_green_accent_200</item>
        <item name="colorMaterial100">@color/material_light_green_100</item>
        <item name="colorMaterial300">@color/material_light_green_300</item>
    </style>

    <style name="Theme.SagerNet.Lime">
        <item name="colorPrimary">@color/material_lime_500</item>
        <item name="colorPrimaryDark">@color/material_lime_700</item>
        <item name="colorAccent">@color/material_lime_accent_200</item>
        <item name="colorMaterial100">@color/material_lime_100</item>
        <item name="colorMaterial300">@color/material_lime_300</item>
    </style>

    <style name="Theme.SagerNet.Orange">
        <item name="colorPrimary">@color/material_orange_500</item>
        <item name="colorPrimaryDark">@color/material_orange_700</item>
        <item name="colorAccent">@color/material_orange_accent_200</item>
        <item name="colorMaterial100">@color/material_orange_100</item>
        <item name="colorMaterial300">@color/material_orange_300</item>
    </style>

    <style name="Theme.SagerNet.Purple">
        <item name="colorPrimary">@color/material_purple_500</item>
        <item name="colorPrimaryDark">@color/material_purple_700</item>
        <item name="colorAccent">@color/material_purple_accent_200</item>
        <item name="colorMaterial100">@color/material_purple_100</item>
        <item name="colorMaterial300">@color/material_purple_300</item>
    </style>

    <style name="Theme.SagerNet.Red">
        <item name="colorPrimary">@color/material_red_500</item>
        <item name="colorPrimaryDark">@color/material_red_700</item>
        <item name="colorAccent">@color/material_red_accent_200</item>
        <item name="colorMaterial100">@color/material_red_100</item>
        <item name="colorMaterial300">@color/material_red_300</item>
    </style>

    <style name="Theme.SagerNet.Teal">
        <item name="colorPrimary">@color/material_teal_500</item>
        <item name="colorPrimaryDark">@color/material_teal_700</item>
        <item name="colorAccent">@color/material_teal_accent_200</item>
        <item name="colorMaterial100">@color/material_teal_100</item>
        <item name="colorMaterial300">@color/material_teal_300</item>
    </style>

    <style name="Theme.SagerNet.Yellow">
        <item name="colorPrimary">@color/material_yellow_500</item>
        <item name="colorPrimaryDark">@color/material_yellow_700</item>
        <item name="colorAccent">@color/material_yellow_accent_200</item>
        <item name="colorMaterial100">@color/material_yellow_100</item>
        <item name="colorMaterial300">@color/material_yellow_300</item>
        <item name="colorOnPrimarySurface">@color/black</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Amber">
        <item name="colorPrimary">@color/material_amber_500</item>
        <item name="colorPrimaryDark">@color/material_amber_700</item>
        <item name="colorAccent">@color/material_amber_accent_200</item>
        <item name="colorMaterial100">@color/material_amber_100</item>
        <item name="colorMaterial300">@color/material_amber_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Blue">
        <item name="colorPrimary">@color/material_blue_500</item>
        <item name="colorPrimaryDark">@color/material_blue_700</item>
        <item name="colorAccent">@color/material_blue_accent_200</item>
        <item name="colorMaterial100">@color/material_blue_100</item>
        <item name="colorMaterial300">@color/material_blue_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.BlueGrey">
        <item name="colorPrimary">@color/material_blue_grey_500</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_700</item>
        <item name="colorAccent">@color/material_blue_grey_200</item>
        <item name="colorMaterial100">@color/material_blue_grey_100</item>
        <item name="colorMaterial300">@color/material_blue_grey_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Brown">
        <item name="colorPrimary">@color/material_brown_500</item>
        <item name="colorPrimaryDark">@color/material_brown_700</item>
        <item name="colorAccent">@color/material_brown_200</item>
        <item name="colorMaterial100">@color/material_brown_100</item>
        <item name="colorMaterial300">@color/material_brown_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Cyan">
        <item name="colorPrimary">@color/material_cyan_500</item>
        <item name="colorPrimaryDark">@color/material_cyan_700</item>
        <item name="colorAccent">@color/material_cyan_accent_200</item>
        <item name="colorMaterial100">@color/material_cyan_100</item>
        <item name="colorMaterial300">@color/material_cyan_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.DeepOrange">
        <item name="colorPrimary">@color/material_deep_orange_500</item>
        <item name="colorPrimaryDark">@color/material_deep_orange_700</item>
        <item name="colorAccent">@color/material_deep_orange_accent_200</item>
        <item name="colorMaterial100">@color/material_deep_orange_100</item>
        <item name="colorMaterial300">@color/material_deep_orange_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.DeepPurple">
        <item name="colorPrimary">@color/material_deep_purple_500</item>
        <item name="colorPrimaryDark">@color/material_deep_purple_700</item>
        <item name="colorAccent">@color/material_deep_purple_accent_200</item>
        <item name="colorMaterial100">@color/material_deep_purple_100</item>
        <item name="colorMaterial300">@color/material_deep_purple_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Green">
        <item name="colorPrimary">@color/material_green_500</item>
        <item name="colorPrimaryDark">@color/material_green_700</item>
        <item name="colorAccent">@color/material_green_accent_200</item>
        <item name="colorMaterial100">@color/material_green_100</item>
        <item name="colorMaterial300">@color/material_green_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Grey">
        <item name="colorPrimary">@color/material_grey_500</item>
        <item name="colorPrimaryDark">@color/material_grey_700</item>
        <item name="colorAccent">@color/material_grey_200</item>
        <item name="colorMaterial100">@color/material_grey_100</item>
        <item name="colorMaterial300">@color/material_grey_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Indigo">
        <item name="colorPrimary">@color/material_indigo_500</item>
        <item name="colorPrimaryDark">@color/material_indigo_700</item>
        <item name="colorAccent">@color/material_indigo_accent_200</item>
        <item name="colorMaterial100">@color/material_indigo_100</item>
        <item name="colorMaterial300">@color/material_indigo_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.LightBlue">
        <item name="colorPrimary">@color/material_light_blue_500</item>
        <item name="colorPrimaryDark">@color/material_light_blue_700</item>
        <item name="colorAccent">@color/material_light_blue_accent_200</item>
        <item name="colorMaterial100">@color/material_light_blue_100</item>
        <item name="colorMaterial300">@color/material_light_blue_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.LightGreen">
        <item name="colorPrimary">@color/material_light_green_500</item>
        <item name="colorPrimaryDark">@color/material_light_green_700</item>
        <item name="colorAccent">@color/material_light_green_accent_200</item>
        <item name="colorMaterial100">@color/material_light_green_100</item>
        <item name="colorMaterial300">@color/material_light_green_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Lime">
        <item name="colorPrimary">@color/material_lime_500</item>
        <item name="colorPrimaryDark">@color/material_lime_700</item>
        <item name="colorAccent">@color/material_lime_accent_200</item>
        <item name="colorMaterial100">@color/material_lime_100</item>
        <item name="colorMaterial300">@color/material_lime_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Orange">
        <item name="colorPrimary">@color/material_orange_500</item>
        <item name="colorPrimaryDark">@color/material_orange_700</item>
        <item name="colorAccent">@color/material_orange_accent_200</item>
        <item name="colorMaterial100">@color/material_orange_100</item>
        <item name="colorMaterial300">@color/material_orange_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Purple">
        <item name="colorPrimary">@color/material_purple_500</item>
        <item name="colorPrimaryDark">@color/material_purple_700</item>
        <item name="colorAccent">@color/material_purple_accent_200</item>
        <item name="colorMaterial100">@color/material_purple_100</item>
        <item name="colorMaterial300">@color/material_purple_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Red">
        <item name="colorPrimary">@color/material_red_500</item>
        <item name="colorPrimaryDark">@color/material_red_700</item>
        <item name="colorAccent">@color/material_red_accent_200</item>
        <item name="colorMaterial100">@color/material_red_100</item>
        <item name="colorMaterial300">@color/material_red_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Pink_SSR">
        <item name="colorPrimary">@color/color_pink_ssr</item>
        <item name="colorPrimaryDark">@color/color_pink_ssr</item>
        <item name="colorAccent">@color/material_pink_accent_200</item>
        <item name="colorMaterial100">@color/material_pink_accent_100</item>
        <item name="colorMaterial300">@color/color_pink_ssr</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Teal">
        <item name="colorPrimary">@color/material_teal_500</item>
        <item name="colorPrimaryDark">@color/material_teal_700</item>
        <item name="colorAccent">@color/material_teal_accent_200</item>
        <item name="colorMaterial100">@color/material_teal_100</item>
        <item name="colorMaterial300">@color/material_teal_300</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Yellow">
        <item name="colorPrimary">@color/material_yellow_500</item>
        <item name="colorPrimaryDark">@color/material_yellow_700</item>
        <item name="colorAccent">@color/material_yellow_accent_200</item>
        <item name="colorMaterial100">@color/material_yellow_100</item>
        <item name="colorMaterial300">@color/material_yellow_300</item>
        <item name="colorOnPrimarySurface">@color/black</item>
    </style>

    <style name="Theme.SagerNet.Black">
        <item name="colorPrimary">@color/color_ng_black_primary</item>
        <item name="colorPrimaryDark">@color/color_ng_black_primary</item>
        <item name="colorAccent">@color/color_ng_black_accent</item>
        <item name="colorMaterial100">@color/color_ng_black_primary</item>
        <item name="colorMaterial300">@color/color_ng_black_primary</item>

        <item name="selectedColorPrimary">@color/color_ng_black_accent</item>
        <item name="fabColorBackground">@color/color_ng_black_accent</item>
        <item name="itemShapeFillColor">@color/color_ng_black_accent</item>

        <item name="accentOrTextSecondary">?android:textColorSecondary</item>
        <item name="accentOrTextPrimary">?android:textColorPrimary</item>
        <item name="primaryOrTextSecondary">?android:textColorSecondary</item>
        <item name="primaryOrTextPrimary">?android:textColorPrimary</item>
    </style>

    <style name="Theme.SagerNet.Dialog.Black">
        <item name="colorPrimary">@color/color_ng_black_primary</item>
        <item name="colorPrimaryDark">@color/color_ng_black_primary</item>
        <item name="colorAccent">@color/color_ng_black_accent</item>
        <item name="colorMaterial100">@color/color_ng_black_primary</item>
        <item name="colorMaterial300">@color/color_ng_black_primary</item>

        <item name="selectedColorPrimary">@color/color_ng_black_accent</item>
        <item name="fabColorBackground">@color/color_ng_black_accent</item>
        <item name="itemShapeFillColor">@color/color_ng_black_accent</item>

        <item name="accentOrTextSecondary">?android:textColorSecondary</item>
        <item name="accentOrTextPrimary">?android:textColorPrimary</item>
        <item name="primaryOrTextSecondary">?android:textColorSecondary</item>
        <item name="primaryOrTextPrimary">?android:textColorPrimary</item>
    </style>

    <style name="Theme.Start" parent="Theme.MaterialComponents.DayNight">
        <item name="android:navigationBarColor">@android:color/transparent</item>
        <item name="colorPrimary">@android:color/transparent</item>
        <item name="colorPrimaryDark">@android:color/transparent</item>
        <item name="android:backgroundDimEnabled">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

</resources>