<?php
/**
 * SalonPro X - Glassmorphism Card Component
 * Usage: <?php component('card', ['title' => 'Card Title', 'body' => '...', 'class' => '...']); ?>
 * @var string $title Card title (optional)
 * @var string $body Card body content (optional)
 * @var string $class Additional CSS classes (optional)
 * @var bool $header Show header (default: true)
 * @var string $icon Icon class (optional)
 * @var mixed $content Alternative content (optional)
 */
$title = $title ?? '';
$body = $body ?? '';
$class = $class ?? '';
$header = $header ?? true;
$icon = $icon ?? '';
$content = $content ?? null;
?>
<div class="card glass-card <?= e($class) ?>">
    <?php if ($header && ($title || $icon)): ?>
        <div class="card-header">
            <div class="card-header-left">
                <?php if ($icon): ?>
                    <i class="fas <?= e($icon) ?> card-icon"></i>
                <?php endif; ?>
                <h5 class="card-title"><?= e($title) ?></h5>
            </div>
            <?php if (isset($actions)): ?>
                <div class="card-header-actions"><?= $actions ?></div>
            <?php endif; ?>
        </div>
    <?php endif; ?>
    <div class="card-body">
        <?php if ($content): ?>
            <?= $content ?>
        <?php else: ?>
            <?= $body ?>
        <?php endif; ?>
    </div>
    <?php if (isset($footer)): ?>
        <div class="card-footer"><?= $footer ?></div>
    <?php endif; ?>
</div>
