"""
Storm Logger Console Themes
Brand colors and styling for Storm Development
"""

from rich.theme import Theme

# Storm Development Complete Brand Palette
STORM_COLORS = {
    # Primary Brand Colors
    "storm-off-white": "#dbdbd0",
    "storm-cream": "#e8e8df",
    "storm-sage-dark": "#364f33",
    "storm-sage": "#374529",
    "storm-gray": "#6f6d76",
    "storm-blue": "#587a84",
    "storm-charcoal": "#29323b",
    "storm-beige": "#b3b09f",
    "storm-teal-dark": "#344a4d",
    "storm-stone": "#5e5d5d",
    "storm-cyan": "#418791",
    "storm-pine": "#466b5d",
    "storm-mauve": "#866068",
    "storm-tan": "#8f897b",
    "storm-rust": "#9e6a55",
    "storm-bronze": "#be9167",
    "storm-navy": "#375c69",
    "storm-rose": "#9c525a",
    "storm-slate": "#3e3c42",
    "storm-midnight": "#304452",
    "storm-copper": "#8f422c",
    "storm-black-bean": "#292225",
    "storm-amber": "#995325",
    "storm-brown": "#403125",
    "storm-caramel": "#ab6c2c",
    "storm-sienna": "#5e431f",
    "storm-gold": "#ccab78",
    "storm-ochre": "#996d20",
    "storm-brass": "#a67c23",
    "storm-black": "#000000",
    "storm-wood": "#b27f52",
    "storm-butter": "#fff8c2",
    "storm-yellow": "#ffcc67",
    "storm-yellow-hover": "#ffbf47",
    "storm-magenta": "#b1317f",
    "storm-pink": "#d964ab",
    "storm-fuchsia": "#c54091",
    "storm-light-pink": "#f6b0db",
    "storm-royal-blue": "#003190",
}

# Professional Storm Development Theme
storm_theme = Theme(
    {
        # Primary styles with Storm colors
        "storm.primary": STORM_COLORS["storm-royal-blue"],
        "storm.secondary": STORM_COLORS["storm-yellow"],
        "storm.success": STORM_COLORS["storm-pine"],
        "storm.error": STORM_COLORS["storm-copper"],
        "storm.warning": STORM_COLORS["storm-amber"],
        "storm.info": STORM_COLORS["storm-cyan"],
        "storm.debug": STORM_COLORS["storm-gray"],
        "storm.highlight": STORM_COLORS["storm-brass"],
        # Text styles
        "storm.text": STORM_COLORS["storm-charcoal"],
        "storm.text.light": STORM_COLORS["storm-cream"],
        "storm.text.muted": STORM_COLORS["storm-gray"],
        # Business contexts
        "storm.django": f"bold {STORM_COLORS['storm-blue']}",
        "storm.midas": f"bold {STORM_COLORS['storm-brass']}",
        "storm.animation": f"bold {STORM_COLORS['storm-mauve']}",
        "storm.business": f"bold {STORM_COLORS['storm-pine']}",
        # Professional formatting
        "storm.header": f"bold white on {STORM_COLORS['storm-royal-blue']}",
        "storm.subheader": f"bold {STORM_COLORS['storm-navy']}",
        "storm.metric": f"bold {STORM_COLORS['storm-pine']}",
        "storm.kpi": f"bold {STORM_COLORS['storm-brass']}",
        # Border styles - use actual hex colors, not color names
        "storm-royal-blue": STORM_COLORS["storm-royal-blue"],
        "storm-blue": STORM_COLORS["storm-blue"],
        "storm-pine": STORM_COLORS["storm-pine"],
        "storm-amber": STORM_COLORS["storm-amber"],
        "storm-copper": STORM_COLORS["storm-copper"],
        "storm-cyan": STORM_COLORS["storm-cyan"],
        "storm-success": STORM_COLORS["storm-pine"],
        "storm-error": STORM_COLORS["storm-copper"],
        "storm-warning": STORM_COLORS["storm-amber"],
        "storm-info": STORM_COLORS["storm-cyan"],
        "storm-debug": STORM_COLORS["storm-gray"],
    }
)

# Theme variants
THEMES = {
    "default": storm_theme,
    "professional": Theme(
        {
            **storm_theme.styles,
            "storm.primary": f"bold {STORM_COLORS['storm-royal-blue']}",
            "storm.secondary": f"bold {STORM_COLORS['storm-brass']}",
            "storm.text": STORM_COLORS["storm-charcoal"],
        }
    ),
    "minimal": Theme(
        {
            "storm.primary": "blue",
            "storm.secondary": "yellow",
            "storm.success": "green",
            "storm.error": "red",
            "storm.warning": "yellow",
            "storm.info": "cyan",
            "storm.debug": "dim",
        }
    ),
    "enterprise": Theme(
        {
            **storm_theme.styles,
            "storm.primary": f"bold {STORM_COLORS['storm-navy']}",
            "storm.secondary": f"bold {STORM_COLORS['storm-gold']}",
            "storm.header": f"bold white on {STORM_COLORS['storm-navy']}",
            "storm.business": f"bold {STORM_COLORS['storm-gold']}",
        }
    ),
}


def get_theme(theme_name: str = "default") -> Theme:
    """Get a Storm theme by name."""
    return THEMES.get(theme_name, storm_theme)
