<x-ui.layout.career-portal :title="__('recruitment.career_portal.track_title')" :settings="$settings" :tenant="$tenant">
    <div class="container py-5">
        <h1 class="h4 mb-4">{{ __('recruitment.career_portal.track_title') }}</h1>

        <div class="cp-card mb-4">
            <h2 class="h6">{{ __('recruitment.career_portal.sections.application') }}</h2>
            <p class="mb-1"><strong>{{ $application->reference_code }}</strong> — {{ $application->vacancy?->title }}</p>
            <p class="cp-muted mb-0">{{ __('recruitment.applications.status.'.$application->status) }}</p>
            <p class="small cp-muted mb-0">{{ $application->candidate?->full_name }} · {{ $application->candidate?->email }}</p>
        </div>

        <div class="cp-card mb-4">
            <h2 class="h6">{{ __('recruitment.career_portal.sections.cv') }}</h2>
            @forelse ($application->candidate?->cvs ?? [] as $cv)
                <div class="small mb-1">{{ $cv->original_name }} <span class="cp-muted">({{ $cv->reference_code }})</span></div>
            @empty
                <p class="cp-muted mb-0">{{ __('recruitment.career_portal.empty_cv') }}</p>
            @endforelse
            <p class="small cp-muted mt-2 mb-0">{{ __('recruitment.career_portal.cv_note') }}</p>
        </div>

        <div class="cp-card mb-4">
            <h2 class="h6">{{ __('recruitment.career_portal.sections.interviews') }}</h2>
            @forelse ($application->interviews as $interview)
                <div class="border-bottom py-2">
                    <strong>{{ $interview->reference_code }}</strong>
                    <span class="cp-muted small"> — {{ __('recruitment.interviews.status.'.$interview->status) }}</span>
                    <div class="small">{{ $interview->scheduled_at?->format('Y-m-d H:i') }} · {{ __('recruitment.interviews.mode.'.$interview->mode) }}</div>
                </div>
            @empty
                <p class="cp-muted mb-0">{{ __('recruitment.career_portal.empty_interviews') }}</p>
            @endforelse
        </div>

        <div class="cp-card">
            <h2 class="h6">{{ __('recruitment.career_portal.sections.offers') }}</h2>
            @forelse ($offers as $offer)
                <div class="border-bottom py-2">
                    <strong>{{ $offer->reference_code }}</strong>
                    <span class="cp-muted small"> — {{ __('recruitment.offer_letters.status.'.$offer->status) }}</span>
                    <div class="small">{{ number_format((float) $offer->salary, 2) }} {{ $offer->currency }}</div>
                </div>
            @empty
                <p class="cp-muted mb-0">{{ __('recruitment.career_portal.empty_offers') }}</p>
            @endforelse
        </div>
    </div>
</x-ui.layout.career-portal>
