.elementor-3942 .elementor-element.elementor-element-dfee7cf{--display:flex;--margin-top:50px;--margin-bottom:0px;--margin-left:0px;--margin-right:0px;}.elementor-3942 .elementor-element.elementor-element-f91a80e{--display:flex;}/* Start custom CSS for html, class: .elementor-element-b3c3028 */<script>
document.addEventListener('DOMContentLoaded', function() {
    const buttons = document.querySelectorAll('.event-delete-button');
    buttons.forEach(btn => {
        btn.addEventListener('click', function() {
            if (!confirm("Möchtest du dieses Event wirklich löschen?")) return;

            const eventId = this.dataset.eventId;

            fetch('<?php echo admin_url('admin-ajax.php'); ?>', {
                method: 'POST',
                headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
                body: 'action=delete_event&event_id=' + eventId
            })
            .then(res => res.json())
            .then(data => {
                if (data.success) {
                    document.getElementById('event-row-' + eventId).remove();
                } else {
                    alert('Fehler: ' + data.data);
                }
            });
        });
    });
});
</script>/* End custom CSS */