// Auto-open chat if conv parameter is present
document.addEventListener('DOMContentLoaded', function() {
    const urlParams = new URLSearchParams(window.location.search);
    const convId = urlParams.get('conv');
    
    if (convId && window.location.search.includes('view=direct')) {
        // Wait a bit for page to load
        setTimeout(() => {
            if (typeof loadChat === 'function') {
                loadChat(convId);
            }
        }, 500);
    }
});
