"""
Metrics/stats section component schemas.

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

from pydantic import BaseModel, ConfigDict, Field


class MetricItem(BaseModel):
    """
    Individual metric/stat item.

    Matches TypeScript:
        interface MetricItem {
            value: string;
            label: string;
            description?: string;
            prefix?: string;
            suffix?: string;
        }
    """

    value: str = Field(..., description="Metric value (e.g., '99%', '10M+')")
    label: str = Field(..., description="Metric label")
    description: str | None = Field(None, description="Additional description")
    prefix: str | None = Field(None, description="Value prefix (e.g., '$')")
    suffix: str | None = Field(None, description="Value suffix (e.g., '+')")

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


class MetricsSectionProps(BaseModel):
    """
    Base metrics 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")
    metrics: list[MetricItem] | None = Field(None, description="List of metric items")

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


class MetricsSimpleAccentLineProps(MetricsSectionProps):
    """
    Metrics with simple accent line decoration.
    """

    accent_color: str | None = Field(None, serialization_alias="accentColor", description="Accent line color")


class MetricsImageWithCards01Props(MetricsSectionProps):
    """
    Metrics with image and card layout.
    """

    image_url: str | None = Field(None, serialization_alias="imageUrl", description="Background/accent image")
    image_alt: str | None = Field(None, serialization_alias="imageAlt", description="Image alt text")


__all__ = [
    "MetricItem",
    "MetricsSectionProps",
    "MetricsSimpleAccentLineProps",
    "MetricsImageWithCards01Props",
]
