"""
Footer component schemas.

Mirrors lightwave-ui/src/components/marketing/footers/.
"""

from pydantic import BaseModel, ConfigDict, Field

from lightwave.schema.pydantic.ui.types import FooterNavItem, SocialLink


class FooterNavCategory(BaseModel):
    """
    Category of footer navigation items.

    Matches TypeScript FooterNavCategory interface used by FooterLarge01 etc.
    """

    label: str = Field(..., description="Category label")
    items: list[FooterNavItem] = Field(default_factory=list, description="Navigation items in this category")

    model_config = ConfigDict(
        populate_by_name=True,
        extra="forbid",
    )


# Backwards compatibility alias
FooterLinkGroup = FooterNavCategory


class FooterProps(BaseModel):
    """
    Base footer props.
    """

    # Logo/Brand
    logo_url: str | None = Field(None, serialization_alias="logoUrl", description="Logo image URL")
    logo_url_dark: str | None = Field(None, serialization_alias="logoUrlDark", description="Dark mode logo URL")
    brand_name: str | None = Field(None, serialization_alias="brandName", description="Brand name")

    # Navigation
    nav_categories: list[FooterNavCategory] | None = Field(
        None, serialization_alias="navCategories", description="Navigation categories"
    )
    bottom_links: list[FooterNavItem] | None = Field(
        None, serialization_alias="bottomLinks", description="Bottom row links"
    )

    # Social
    social_links: list[SocialLink] | None = Field(
        None, serialization_alias="socialLinks", description="Social media links"
    )

    # Legal
    copyright_text: str | None = Field(None, serialization_alias="copyrightText", description="Copyright text")

    # Newsletter
    show_newsletter: bool | None = Field(
        False, serialization_alias="showNewsletter", description="Show newsletter form"
    )
    newsletter_heading: str | None = Field(
        None, serialization_alias="newsletterHeading", description="Newsletter heading"
    )
    newsletter_text: str | None = Field(
        None, serialization_alias="newsletterText", description="Newsletter description"
    )

    model_config = ConfigDict(
        populate_by_name=True,
        extra="forbid",
    )


class FooterLarge03Props(FooterProps):
    """
    Large footer variant 03.
    """

    pass


class FooterLarge07Props(FooterProps):
    """
    Large footer variant 07.
    """

    pass


class FooterLarge15BrandProps(FooterProps):
    """
    Large footer with brand styling.
    """

    brand_color: str | None = Field(None, serialization_alias="brandColor", description="Brand accent color")


class FooterSmall02Props(FooterProps):
    """
    Small/minimal footer variant 02.
    """

    pass


class FooterSmall03Props(FooterProps):
    """
    Small/minimal footer variant 03.
    """

    pass


__all__ = [
    "FooterNavCategory",
    "FooterLinkGroup",  # Backwards compat alias
    "FooterProps",
    "FooterLarge03Props",
    "FooterLarge07Props",
    "FooterLarge15BrandProps",
    "FooterSmall02Props",
    "FooterSmall03Props",
]
