<?php
/**
 * SalonPro X - Modal Component
 * Usage: <?php component('modal', ['id' => 'myModal', 'title' => 'Modal Title', 'body' => '...', 'size' => 'lg']); ?>
 * @var string $id Modal ID
 * @var string $title Modal title
 * @var string $body Modal body content
 * @var string $size lg, sm, xl (optional)
 * @var string $footer Modal footer content (optional)
 * @var bool $static Backdrop static (optional)
 */
$id = $id ?? 'modal';
$title = $title ?? '';
$body = $body ?? '';
$size = $size ?? '';
$footer = $footer ?? '';
$static = $static ?? false;
$sizeClass = $size ? 'modal-' . $size : '';
?>
<div class="modal fade" id="<?= e($id) ?>" tabindex="-1" data-bs-backdrop="<?= $static ? 'static' : 'true' ?>">
    <div class="modal-dialog <?= e($sizeClass) ?>">
        <div class="modal-content glass-card">
            <div class="modal-header">
                <h5 class="modal-title"><?= e($title) ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <?= $body ?>
            </div>
            <?php if ($footer): ?>
                <div class="modal-footer"><?= $footer ?></div>
            <?php endif; ?>
        </div>
    </div>
</div>
