@extends('frontend.layouts.app')
@section('content')
    @php
        $breadCrump2 = 'Job Detail';
        use Carbon\Carbon; // Import Carbon once
    @endphp


    <!--Job listing start -->
   <!--Job alerts start -->
  <div class="wrapper-inner">
    <div class="container">
      <div class="profile-dash">
        @include('frontend.jobSeeker.sidebar')
        <div class="profile-dash-rt">
          <div class="my-profile-inner">
            <div class="headingBlock d-flex align-items-center justify-content-between">
              <h4>My Job Detail</h4>

            </div>
            <div class="row">
              <div class="col-md-4">
                <div class="form-group">
                  <label>Job Title</label>
                  <div class="form-group-input">
                    <strong>{{$job->title}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Employment Type</label>
                  <div class="form-group-input">
                    <strong>{{$job->employmentType?->title}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Location</label>
                  <div class="form-group-input">
                    <strong>{{
                        ($job->address ?? '') . ',' .
                        ($job->city?->name ?? '') . ',' .
                        ($job->state?->name ?? '') . ',' .
                        ($job->country?->name ?? '')
                    }}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Salary Range</label>
                  <div class="form-group-input">
                    <strong>{{$job->salary_range}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Job Category & Subcategory</label>
                  <div class="form-group-input">
                    <strong>{{$job->category?->title}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Experience Level</label>
                  <div class="form-group-input">
                    <strong>{{$job->experience_level}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Number of Positions</label>
                  <div class="form-group-input">
                    <strong>{{$job->no_of_positions}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Education & Qualification</label>
                  <div class="form-group-input">
                    <strong>{{$job->qualification}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Skills Required</label>
                  <div class="form-group-input">
                    @php
                        $skills = implode(', ', $job->skills->pluck('title')->toArray());;
                    @endphp
                    <strong>{{$skills}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Application Created</label>
                  <div class="form-group-input">
                    <strong>{{Carbon::parse($job->created_at)->format(config('GET.front_date_format'))}}</strong>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="form-group">
                  <label>Application Deadline</label>
                  <strong class="d-block">{{Carbon::parse($job->deadline)->format(config('GET.front_date_format'))}}</strong>
                </div>
              </div>

            <div class="col-md-4">
              <div class="form-group">
                <label>Application Process</label>
                <div class="form-group-input">
                  <strong>{{($job->application_process=='direct')? "Direct Apply":($job->application_process=='external'? "External Link":"Email Applications")}}</strong>
                </div>
              </div>
            </div>
            @foreach ($job->jobScreeningQuestions as $que => $question)
            <div class="col-md-4">
                <div class="form-group">
                  <label>Screening Questions {{$que+1}}</label>
                  <div class="form-group-input">
                    <strong>{{$question->question}}</strong>
                  </div>
                </div>
              </div>

            @endforeach

            <div class="col-md-4">
              <div class="form-group">
                <label>Screening Questions 2</label>
                <div class="form-group-input">
                  <strong>Are you comfortable with hybrid jobs?</strong>
                </div>
              </div>
            </div>
            <div class="col-md-4">
              <div class="form-group">
                <label>Screening Questions 3</label>
                <div class="form-group-input">
                  <strong>Are you comfortable using your vehicle for office work?</strong>
                </div>
              </div>
            </div>
          </div>
          </div>
        </div>
      </div>
    </div>
  </div>
    <!-- Job listing start -->
    <!-- Job alerts start -->
@endsection
@push('front-script')
    <script></script>
@endpush
