<?php $__env->startSection('title', $coach->user->fullName()); ?>

<?php $__env->startSection('content'); ?>
    <a href="<?php echo e(route('coaches.index')); ?>" class="inline-flex items-center gap-1.5 text-sm text-steel-500 hover:text-steel-600 mb-4">
        <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'arrow-right','class' => 'w-4 h-4 rotate-180']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?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(['name' => 'arrow-right','class' => 'w-4 h-4 rotate-180']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?> بازگشت به لیست مربیان
    </a>

    <div class="card-pad">
        <div class="flex items-center gap-4 mb-5">
            <?php if($coach->photo_path): ?>
                <img src="<?php echo e(Storage::disk('public')->url($coach->photo_path)); ?>" class="w-20 h-20 rounded-full object-cover">
            <?php else: ?>
                <div class="w-20 h-20 rounded-full bg-ink-950 text-white flex items-center justify-center text-xl font-semibold">
                    <?php echo e(mb_substr($coach->user->first_name, 0, 1)); ?>

                </div>
            <?php endif; ?>
            <div>
                <h1 class="text-lg font-bold text-ink-950"><?php echo e($coach->user->fullName()); ?></h1>
                <div class="text-sm mt-1">
                    <?php if($coach->user->isOnline()): ?>
                        <span class="inline-flex items-center gap-1.5 text-emerald-600"><span class="dot-online"></span> آنلاین</span>
                    <?php else: ?>
                        <span class="text-slate-400">آخرین بازدید: <?php echo e(verta($coach->user->last_seen_at)->format('Y/m/d H:i')); ?></span>
                    <?php endif; ?>
                </div>
            </div>
        </div>

        <div class="grid grid-cols-3 gap-3 mb-6">
            <div class="rounded-xl bg-slate-50 py-3 text-center">
                <div class="text-lg font-bold text-ink-950"><?php echo e($coach->experience_years ?? 0); ?></div>
                <div class="eyebrow mt-0.5">سال سابقه</div>
            </div>
            <div class="rounded-xl bg-slate-50 py-3 text-center">
                <div class="text-lg font-bold text-ink-950"><?php echo e($certificatesCount); ?></div>
                <div class="eyebrow mt-0.5">مدرک تأیید‌شده</div>
            </div>
            <div class="rounded-xl bg-slate-50 py-3 text-center">
                <?php if($coach->averageRating()): ?>
                    <div class="text-lg font-bold text-ember-500 flex items-center justify-center gap-1">
                        <?php echo e($coach->averageRating()); ?> <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'star','class' => 'w-3.5 h-3.5 fill-current']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?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(['name' => 'star','class' => 'w-3.5 h-3.5 fill-current']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
                    </div>
                    <div class="eyebrow mt-0.5"><?php echo e($coach->reviewsCount()); ?> نظر</div>
                <?php else: ?>
                    <div class="text-lg font-bold text-slate-300">—</div>
                    <div class="eyebrow mt-0.5">بدون امتیاز</div>
                <?php endif; ?>
            </div>
        </div>

        <div class="flex flex-wrap gap-1.5 mb-6">
            <?php $__currentLoopData = $coach->goals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $goal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <span class="badge-slate"><?php echo e($goal->title); ?></span>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <h2 class="font-semibold text-sm mb-2">درباره مربی</h2>
        <p class="text-sm text-slate-600 whitespace-pre-line mb-5"><?php echo e($coach->bio ?: 'توضیحی ثبت نشده است.'); ?></p>

        <h2 class="font-semibold text-sm mb-2">سابقه کاری</h2>
        <p class="text-sm text-slate-600 whitespace-pre-line mb-6"><?php echo e($coach->work_history ?: 'توضیحی ثبت نشده است.'); ?></p>

        <?php if($coach->program_price): ?>
            <div class="text-lg font-bold text-ink-950 mb-4">قیمت پایه: <?php echo e(number_format($coach->program_price)); ?> تومان</div>
        <?php endif; ?>

        <?php if(auth()->guard()->check()): ?>
            <?php if(auth()->user()->isAthlete()): ?>
                <?php $athlete = auth()->user()->athlete; ?>
                <?php if($athlete->hasActiveRelationshipWith($coach)): ?>
                    <div class="flex items-center gap-2 rounded-xl bg-emerald-50 text-emerald-700 text-sm px-4 py-3">
                        <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'check','class' => 'w-4 h-4 shrink-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?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(['name' => 'check','class' => 'w-4 h-4 shrink-0']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
                        شما با این مربی همکاری فعال دارید.
                        <a href="<?php echo e(route('athlete.coaches.index')); ?>" class="underline font-medium">مشاهده جزئیات</a>
                    </div>
                <?php else: ?>
                    <form method="POST" action="<?php echo e(route('athlete.coach-requests.store', $coach)); ?>">
                        <?php echo csrf_field(); ?>
                        <textarea name="message" rows="2" placeholder="پیام اختیاری برای مربی..." class="field-input mb-2"></textarea>
                        <button class="btn-primary">درخواست برنامه</button>
                    </form>
                    <?php $__errorArgs = ['request'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="field-error"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                <?php endif; ?>
            <?php endif; ?>
        <?php else: ?>
            <a href="<?php echo e(route('login')); ?>" class="btn-primary">برای درخواست برنامه وارد شوید</a>
        <?php endif; ?>
    </div>

    <?php if($coach->reviewsCount() > 0): ?>
        <div class="card-pad mt-5">
            <h2 class="font-semibold text-sm mb-4">نظرات ورزشکاران (<?php echo e($coach->reviewsCount()); ?>)</h2>
            <div class="space-y-4">
                <?php $__currentLoopData = $coach->approvedReviews()->with('coachRequest.athlete.user')->limit(10)->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $review): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="border-b border-slate-50 pb-4 last:border-0 last:pb-0">
                        <div class="flex items-center justify-between">
                            <span class="text-sm font-medium text-ink-900"><?php echo e($review->coachRequest->athlete->user->fullName()); ?></span>
                            <span class="flex items-center gap-0.5 text-ember-500">
                                <?php for($i = 1; $i <= 5; $i++): ?>
                                    <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'star','class' => 'w-3.5 h-3.5 '.e($i <= $review->rating ? 'fill-current' : 'text-slate-200').'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?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(['name' => 'star','class' => 'w-3.5 h-3.5 '.e($i <= $review->rating ? 'fill-current' : 'text-slate-200').'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
                                <?php endfor; ?>
                            </span>
                        </div>
                        <?php if($review->comment): ?>
                            <p class="text-sm text-slate-600 mt-1.5"><?php echo e($review->comment); ?></p>
                        <?php endif; ?>
                        <div class="text-xs text-slate-400 mt-1.5"><?php echo e(verta($review->created_at)->format('Y/m/d')); ?></div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

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