using MudBlazor;

namespace FrontOffice.Main.Utilities;

public static class CustomMudTheme
{
    // ── Shared font stack ──
    private static readonly string[] VazirFontFamily = ["Vazir", "Tahoma", "Segoe UI", "Arial", "sans-serif"];

    public static MudTheme CustomMudBlazorTheme { get; set; } = new()
    {
        // ═══════════════════════════════════════
        //  Light Palette
        // ═══════════════════════════════════════
        PaletteLight = new PaletteLight()
        {
            Primary = "#6366f1",              // Indigo — هویت اصلی برند
            PrimaryDarken = "#4f46e5",
            PrimaryLighten = "#818cf8",
            PrimaryContrastText = "#FFFFFF",
            Secondary = "#8b5cf6",            // Purple
            SecondaryDarken = "#7c3aed",
            SecondaryLighten = "#a78bfa",
            SecondaryContrastText = "#FFFFFF",
            Tertiary = "#06b6d4",             // Cyan — accent
            Info = "#3b82f6",
            InfoContrastText = "#FFFFFF",
            Success = "#10b981",
            SuccessContrastText = "#FFFFFF",
            Warning = "#f59e0b",
            WarningContrastText = "#FFFFFF",
            Error = "#ef4444",
            ErrorContrastText = "#FFFFFF",
            Background = "#f8f9fc",           // Slightly cooler than plain gray
            Surface = "#FFFFFF",
            AppbarBackground = "#f8f9fc",
            AppbarText = "#424242",
            TextPrimary = "#1e293b",          // Slate 800
            TextSecondary = "#64748b",        // Slate 500
            TextDisabled = "#94a3b8",         // Slate 400
            Divider = "#e2e8f0",             // Slate 200 — softer than old #B2BFCB
            DrawerBackground = "#FFFFFF",
            DrawerText = "#1e293b",
            DrawerIcon = "#64748b",
        },

        // ═══════════════════════════════════════
        //  Dark Palette
        // ═══════════════════════════════════════
        PaletteDark = new PaletteDark()
        {
            Primary = "#818cf8",              // Lighter indigo for dark BG
            PrimaryDarken = "#6366f1",
            PrimaryLighten = "#a5b4fc",
            PrimaryContrastText = "#0f0f23",
            Secondary = "#a78bfa",
            SecondaryDarken = "#8b5cf6",
            SecondaryLighten = "#c4b5fd",
            SecondaryContrastText = "#0f0f23",
            Tertiary = "#22d3ee",
            Info = "#60a5fa",
            InfoContrastText = "#0f172a",
            Success = "#34d399",
            SuccessContrastText = "#0f172a",
            Warning = "#fbbf24",
            WarningContrastText = "#0f172a",
            Error = "#f87171",
            ErrorContrastText = "#0f172a",
            Background = "#0f172a",           // Slate 900
            Surface = "#1e293b",              // Slate 800
            AppbarBackground = "#0f172a",
            AppbarText = "#e2e8f0",
            TextPrimary = "#f1f5f9",          // Slate 100
            TextSecondary = "#94a3b8",        // Slate 400
            TextDisabled = "#475569",         // Slate 600
            Divider = "#334155",              // Slate 700
            DrawerBackground = "#1e293b",
            DrawerText = "#f1f5f9",
            DrawerIcon = "#94a3b8",
        },

        // ═══════════════════════════════════════
        //  Layout Properties
        // ═══════════════════════════════════════
        LayoutProperties = new LayoutProperties
        {
            DefaultBorderRadius = "12px",
            AppbarHeight = "56px",
            DrawerWidthLeft = "280px",
            DrawerWidthRight = "280px",
        },

        // ═══════════════════════════════════════
        //  Typography
        // ═══════════════════════════════════════
        Typography = new Typography
        {
            Default = new DefaultTypography() { FontFamily = VazirFontFamily },
            H1 = new H1Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "2rem", LineHeight = "1.70",
                FontWeight = "800", LetterSpacing = "normal"
            },
            H2 = new H2Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "1.875rem", LineHeight = "1.65",
                FontWeight = "800", LetterSpacing = "normal"
            },
            H3 = new H3Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "1.5rem", LineHeight = "1.60",
                FontWeight = "800", LetterSpacing = "normal"
            },
            H4 = new H4Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "1.25rem", LineHeight = "1.55",
                FontWeight = "800", LetterSpacing = "normal"
            },
            H5 = new H5Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "1.125rem", LineHeight = "1.50",
                FontWeight = "800", LetterSpacing = "normal"
            },
            H6 = new H6Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "1rem", LineHeight = "1.45",
                FontWeight = "800", LetterSpacing = "normal"
            },
            Subtitle1 = new Subtitle1Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "1rem", LineHeight = "1.62",
                FontWeight = "500", LetterSpacing = "normal"
            },
            Subtitle2 = new Subtitle2Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "0.875rem", LineHeight = "1.60",
                FontWeight = "500", LetterSpacing = "normal"
            },
            Body1 = new Body1Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "1rem", LineHeight = "1.85",
                FontWeight = "400", LetterSpacing = "normal"
            },
            Body2 = new Body2Typography()
            {
                FontFamily = VazirFontFamily, FontSize = "0.875rem", LineHeight = "1.80",
                FontWeight = "400", LetterSpacing = "normal"
            },
            Caption = new CaptionTypography()
            {
                FontFamily = VazirFontFamily, FontSize = "0.75rem", LineHeight = "1.60",
                FontWeight = "400", LetterSpacing = "normal"
            },
            Overline = new OverlineTypography()
            {
                FontFamily = VazirFontFamily, FontSize = "0.75rem", LineHeight = "1.60",
                FontWeight = "500", LetterSpacing = "normal"
            },
            Button = new ButtonTypography()
            {
                FontFamily = VazirFontFamily, FontSize = "0.875rem", LineHeight = "1.60",
                FontWeight = "600", LetterSpacing = "normal", TextTransform = "none"
            }
        }
    };
}