@extends('admin.layouts.app')

@section('title', $plan->name)

@section('content')
    <a href="{{ route('admin.nutrition-plans.index') }}" class="text-sm text-blue-600 hover:underline mb-4 inline-block">← بازگشت</a>

    <h1 class="text-xl font-bold mb-1">{{ $plan->name }}</h1>
    <p class="text-sm text-gray-500 mb-6">
        ورزشکار: {{ $plan->athlete->user->fullName() }} · مربی: {{ $plan->coach->user->fullName() }} · {{ $plan->status->label() }}
    </p>

    <div class="space-y-6">
        @foreach($plan->days as $day)
            <div class="bg-white rounded-xl shadow-sm p-4">
                <h2 class="font-semibold mb-3">{{ $day->label }} — {{ $day->totalCalories() }} کالری</h2>
                @foreach($day->meals as $meal)
                    <div class="text-sm mb-2">
                        <span class="font-medium">{{ $meal->name }}</span>
                        <span class="text-gray-400"> — {{ $meal->items->pluck('food_name')->implode('، ') }}</span>
                    </div>
                @endforeach
            </div>
        @endforeach
    </div>
@endsection
