import os

# Default configuration
class Config:
    # Secret key for sessions
    SECRET_KEY = os.environ.get("SESSION_SECRET", "gmpl_secret_key_change_in_production")
    
    # Database configuration - using PostgreSQL if available, fallback to SQLite
    SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL", "sqlite:///gmpl.db")
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_ENGINE_OPTIONS = {
        "pool_recycle": 300,
        "pool_pre_ping": True,
    }
    
    # Upload folder for product images
    UPLOAD_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static', 'uploads')
    
    # Company information
    COMPANY_NAME = "GMPL - General Motors Poids Lourds"
    COMPANY_ADDRESS = "Km 12, route de Rufisque, Dakar, Sénégal"
    COMPANY_EMAIL = "gmplsn6@gmail.com"
    COMPANY_PHONE = "+221 77 125 29 29 / 77 049 62 17 / 76 011 53 53 / 77 522 36 36"
    
    # Google Maps API key
    GOOGLE_MAPS_API_KEY = os.environ.get("GOOGLE_MAPS_API_KEY", "")
