<?php $__env->startSection('title', 'پیشرفت من'); ?>

<?php $__env->startSection('content'); ?>
    <div class="flex items-center justify-between mb-6">
        <h1 class="text-xl font-bold">پیشرفت من</h1>
        <a href="<?php echo e(route('athlete.assessments.create')); ?>" class="bg-gray-900 text-white text-sm px-4 py-2 rounded-lg">+ ثبت ارزیابی جدید</a>
    </div>

    <?php if($assessments->count() < 2): ?>
        <div class="bg-amber-50 text-amber-700 text-sm rounded-lg px-4 py-3 mb-6">
            برای دیدن نمودار روند، حداقل به دو ارزیابی نیاز دارید. هر ۴ هفته یک‌بار ارزیابی جدید ثبت کنید.
        </div>
    <?php endif; ?>

    
    <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
        <div class="bg-white rounded-xl shadow-sm p-4">
            <h2 class="font-semibold text-sm mb-2">روند وزن (kg)</h2>
            <?php if (isset($component)) { $__componentOriginal1d640cb4ac758fdb081df5b51e265af0 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1d640cb4ac758fdb081df5b51e265af0 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.line-chart','data' => ['points' => $weightSeries,'color' => '#2563eb']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('line-chart'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['points' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($weightSeries),'color' => '#2563eb']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1d640cb4ac758fdb081df5b51e265af0)): ?>
<?php $attributes = $__attributesOriginal1d640cb4ac758fdb081df5b51e265af0; ?>
<?php unset($__attributesOriginal1d640cb4ac758fdb081df5b51e265af0); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1d640cb4ac758fdb081df5b51e265af0)): ?>
<?php $component = $__componentOriginal1d640cb4ac758fdb081df5b51e265af0; ?>
<?php unset($__componentOriginal1d640cb4ac758fdb081df5b51e265af0); ?>
<?php endif; ?>
        </div>
        <div class="bg-white rounded-xl shadow-sm p-4">
            <h2 class="font-semibold text-sm mb-2">روند BMI</h2>
            <?php if (isset($component)) { $__componentOriginal1d640cb4ac758fdb081df5b51e265af0 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1d640cb4ac758fdb081df5b51e265af0 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.line-chart','data' => ['points' => $bmiSeries,'color' => '#16a34a']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('line-chart'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['points' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($bmiSeries),'color' => '#16a34a']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1d640cb4ac758fdb081df5b51e265af0)): ?>
<?php $attributes = $__attributesOriginal1d640cb4ac758fdb081df5b51e265af0; ?>
<?php unset($__attributesOriginal1d640cb4ac758fdb081df5b51e265af0); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1d640cb4ac758fdb081df5b51e265af0)): ?>
<?php $component = $__componentOriginal1d640cb4ac758fdb081df5b51e265af0; ?>
<?php unset($__componentOriginal1d640cb4ac758fdb081df5b51e265af0); ?>
<?php endif; ?>
        </div>
        <div class="bg-white rounded-xl shadow-sm p-4">
            <h2 class="font-semibold text-sm mb-2">روند درصد چربی</h2>
            <?php if (isset($component)) { $__componentOriginal1d640cb4ac758fdb081df5b51e265af0 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1d640cb4ac758fdb081df5b51e265af0 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.line-chart','data' => ['points' => $bodyFatSeries,'color' => '#dc2626','unit' => '%']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('line-chart'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['points' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($bodyFatSeries),'color' => '#dc2626','unit' => '%']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1d640cb4ac758fdb081df5b51e265af0)): ?>
<?php $attributes = $__attributesOriginal1d640cb4ac758fdb081df5b51e265af0; ?>
<?php unset($__attributesOriginal1d640cb4ac758fdb081df5b51e265af0); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1d640cb4ac758fdb081df5b51e265af0)): ?>
<?php $component = $__componentOriginal1d640cb4ac758fdb081df5b51e265af0; ?>
<?php unset($__componentOriginal1d640cb4ac758fdb081df5b51e265af0); ?>
<?php endif; ?>
        </div>
    </div>

    
    <?php if(count($photoPairs)): ?>
        <div class="bg-white rounded-xl shadow-sm p-4 mb-8">
            <h2 class="font-semibold mb-4">مقایسه‌ی تصویری (قبل / بعد)</h2>
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <?php $__currentLoopData = $photoPairs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $angle => $pair): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div>
                        <div class="text-xs text-gray-500 mb-2"><?php echo e($pair['label']); ?></div>
                        <div class="grid grid-cols-2 gap-2">
                            <a href="<?php echo e(route('photos.show', $pair['before'])); ?>" target="_blank" class="block border rounded-lg overflow-hidden text-center">
                                <div class="bg-gray-100 h-32 flex items-center justify-center">📷</div>
                                <div class="text-xs py-1 text-gray-500">قبل — <?php echo e(verta($pair['before']->created_at)->format('Y/m/d')); ?></div>
                            </a>
                            <a href="<?php echo e(route('photos.show', $pair['after'])); ?>" target="_blank" class="block border rounded-lg overflow-hidden text-center">
                                <div class="bg-gray-100 h-32 flex items-center justify-center">📷</div>
                                <div class="text-xs py-1 text-gray-500">بعد — <?php echo e(verta($pair['after']->created_at)->format('Y/m/d')); ?></div>
                            </a>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    <?php endif; ?>

    
    <h2 class="font-semibold mb-3">تاریخچه ارزیابی‌ها</h2>
    <div class="space-y-3">
        <?php $__currentLoopData = $assessments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $assessment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <a href="<?php echo e(route('athlete.assessments.show', $assessment)); ?>" class="block bg-white rounded-xl shadow-sm p-4 hover:shadow-md transition">
                <div class="flex items-center justify-between">
                    <div>
                        <div class="font-medium">
                            <?php echo e($assessment->is_initial ? 'ارزیابی اولیه' : 'ارزیابی'); ?>

                            — <?php echo e(verta($assessment->assessment_date)->format('Y/m/d')); ?>

                        </div>
                        <div class="text-xs text-gray-400">
                            وزن: <?php echo e($assessment->weight_kg); ?> · BMI: <?php echo e($assessment->bmi); ?>

                            <?php if($assessment->body_fat_percentage): ?> · چربی: <?php echo e($assessment->body_fat_percentage); ?>% <?php endif; ?>
                        </div>
                    </div>
                    <span class="text-blue-600 text-sm">مشاهده →</span>
                </div>
            </a>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('athlete.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\paradox\Desktop\fresh\abtin-sport-platform\resources\views/athlete/progress/index.blade.php ENDPATH**/ ?>