{% extends "base.html" %}

{% block title %}Apply for {{ job.title }} - University Careers{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-lg-8">
        <div class="card">
            <div class="card-header">
                <h2><i class="fas fa-file-signature"></i> Apply for {{ job.title }}</h2>
                <p class="text-muted">{{ job.department }} • {{ job.get_location_display }}</p>
            </div>
            <div class="card-body">
                <form method="post" enctype="multipart/form-data">
                    {% csrf_token %}
                    
                    <h4>Personal Information</h4>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label">First Name *</label>
                                {{ form.first_name }}
                                {% if form.first_name.errors %}<div class="text-danger">{{ form.first_name.errors }}</div>{% endif %}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label">Last Name *</label>
                                {{ form.last_name }}
                                {% if form.last_name.errors %}<div class="text-danger">{{ form.last_name.errors }}</div>{% endif %}
                            </div>
                        </div>
                    </div>
                    
                    <div class="row">
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label">Email *</label>
                                {{ form.email }}
                                {% if form.email.errors %}<div class="text-danger">{{ form.email.errors }}</div>{% endif %}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label">Phone</label>
                                {{ form.phone }}
                                {% if form.phone.errors %}<div class="text-danger">{{ form.phone.errors }}</div>{% endif %}
                            </div>
                        </div>
                    </div>
                    
                    <h4 class="mt-4">Documents</h4>
                    <div class="mb-3">
                        <label class="form-label">Resume/CV * (PDF or Word)</label>
                        {{ form.resume }}
                        {% if form.resume.errors %}<div class="text-danger">{{ form.resume.errors }}</div>{% endif %}
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label">Cover Letter (Optional)</label>
                        {{ form.cover_letter }}
                        {% if form.cover_letter.errors %}<div class="text-danger">{{ form.cover_letter.errors }}</div>{% endif %}
                    </div>
                    
                    <h4 class="mt-4">Additional Information</h4>
                    <div class="mb-3">
                        <label class="form-label">LinkedIn Profile</label>
                        {{ form.linkedin_profile }}
                        {% if form.linkedin_profile.errors %}<div class="text-danger">{{ form.linkedin_profile.errors }}</div>{% endif %}
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label">Portfolio/Website</label>
                        {{ form.portfolio_url }}
                        {% if form.portfolio_url.errors %}<div class="text-danger">{{ form.portfolio_url.errors }}</div>{% endif %}
                    </div>
                    
                    <div class="row">
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label">Salary Expectations</label>
                                {{ form.salary_expectations }}
                                {% if form.salary_expectations.errors %}<div class="text-danger">{{ form.salary_expectations.errors }}</div>{% endif %}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label">Availability</label>
                                {{ form.availability }}
                                {% if form.availability.errors %}<div class="text-danger">{{ form.availability.errors }}</div>{% endif %}
                            </div>
                        </div>
                    </div>
                    
                    <button type="submit" class="btn btn-primary w-100 mt-3">
                        <i class="fas fa-paper-plane"></i> Submit Application
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}