"""Theme bundles all design tokens into a single injectable object.

Aligned with Smartbank Figma design system.
"""

from dataclasses import dataclass, field

from smarty_ui.tokens.colors import ColorTokens
from smarty_ui.tokens.typography import TypographyTokens
from smarty_ui.tokens.spacing import SpacingTokens


@dataclass(frozen=True)
class Theme:
    """Frozen theme that bundles color, typography, and spacing tokens.

    Every visual component accepts a ``theme`` kwarg defaulting to
    ``default_theme``.  To customise, create a new ``Theme`` with
    overridden token dataclasses.
    """

    colors: ColorTokens = field(default_factory=ColorTokens)
    typography: TypographyTokens = field(default_factory=TypographyTokens)
    spacing: SpacingTokens = field(default_factory=SpacingTokens)


# Smartbank theme (primary theme based on Figma design)
smartbank_theme = Theme()

# Default theme is now Smartbank
default_theme = smartbank_theme

# Dark theme variant
dark_theme = Theme(
    colors=ColorTokens(
        primary="#076AE2",
        primary_hover="#035DCA",
        blue_light="#1E293B",
        blue_light_hover="#334155",
        text_primary="#F8FAFC",
        text_secondary="#94A3B8",
        text_on_primary="#FFFFFF",
        grey_dark="#94A3B8",
        grey_medium="#334155",
        grey_light="#1E293B",
        background="#0F172A",
        surface="#1E293B",
        border="#334155",
        border_light="#475569",
        error="#EF4444",
        success="#22C55E",
        warning="#F59E0B",
        info="#3B82F6",
        disabled_bg="#334155",
        disabled_text="#64748B",
    ),
)

# Legacy alias for backward compatibility
light_theme = smartbank_theme
