// ============================================================================
//  Science Street — Shared Color Palette
//  AL-Arcade Game Dev Team
// ============================================================================
using UnityEngine;

namespace com.al_arcade.shared
{
    /// <summary>
    /// Central color definitions matching the Science Street brand.
    /// </summary>
    public static class SSColorPalette
    {
        // ── Brand Colors ─────────────────────────────────────────────
        public static readonly Color Primary      = new Color32(48, 48, 208, 255);    // #3030D0
        public static readonly Color PrimaryDark  = new Color32(32, 32, 168, 255);    // #2020A8
        public static readonly Color PrimaryLight = new Color32(80, 80, 220, 255);    // #5050DC
        public static readonly Color Accent       = new Color32(254, 215, 0, 255);    // #FED700
        public static readonly Color AccentDark   = new Color32(212, 180, 0, 255);    // #D4B400

        // ── Feedback Colors ──────────────────────────────────────────
        public static readonly Color Success      = new Color32(16, 185, 129, 255);   // #10B981
        public static readonly Color SuccessLight = new Color32(209, 250, 229, 255);  // #D1FAE5
        public static readonly Color Danger       = new Color32(239, 68, 68, 255);    // #EF4444
        public static readonly Color DangerLight  = new Color32(254, 226, 226, 255);  // #FEE2E2
        public static readonly Color Warning      = new Color32(245, 158, 11, 255);   // #F59E0B
        public static readonly Color Info         = new Color32(59, 130, 246, 255);   // #3B82F6

        // ── UI Colors ────────────────────────────────────────────────
        public static readonly Color Background   = new Color32(238, 240, 248, 255);  // #EEF0F8
        public static readonly Color Card         = Color.white;
        public static readonly Color TextDark     = new Color32(26, 26, 46, 255);     // #1A1A2E
        public static readonly Color TextMuted    = new Color32(107, 114, 128, 255);  // #6B7280
        public static readonly Color Border       = new Color32(229, 231, 235, 255);  // #E5E7EB

        // ── Game-specific ────────────────────────────────────────────
        public static readonly Color GateCorrect  = new Color32(16, 185, 129, 255);
        public static readonly Color GateWrong    = new Color32(239, 68, 68, 255);
        public static readonly Color GateDefault  = new Color32(80, 80, 220, 255);
        public static readonly Color TrueGreen    = new Color32(34, 197, 94, 255);    // #22C55E
        public static readonly Color FalseRed     = new Color32(239, 68, 68, 255);    // #EF4444
        public static readonly Color WrongWord    = new Color32(239, 68, 68, 255);
        public static readonly Color CorrectWord  = new Color32(16, 185, 129, 255);
        public static readonly Color NeutralWord  = new Color32(248, 249, 252, 255);

        // ── Helpers ──────────────────────────────────────────────────
        public static Color WithAlpha(Color c, float a)
        {
            return new Color(c.r, c.g, c.b, a);
        }

        public static Color Lerp3(Color a, Color b, Color c, float t)
        {
            if (t < 0.5f) return Color.Lerp(a, b, t * 2f);
            return Color.Lerp(b, c, (t - 0.5f) * 2f);
        }
    }
}
