{% extends 'base.html.twig' %}

{% block title %}Profil du candidat{% endblock %}

{% block body %}
    <div class="max-w-3xl mx-auto mt-8 bg-white p-6 rounded-lg shadow-lg border border-gray-300">
        <h2 class="text-2xl font-bold mb-4">Profil du candidat</h2>

        <div class="mb-4">
            <p><strong>Nom :</strong> {{ candidat.lastName }}</p>
            <p><strong>Prénom :</strong> {{ candidat.firstName }}</p>
            <p><strong>Email :</strong> {{ candidat.mail }}</p>
            <p><strong>Téléphone :</strong> {{ candidat.tel }}</p>
            <p><strong>Adresse :</strong> {{ candidat.address }}</p>
        </div>

        <div class="mb-4">
            <h3 class="text-xl font-semibold">Diplômes</h3>
            <ul class="list-disc list-inside text-gray-800 mt-2">
                {% if candidat.degrees|length > 0 %}
                    {% for deg in candidat.degrees %}
                        <li>
                            {{ deg.degree.label }} — Obtenu le {{ deg.graduationDate|date('d/m/Y') }}
                        </li>
                    {% endfor %}
                {% else %}
                    <p class="text-gray-500 mt-2">Aucun diplôme renseigné.</p>
                {% endif %}
            </ul>
        </div>

        <div class="mb-4">
            <h3 class="text-xl font-semibold">Compétences</h3>
            <ul class="list-disc list-inside text-gray-800 mt-2">
                {% if candidat.skills|length > 0 %}
                    {% for sk in candidat.skills %}
                        <li>{{ sk.skill.label }}</li>
                    {% endfor %}
                {% else %}
                    <p class="text-gray-500 mt-2">Aucune compétence renseignée.</p>
                {% endif %}
            </ul>
        </div>

        <div class="mt-6">
            <a href="{{ path('app_employee_seeApplications') }}"
               class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
                Retour à la liste des candidatures
            </a>
        </div>
    </div>
{% endblock %}
