using UnityEngine;

namespace MajacloudSdk.Editor
{
    /// <summary>Soft palette for the demo scenes (accent taken from the Majacloud logo).</summary>
    internal static class UiTheme
    {
        public static readonly Color Bg = Hex("#F3F6FB");
        public static readonly Color Panel = Hex("#FFFFFF");
        public static readonly Color Panel2 = Hex("#EDF1F7");
        public static readonly Color Row = Hex("#F7F9FC");
        public static readonly Color Code = Hex("#F1F4FA");
        public static readonly Color CodeText = Hex("#22314F");
        public static readonly Color Text = Hex("#13213C");
        public static readonly Color Muted = Hex("#6A7890");
        public static readonly Color Accent = Hex("#2F7BF6");
        public static readonly Color AccentInk = Hex("#1A56C4");
        public static readonly Color AccentSoft = Hex("#EAF1FF");
        public static readonly Color OnAccent = Hex("#FFFFFF");
        public static readonly Color Danger = Hex("#D93F44");
        public static readonly Color DangerSoft = Hex("#FDEEEE");
        public static readonly Color Dark = Hex("#13213C");

        public const int Title = 52;
        public const int Heading = 40;
        public const int Body = 34;
        public const int Small = 28;
        public const int Tiny = 24;

        public const float RadiusCard = 36f;
        public const float RadiusControl = 26f;

        /// <summary>Corner radius for a fully rounded shape of this height.</summary>
        public static float Pill(float height) => height / 2f;

        public static Color Hex(string hex)
        {
            return ColorUtility.TryParseHtmlString(hex, out var color) ? color : Color.magenta;
        }
    }
}
