// Function to toggle the dropdown visibility
function toggleDropdown(event) {
    const dropdown = document.getElementById('dropdownMenu');
    dropdown.classList.toggle('show'); // Toggle 'show' class
}

// Close the dropdown if clicked outside
document.onclick = function(event) {
    if (!event.target.matches('.user-photo')) {
        const dropdowns = document.getElementsByClassName("dropdown-menu");
        for (let i = 0; i < dropdowns.length; i++) {
            const openDropdown = dropdowns[i];
            if (openDropdown.classList.contains('show')) {
                openDropdown.classList.remove('show');
            }
        }
    }
}