<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>ملخص تقييمات المدرب — <?= e($coach['full_name_ar'] ?? '') ?><?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>

<div class="card" style="padding:15px;margin-bottom:20px;display:flex;justify-content:space-between;align-items:center;">
    <div>
        <strong style="font-size:18px;"><?= e($coach['full_name_ar'] ?? 'مدرب') ?></strong>
    </div>
    <form method="get" style="display:flex;gap:10px;align-items:center;">
        <label style="font-size:13px;">من:</label>
        <input type="date" name="from" value="<?= e($dateFrom) ?>" class="form-control" style="width:auto;">
        <label style="font-size:13px;">إلى:</label>
        <input type="date" name="to" value="<?= e($dateTo) ?>" class="form-control" style="width:auto;">
        <button type="submit" class="btn btn-sm btn-primary">تصفية</button>
    </form>
</div>

<?php if (!empty($summary) && (int) ($summary['total_responses'] ?? 0) > 0): ?>
<div style="display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:20px;">
    <div class="card" style="padding:20px;text-align:center;">
        <div style="font-size:28px;font-weight:700;color:#F59E0B;"><?= $summary['avg_rating'] ?? '0' ?></div>
        <div style="font-size:12px;color:#6B7280;">متوسط التقييم</div>
    </div>
    <div class="card" style="padding:20px;text-align:center;">
        <div style="font-size:28px;font-weight:700;color:#059669;"><?= $summary['avg_enjoyment'] ?? '0' ?></div>
        <div style="font-size:12px;color:#6B7280;">متوسط الاستمتاع</div>
    </div>
    <div class="card" style="padding:20px;text-align:center;">
        <div style="font-size:28px;font-weight:700;color:#7C3AED;"><?= $summary['avg_difficulty'] ?? '0' ?></div>
        <div style="font-size:12px;color:#6B7280;">متوسط الصعوبة</div>
    </div>
    <div class="card" style="padding:20px;text-align:center;">
        <div style="font-size:28px;font-weight:700;color:#0284C7;"><?= $summary['total_responses'] ?? '0' ?></div>
        <div style="font-size:12px;color:#6B7280;">عدد التقييمات</div>
    </div>
</div>
<?php else: ?>
<div class="card" style="padding:40px;text-align:center;color:#6B7280;">
    لا توجد تقييمات في هذه الفترة
</div>
<?php endif; ?>

<?php $__template->endSection(); ?>
