"""
Header section (hero) component schemas.

Mirrors lightwave-ui/src/components/marketing/header-section/.

These schemas define the props interface for hero section components.
They are designed to be tenant-agnostic with CDN-driven image URLs.
"""

from pydantic import BaseModel, ConfigDict, Field

from lightwave.schema.pydantic.ui.components.marketing.header_navigation import (
    HeaderProps,
)


class PartnerLogo(BaseModel):
    """
    Partner logo configuration for social proof sections.

    Example:
        logo = PartnerLogo(
            name="Acme Corp",
            src="https://cdn.lightwave-media.ltd/logos/acme-light.svg",
            src_dark="https://cdn.lightwave-media.ltd/logos/acme-dark.svg",
        )
    """

    name: str = Field(..., description="Partner/company name (used for alt text)")
    src: str = Field(..., description="Logo URL (light mode)")
    src_dark: str | None = Field(
        None,
        serialization_alias="srcDark",
        description="Logo URL (dark mode, optional - falls back to src with opacity)",
    )

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


class HeaderSectionProps(BaseModel):
    """
    Base header section props shared by all hero variants.

    Props follow UntitledUI naming conventions with semantic names.
    All image URLs default to CDN paths for tenant-agnostic operation.
    """

    # Header configuration
    header_variant: str | None = Field(
        None,
        serialization_alias="headerVariant",
        description="Header variant to use from registry (e.g., 'HeaderFloating')",
    )
    header_props: HeaderProps | None = Field(
        None,
        serialization_alias="headerProps",
        description="Props passed to embedded Header component",
    )
    show_header: bool | None = Field(
        None,
        serialization_alias="showHeader",
        description="Show embedded header (default: true)",
    )

    # Content
    heading: str | None = Field(None, description="Main headline text")
    subheading: str | None = Field(None, description="Description text below headline")

    # CTAs
    primary_cta_label: str | None = Field(
        None,
        serialization_alias="primaryCtaLabel",
        description="Primary CTA button label",
    )
    primary_cta_href: str | None = Field(
        None,
        serialization_alias="primaryCtaHref",
        description="Primary CTA button URL",
    )
    secondary_cta_label: str | None = Field(
        None,
        serialization_alias="secondaryCtaLabel",
        description="Secondary CTA button label",
    )
    secondary_cta_href: str | None = Field(
        None,
        serialization_alias="secondaryCtaHref",
        description="Secondary CTA button URL",
    )

    # Background pattern
    pattern_desktop: str | None = Field(
        None,
        serialization_alias="patternDesktop",
        description="Background pattern image URL (desktop)",
    )
    pattern_mobile: str | None = Field(
        None,
        serialization_alias="patternMobile",
        description="Background pattern image URL (mobile)",
    )

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


class HeroScreenMockup01Props(HeaderSectionProps):
    """
    Hero with centered screen mockup.

    Matches TypeScript HeroScreenMockup01Props from hero-screen-mockup-01.tsx.

    Example:
        hero = HeroScreenMockup01Props(
            heading="Tools for Modern Creative Teams",
            subheading="Build, ship, and scale your creative projects.",
            primary_cta_label="Sign up",
            primary_cta_href="/signup",
            mockup_light="https://cdn.lightwave-media.ltd/mockups/dashboard-light.webp",
            mockup_dark="https://cdn.lightwave-media.ltd/mockups/dashboard-dark.webp",
        )
    """

    # Mockup images
    mockup_light: str | None = Field(
        None,
        serialization_alias="mockupLight",
        description="Mockup image URL (light mode)",
    )
    mockup_dark: str | None = Field(
        None,
        serialization_alias="mockupDark",
        description="Mockup image URL (dark mode)",
    )


class HeroScreenMockup02Props(HeaderSectionProps):
    """
    Hero with screen mockup and partner logos social proof section.

    Matches TypeScript HeroScreenMockup02Props from hero-screen-mockup-02.tsx.

    Example:
        hero = HeroScreenMockup02Props(
            heading="Beautiful analytics to grow smarter",
            subheading="Powerful, self-serve analytics for growing teams.",
            primary_cta_label="Get started",
            social_proof_label="Join 4,000+ companies already growing with us",
            partner_logos=[
                {"name": "Acme", "src": "https://cdn.../acme.svg"},
                {"name": "Globex", "src": "https://cdn.../globex.svg"},
            ],
            mockup_light="https://cdn.../mockup-light.webp",
            mockup_dark="https://cdn.../mockup-dark.webp",
        )
    """

    # Social proof section
    social_proof_label: str | None = Field(
        None,
        serialization_alias="socialProofLabel",
        description="Label above partner logos (e.g., 'Join 4,000+ companies...')",
    )
    partner_logos: list[PartnerLogo] | None = Field(
        None,
        serialization_alias="partnerLogos",
        description="Array of partner logos to display",
    )

    # Mockup images
    mockup_light: str | None = Field(
        None,
        serialization_alias="mockupLight",
        description="Mockup image URL (light mode)",
    )
    mockup_dark: str | None = Field(
        None,
        serialization_alias="mockupDark",
        description="Mockup image URL (dark mode)",
    )
    mockup_alt: str | None = Field(
        None,
        serialization_alias="mockupAlt",
        description="Alt text for mockup image",
    )


class HeroSimpleText01Props(HeaderSectionProps):
    """
    Hero with simple text layout and underlined emphasis.

    Matches TypeScript HeroSimpleText01Props from hero-simple-text-01.tsx.

    Example:
        hero = HeroSimpleText01Props(
            heading="Welcome to",
            text="Acme",
            heading2="the future",
            subheading="Build amazing things.",
            primary_cta_label="Get Started",
            primary_cta_href="/signup",
        )
    """

    # Additional text segments
    text: str | None = Field(
        None,
        description="Underlined/emphasized text (middle section)",
    )
    heading2: str | None = Field(
        None,
        description="Second line of headline",
    )

    # Hero image
    hero_image_url: str | None = Field(
        None,
        serialization_alias="heroImageUrl",
        description="Hero image URL",
    )
    hero_image_alt: str | None = Field(
        None,
        serialization_alias="heroImageAlt",
        description="Hero image alt text",
    )


class HeroCardMockup01Props(HeaderSectionProps):
    """
    Hero with card mockup.
    """

    card_image_url: str | None = Field(
        None,
        serialization_alias="cardImageUrl",
        description="Card mockup image URL",
    )
    card_image_alt: str | None = Field(
        None,
        serialization_alias="cardImageAlt",
        description="Card mockup alt text",
    )


class HeroIphoneMockup02Props(HeaderSectionProps):
    """
    Hero with iPhone mockup.
    """

    iphone_image_url: str | None = Field(
        None,
        serialization_alias="iphoneImageUrl",
        description="iPhone mockup URL",
    )
    iphone_image_alt: str | None = Field(
        None,
        serialization_alias="iphoneImageAlt",
        description="iPhone mockup alt text",
    )


class HeroAbstractAngles04Props(HeaderSectionProps):
    """
    Hero with abstract angle background.
    """

    angle_color: str | None = Field(
        None,
        serialization_alias="angleColor",
        description="Angle background color",
    )


__all__ = [
    "PartnerLogo",
    "HeaderSectionProps",
    "HeroScreenMockup01Props",
    "HeroScreenMockup02Props",
    "HeroSimpleText01Props",
    "HeroCardMockup01Props",
    "HeroIphoneMockup02Props",
    "HeroAbstractAngles04Props",
]
