using Xamarin.Forms;

namespace Billing.Themes
{
    public class Light : BaseTheme
    {
        private static Light _instance;

        public static Light Instance => _instance ??= new Light();

        protected override Color PrimaryMauiColor => Color.FromRgb(0x18, 0x31, 0x53);
        protected override Color SecondaryMauiColor => Color.White;

        public Light()
        {
            InitColors();
            InitResources();
        }

        private void InitColors()
        {
            Add(WindowBackgroundColor, Color.White);
            Add(OptionTintColor, Color.White);
            Add(PromptBackgroundColor, Color.FromRgb(0xe0, 0xe0, 0xe0));
            Add(TabBarBackgroundColor, Color.White);
            Add(TabBarUnselectedColor, Color.FromRgb(0x82, 0x82, 0x82));
            Add(OutRangeDayColor, Color.LightGray);
            Add(TextColor, Color.FromRgb(0x33, 0x33, 0x33));
            Add(SecondaryTextColor, Color.DimGray);
            Add(RedColor, Color.FromRgb(211, 64, 85));

            Add(new Style(typeof(TabBar))
            {
                Setters =
                {
                    new Setter { Property = Shell.TabBarBackgroundColorProperty, Value = Color.White },
                    new Setter { Property = Shell.TabBarTitleColorProperty, Value = PrimaryMauiColor },
                    new Setter { Property = Shell.TabBarUnselectedColorProperty, Value = Color.FromRgb(0x82, 0x82, 0x82) }
                }
            });
            Add(new Style(typeof(TableView))
            {
                Setters =
                {
                    new Setter { Property = VisualElement.BackgroundColorProperty, Value = Color.FromRgb(242, 241, 245) }
                }
            });
        }
    }
}