"""
Features section component schemas.

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

from pydantic import BaseModel, ConfigDict, Field

from lightwave.schema.pydantic.ui.types import CTAProps


class FeatureItem(BaseModel):
    """
    Individual feature item.

    Matches TypeScript:
        interface FeatureItem {
            title: string;
            subtitle?: string;
            description?: string;
            icon?: string;
            href?: string;
        }
    """

    title: str = Field(..., description="Feature title")
    subtitle: str | None = Field(None, description="Feature subtitle/description")
    description: str | None = Field(None, description="Longer description")
    icon: str | None = Field(None, description="Icon name")
    href: str | None = Field(None, description="Learn more link")

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


class FeaturesSectionProps(BaseModel):
    """
    Base features section props.
    """

    eyebrow: str | None = Field(None, description="Small text above heading")
    headline: str | None = Field(None, description="Section headline")
    description: str | None = Field(None, description="Section description")
    features: list[FeatureItem] | None = Field(None, description="List of feature items")
    cta: CTAProps | None = Field(None, description="Optional CTA")

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


class FeaturesSimpleIcons04Props(FeaturesSectionProps):
    """
    Features with simple icons in a grid layout.
    """

    icon: str | None = Field(None, description="Main section icon")
    icon_color: str | None = Field(None, serialization_alias="iconColor", description="Icon color")


class FeaturesIconsAndMockup01Props(FeaturesSectionProps):
    """
    Features with icons alongside a mockup image.
    """

    mockup_image_url: str | None = Field(None, serialization_alias="mockupImageUrl", description="Mockup image URL")
    mockup_image_alt: str | None = Field(None, serialization_alias="mockupImageAlt", description="Mockup alt text")


class FeaturesTabsMockup01Props(FeaturesSectionProps):
    """
    Features with tabbed interface and mockup.
    """

    tabs: list[dict] | None = Field(None, description="Tab configuration")
    default_tab: int | None = Field(0, serialization_alias="defaultTab", description="Default active tab index")


class FeaturesAlternatingLayout01Props(FeaturesSectionProps):
    """
    Features in alternating left/right layout.
    """

    image_position: str | None = Field(
        "left",
        serialization_alias="imagePosition",
        description="Image position (left/right)",
    )


class FeaturesCenterMockup01Props(FeaturesSectionProps):
    """
    Features with centered mockup.
    """

    mockup_image_url: str | None = Field(None, serialization_alias="mockupImageUrl", description="Centered mockup URL")


class FeaturesIconsAndImage01Props(FeaturesSectionProps):
    """
    Features with icons and decorative image.
    """

    image_url: str | None = Field(None, serialization_alias="imageUrl", description="Image URL")
    image_alt: str | None = Field(None, serialization_alias="imageAlt", description="Image alt text")


class FeaturesIntegrationsIcons01Props(FeaturesSectionProps):
    """
    Features showing integration icons.
    """

    integrations: list[dict] | None = Field(None, description="Integration icon configurations")


class FeaturesIconCards02Props(FeaturesSectionProps):
    """
    Features displayed as icon cards.
    """

    columns: int | None = Field(3, description="Number of columns")
    card_style: str | None = Field(None, serialization_alias="cardStyle", description="Card style variant")


__all__ = [
    "FeatureItem",
    "FeaturesSectionProps",
    "FeaturesSimpleIcons04Props",
    "FeaturesIconsAndMockup01Props",
    "FeaturesTabsMockup01Props",
    "FeaturesAlternatingLayout01Props",
    "FeaturesCenterMockup01Props",
    "FeaturesIconsAndImage01Props",
    "FeaturesIntegrationsIcons01Props",
    "FeaturesIconCards02Props",
]
