"""Application configuration"""
from pydantic_settings import BaseSettings
from typing import Optional


class Settings(BaseSettings):
    """Application settings"""
    
    # Database
    database_url: str = "postgresql://sports_user:sports_pass@db:5432/sports_db"
    
    # API
    api_host: str = "0.0.0.0"
    api_port: int = 8000
    api_key: str = "dev-api-key-change-in-production"
    
    # Data Source
    flashscore_base_url: str = "https://www.flashscore.com"
    flashscore_rate_limit_seconds: float = 2.0
    flashscore_user_agent: str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
    flashscore_enabled: bool = True
    
    # Agents
    ingest_interval_minutes: int = 60
    features_interval_hours: int = 6
    predict_interval_minutes: int = 30
    training_enabled: bool = True
    training_schedule_hours: int = 24
    
    # ML
    model_type: str = "gradient_boosting"
    min_matches_for_training: int = 10
    train_test_split: float = 0.8
    rolling_window_matches: int = 10
    
    # Logging
    log_level: str = "INFO"
    
    # OpenAI
    openai_api_key: Optional[str] = None
    openai_model: str = "gpt-4o-mini"
    openai_temperature: float = 0.7
    openai_max_tokens: int = 2000

    # LLM Analysis Agent
    llm_analysis_enabled: bool = True
    llm_horizon_hours: int = 72
    llm_max_matches: int = 50
    
    class Config:
        env_file = ".env"
        case_sensitive = False


settings = Settings()
