"""
Flask Extensions
================

Centralized Flask extension instances.
Extensions are initialized without app, then configured in create_app().

This pattern allows blueprints to import extensions without circular imports.
"""

from flask_wtf.csrf import CSRFProtect
from flask_login import LoginManager
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address

# CSRF Protection
csrf = CSRFProtect()

# Login Manager
login_manager = LoginManager()
login_manager.login_view = 'auth.login'
login_manager.login_message = 'Zaloguj się, aby uzyskać dostęp do tej strony.'

# Rate Limiter (storage configured in app.py)
limiter = Limiter(
    key_func=get_remote_address,
    default_limits=["1000 per day", "200 per hour"]
)
