"""Theme configuration types.

ThemeConfig and NarrativeConfig are pure data structures.
Themes are defined in subdirectories (e.g., film_noir/) and
registered with a ThemeRegistry at app startup.
"""

from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from pathlib import Path


@dataclass(frozen=True)
class NarrativeConfig:
    """Theme-specific narrative instructions for LLM prompt injection."""

    tone: str
    title_examples: list[str]
    intro_style: str
    outro_style: str


@dataclass(frozen=True)
class ThemeConfig:
    """Configuration for a TUI theme."""

    name: str
    display_name: str
    css_path: Path
    aliases: dict[str, str]
    vocabulary: dict[str, str]
    narrative: NarrativeConfig
    colors: dict[str, str]
    decorations: dict[str, str]
    icons: dict[str, str]

    def decoration(self, key: str) -> str:
        return self.decorations.get(key, key)

    def icon(self, key: str) -> str:
        return self.icons.get(key, key)

    def vocab(self, key: str) -> str:
        return self.vocabulary.get(key, key)

    def alias(self, key: str) -> str:
        return self.aliases.get(key, key)

    def color(self, key: str) -> str:
        return self.colors.get(key, key)
