"""FORGE AI Configuration"""
from pydantic_settings import BaseSettings
from functools import lru_cache
import os


class Settings(BaseSettings):
    # App
    app_name: str = "FORGE AI"
    app_version: str = "1.0.0"
    debug: bool = False

    # Database
    database_url: str = "postgresql://forge_user:forge_secure_password_2024@localhost:5452/forge_ai"

    # Redis
    redis_url: str = "redis://localhost:6399"

    # Storage
    storage_path: str = "/app/storage"

    # API Keys (loaded from environment)
    openai_api_key: str = ""
    anthropic_api_key: str = ""
    google_api_key: str = ""
    elevenlabs_api_key: str = ""
    topaz_api_key: str = ""
    runway_api_key: str = ""
    deepl_api_key: str = ""
    clipping_magic_api_key: str = ""
    clipping_magic_api_id: str = ""
    clipping_magic_api_secret: str = ""
    stability_api_key: str = ""
    leonardo_api_key: str = ""
    ideogram_api_key: str = ""
    bria_api_key: str = ""
    flux_api_key: str = ""

    # Google Cloud
    gcs_bucket_name: str = ""
    gcs_project_id: str = ""

    # Azure AD
    azure_client_id: str = ""
    azure_tenant_id: str = ""
    azure_authority: str = ""

    # JWT
    jwt_secret_key: str = "forge-ai-secret-key-change-in-production"
    jwt_algorithm: str = "HS256"
    jwt_expire_minutes: int = 60 * 24 * 7  # 7 days

    class Config:
        env_file = ".env"
        extra = "ignore"


@lru_cache()
def get_settings() -> Settings:
    return Settings()


settings = get_settings()
