<x-ui.layout.career-portal :title="__('recruitment.career_portal.jobs_title')" :settings="$settings" :tenant="$tenant">
    <section class="cp-job-hero">
        <div class="container">
            <h1 class="h3 mb-2">{{ __('recruitment.career_portal.jobs_title') }}</h1>
            <p class="cp-muted mb-0">{{ __('recruitment.career_portal.search_lead') }}</p>
        </div>
    </section>

    <div class="container py-4 py-md-5">
        <form method="GET" class="cp-search mb-4">
            <div class="row g-2 align-items-center">
                <div class="col-md-6">
                    <input type="search" name="q" value="{{ request('q') }}" class="form-control" placeholder="{{ __('recruitment.career_portal.search_placeholder') }}">
                </div>
                <div class="col-md-3">
                    <label class="form-check mt-2 mb-0">
                        <input type="checkbox" name="featured" value="1" class="form-check-input" @checked(request()->boolean('featured'))>
                        <span class="form-check-label">{{ __('recruitment.career_portal.featured_only') }}</span>
                    </label>
                </div>
                <div class="col-md-3">
                    <button class="cp-btn w-100" type="submit">{{ __('recruitment.career_portal.actions.search_jobs') }}</button>
                </div>
            </div>
        </form>

        <div class="row g-3">
            @forelse ($jobs as $job)
                <div class="col-md-6 col-xl-4">
                    @include('pages.careers._job-card', ['job' => $job, 'tenant' => $tenant])
                </div>
            @empty
                <div class="col-12">
                    <div class="cp-card text-center py-5">
                        <p class="cp-muted mb-0">{{ __('recruitment.career_portal.empty_jobs') }}</p>
                    </div>
                </div>
            @endforelse
        </div>

        @if ($jobs->hasPages())
            <div class="mt-4 d-flex justify-content-center">{{ $jobs->links() }}</div>
        @endif
    </div>
</x-ui.layout.career-portal>
