<?php
/**
 * A reusable template for all admin page modals.
 *
 * This template requires the following variables to be passed to it:
 * @var string $modal_id        The CSS ID for the modal container.
 * @var string $modal_title     The text to display in the modal header.
 * @var string $modal_content   The HTML content to display in the modal body.
 * @var string $modal_footer    Optional. The HTML for the modal footer buttons.
 */
if ( ! defined( 'ABSPATH' ) ) exit;
?>
<div class="em-bg-white em-rounded-lg em-shadow-xl em-max-w-md em-w-full em-mx-4" role="document">
    <div class="em-flex em-items-center em-justify-between em-p-4 em-border-b em-border-gray-200">
        <h4 class="em-text-lg em-font-semibold em-text-gray-900"><?php echo esc_html( $modal_title ); ?></h4>
        <button type="button" class="close em-text-gray-400 hover:em-text-gray-600 em-text-2xl em-leading-none" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    
    <div class="em-p-4">
        <?php echo $modal_content; // The content is generated by our PHP Ajax methods ?>
    </div>
    
    <?php if ( ! empty( $modal_footer ) ) : ?>
        <div class="em-flex em-justify-end em-gap-2 em-p-4 em-border-t em-border-gray-200">
            <?php echo $modal_footer; ?>
        </div>
    <?php endif; ?>
</div>
