"""
Configuration file for Flask application
"""
import os

class Config:
    """Base configuration"""
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'dev-secret-key-change-in-production'
    DEBUG = False
    TESTING = False
    
    # Application root for subdirectory deployments
    # Defaults to '/' (root) for local development
    # Set to '/product-finder' for production deployment
    APPLICATION_ROOT = os.environ.get('APPLICATION_ROOT', '/')

class DevelopmentConfig(Config):
    """Development configuration"""
    DEBUG = True
    ENV = 'development'
    # Development runs at root
    APPLICATION_ROOT = os.environ.get('APPLICATION_ROOT', '/')

class ProductionConfig(Config):
    """Production configuration"""
    DEBUG = False
    ENV = 'production'
    # Production deployed to /product-finder subdirectory
    APPLICATION_ROOT = os.environ.get('APPLICATION_ROOT', '/product-finder')
    # Add production-specific settings here
    # DATABASE_URI = os.environ.get('DATABASE_URL')

class TestingConfig(Config):
    """Testing configuration"""
    TESTING = True
    DEBUG = True

# Configuration dictionary
config = {
    'development': DevelopmentConfig,
    'production': ProductionConfig,
    'testing': TestingConfig,
    'default': DevelopmentConfig
}
