ectedSites).join(',');
        }

        function addSite(site) {
            if (site && !selectedSites.has(site)) {
                selectedSites.add(site);
                updateHiddenInput();
                const siteElement = document.createElement('span');
                siteElement.className = 'selected-site';
                siteElement.innerHTML = `${site}<span class="remove-site" data-site="${site}">&times;</span>`;
                selectedSitesContainer.appendChild(siteElement);
            }
