{% extends "base.html" %}

{% block title %}{{ job.title }} - University ATS{% endblock %}

{% block content %}
<div class="row mb-5">
    <div class="col-lg-8">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h2>{{ job.title }}</h2>
                <span class="badge bg-{{ job.status|lower }} status-badge">
                    {{ job.get_status_display }}
                </span>
            </div>
            <div class="card-body">
                <!-- Job Details -->
                <div class="row mb-3">
                    <div class="col-md-6">
                        <strong>Department:</strong> {{ job.department|default:"Not specified" }}
                    </div>
                    <div class="col-md-6">
                        <strong>Position Number:</strong> {{ job.position_number|default:"Not specified" }}
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <strong>Job Type:</strong> {{ job.get_job_type_display }}
                    </div>
                    <div class="col-md-6">
                        <strong>Workplace:</strong> {{ job.get_workplace_type_display }}
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <strong>Location:</strong> {{ job.get_location_display }}
                    </div>
                    <div class="col-md-6">
                        <strong>Created By:</strong> {{ job.created_by|default:"Not specified" }}
                    </div>
                </div>
                
                {% if job.salary_range %}
                <div class="row mb-3">
                    <div class="col-12">
                        <strong>Salary Range:</strong> {{ job.salary_range }}
                    </div>
                </div>
                {% endif %}
                
                {% if job.start_date %}
                <div class="row mb-3">
                    <div class="col-12">
                        <strong>Start Date:</strong> {{ job.start_date }}
                    </div>
                </div>
                {% endif %}
                
                {% if job.application_deadline %}
                <div class="row mb-3">
                    <div class="col-12">
                        <strong>Application Deadline:</strong> {{ job.application_deadline }}
                        {% if job.is_expired %}
                            <span class="badge bg-danger">EXPIRED</span>
                        {% endif %}
                    </div>
                </div>
                {% endif %}
                
                <!-- Description -->
                {% if job.description %}
                <div class="mb-3">
                    <h5>Description</h5>
                    <div>{{ job.description|linebreaks }}</div>
                </div>
                {% endif %}
                
                {% if job.qualifications %}
                <div class="mb-3">
                    <h5>Qualifications</h5>
                    <div>{{ job.qualifications|linebreaks }}</div>
                </div>
                {% endif %}
                
                {% if job.benefits %}
                <div class="mb-3">
                    <h5>Benefits</h5>
                    <div>{{ job.benefits|linebreaks }}</div>
                </div>
                {% endif %}
                
                {% if job.application_instructions %}
                <div class="mb-3">
                    <h5>Application Instructions</h5>
                    <div>{{ job.application_instructions|linebreaks }}</div>
                </div>
                {% endif %}
                
               
            </div>
        </div>
    </div>
    
    <div class="col-lg-4">
       
        <!-- Add this section below your existing job details -->
        <div class="card mt-4">
            <div class="card-header bg-success text-white">
                <h5><i class="fas fa-file-signature"></i> Ready to Apply?</h5>
            </div>
            <div class="card-body">
                <p>Review the job details on the left, then click the button below to submit your application.</p>
                <a href="{% url 'applicant:apply_form' job.internal_job_id %}" class="btn btn-success btn-lg w-100">
                    <i class="fas fa-paper-plane"></i> Apply for this Position
                </a>
                <p class="text-muted mt-2">
                    <small>You'll be redirected to our secure application form where you can upload your resume and provide additional details.</small>
                </p>
            </div>
        </div>
                
     
        
    </div>
</div>


{% endblock %}