@extends('layout.admin')

@section('content')
<div class="px-4 sm:px-6 lg:px-8 mt-6">
    <h2 class="text-xl font-bold text-gray-800 mb-6 flex items-center gap-2">
        <i class="fas fa-briefcase text-blue-600"></i> সকল জব লিস্ট
    </h2>

    @if($jobs->count())
        <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5">
            @foreach($jobs as $job)
                <div class="bg-white border border-gray-200 rounded-lg shadow-sm p-4 flex flex-col justify-between">
                    <div class="mb-4">
                        <h3 class="text-lg font-semibold text-gray-800 flex items-center gap-2">
                            <i class="fas fa-clipboard-list text-indigo-500"></i> {{ $job->title }}
                        </h3>
                    </div>

                    <div>
                        @if(!$job->paused_at)
                            <form action="{{ route('admin.jobs.pause', $job->id) }}" method="POST">
                                @csrf
                                <button type="submit" class="w-full inline-flex items-center justify-center bg-yellow-500 hover:bg-yellow-600 text-white text-sm font-medium px-4 py-2 rounded transition">
                                    ⏸️ Pause
                                </button>
                            </form>
                        @else
                            <form action="{{ route('admin.jobs.resume', $job->id) }}" method="POST">
                                @csrf
                                <button type="submit" class="w-full inline-flex items-center justify-center bg-green-600 hover:bg-green-700 text-white text-sm font-medium px-4 py-2 rounded transition">
                                    ▶️ Resume
                                </button>
                            </form>
                        @endif
                    </div>
                </div>
            @endforeach
        </div>
    @else
        <div class="bg-yellow-50 border-l-4 border-yellow-400 text-yellow-800 p-4 rounded-lg text-sm">
            কোনো জব পাওয়া যায়নি।
        </div>
    @endif
</div>
@endsection