"""Configuration settings for the World Cup 2026 Prediction Bot."""

from pathlib import Path
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    """Application settings loaded from environment variables."""

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

    # Bot token from BotFather
    BOT_TOKEN: str = ""

    # Admin Telegram IDs (comma-separated)
    ADMIN_IDS: str = ""

    # Mandatory channel username (without @)
    MANDATORY_CHANNEL: str = "GisouAcademy"

    # Database path
    DATABASE_PATH: str = "data/bot.db"

    # Scoring constants
    SCORE_PREDICTION_REGISTERED: int = 2
    SCORE_CORRECT_WINNER: int = 5
    SCORE_CORRECT_GOAL_DIFF: int = 3
    SCORE_EXACT_SCORE: int = 10
    SCORE_REFERRAL_SUCCESS: int = 2

    def get_admin_ids(self) -> list[int]:
        """Parse admin IDs from string to list of integers."""
        if not self.ADMIN_IDS:
            return []
        return [int(uid.strip()) for uid in self.ADMIN_IDS.split(",") if uid.strip()]


settings = Settings()