"""Application configuration."""

from __future__ import annotations

from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    """Application settings."""

    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )

    # Database
    database_url: str = "sqlite+aiosqlite:///./data.db"

    # API
    secret_key: str = "change-me-in-production"
    debug: bool = False

    # CORS - include common dev server ports and Docker hostnames
    cors_origins: list[str] = [
        "http://localhost:5173",
        "http://localhost:5174",
        "http://localhost:5175",
        "http://localhost:3000",
        "http://{{ project_name }}.localhost",
        "http://{{ project_name }}.localhost:80",
    ]


settings = Settings()
