<?php
/**
 * SalonPro X - Alerts/Flash Messages Partial
 */
$alerts = $alerts ?? \core\Session::getAlerts();
?>
<?php if (!empty($alerts)): ?>
<div class="alert-container">
    <?php foreach ($alerts as $alert): ?>
        <div class="alert alert-<?= e($alert['type'] ?? 'info') ?> alert-dismissible fade show glass-alert animate-slide-down" role="alert">
            <?php
            $icons = [
                'success' => 'fa-check-circle',
                'danger' => 'fa-exclamation-circle',
                'warning' => 'fa-exclamation-triangle',
                'info' => 'fa-info-circle',
            ];
            $icon = $icons[$alert['type'] ?? 'info'] ?? 'fa-info-circle';
            ?>
            <i class="fas <?= $icon ?> me-2"></i>
            <?= e($alert['message'] ?? '') ?>
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
        </div>
    <?php endforeach; ?>
</div>
<?php endif; ?>
