<div class="modal-header flex items-center justify-between border-b border-border px-4 py-3">
    <h4 class="text-sm font-semibold text-foreground"><?= lang('jobs_application_details') ?></h4>
</div>
<div class="modal-body p-4">
    <?php
    if (!empty($job_application_info->designations_id)) {
        $design_info = $this->db->where('designations_id', $job_application_info->designations_id)->get('tbl_designations')->row();
        $designation = !empty($design_info) ? $design_info->designations : '-';
    } else {
        $designation = '-';
    }
    ?>
    <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
        <div>
            <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('job_title') ?></p>
            <p class="mt-1 font-medium text-foreground"><?php echo $job_application_info->job_title; ?></p>
        </div>
        <div>
            <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('designation') ?></p>
            <p class="mt-1 font-medium text-foreground"><?php echo $designation; ?></p>
        </div>
        <div>
            <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('name') ?></p>
            <p class="mt-1 font-medium text-foreground"><?php echo $job_application_info->name ?></p>
        </div>
        <div>
            <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('email') ?></p>
            <p class="mt-1 font-medium text-foreground"><?php echo $job_application_info->email ?></p>
        </div>
        <div>
            <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('mobile') ?></p>
            <p class="mt-1 font-medium text-foreground"><?php echo $job_application_info->mobile ?></p>
        </div>
        <div>
            <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('apply_date') ?></p>
            <p class="mt-1 font-medium text-foreground"><?= !empty($job_application_info->apply_date) ? display_date($job_application_info->apply_date) : '-' ?></p>
        </div>
        <?php if (!empty($job_application_info->send_email)) { ?>
            <div>
                <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('send_email') ?></p>
                <p class="mt-1 font-medium text-foreground"><?= lang(strtolower($job_application_info->send_email)) ?></p>
            </div>
        <?php } ?>
        <?php if (!empty($job_application_info->interview_date)) { ?>
            <div>
                <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('interview_date') ?></p>
                <p class="mt-1 font-medium text-foreground"><?= display_date($job_application_info->interview_date) ?></p>
            </div>
        <?php } ?>
    </div>

    <div class="mt-4">
        <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('cover_later') ?></p>
        <div class="mt-2 rounded-lg border border-border bg-muted/40 p-3 text-sm text-foreground">
            <?php if (!empty($job_application_info->cover_letter)) {
                echo nl2br($job_application_info->cover_letter);
            } ?>
        </div>
    </div>

    <div class="mt-4 flex items-center justify-between rounded-lg border border-border bg-muted/40 p-3">
        <div>
            <p class="text-xs font-semibold uppercase tracking-wide text-muted-foreground"><?= lang('resume') ?></p>
            <p class="text-sm font-medium text-foreground"><?= lang('download') . ' ' . lang('resume') ?></p>
        </div>
        <a href="<?php echo base_url(); ?>admin/job_circular/download_resume/<?= $job_application_info->job_appliactions_id ?>"
           class="inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500">
            <i data-lucide="download" class="h-4 w-4"></i>
            <?= lang('download') ?>
        </a>
    </div>
</div>
<div class="modal-footer flex items-center justify-end border-t border-border px-4 py-3">
    <button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-semibold text-foreground hover:bg-muted" data-dismiss="modal">
        <i data-lucide="x" class="h-4 w-4"></i>
        <?= lang('close') ?>
    </button>
</div>
