from pydantic_settings import BaseSettings
from typing import List
import os

class Settings(BaseSettings):
    # Application settings
    APP_NAME: str = "Web Scraper API"
    VERSION: str = "1.0.0"
    DEBUG: bool = True
    ENVIRONMENT: str = "development"
    
    # Server settings
    HOST: str = "0.0.0.0"
    PORT: int = 8006
    LOG_LEVEL: str = "INFO"
    
    # Database settings
    MONGODB_URL: str = "mongodb://admin:password123@mongodb:27017/web_scraper?authSource=admin"
    DATABASE_NAME: str = "web_scraper"
    
    # Security settings
    # Make sure these are set correctly
    ALLOWED_ORIGINS: list = ["*"]  # Allow all for now
    ALLOWED_HOSTS: list = ["*"]    # Allow all for now
    
    # Scraping settings
    MAX_CONCURRENT_REQUESTS: int = 5
    REQUEST_TIMEOUT: int = 30
    USER_AGENT: str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
    
    class Config:
        env_file = ".env"
        case_sensitive = True

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