{% extends "layouts/source_user_base.html" %}
{% load i18n static %}

{% block title %}{% trans "Contact PX Team" %} - PX360{% endblock %}

{% block content %}
<div class="p-6 md:p-8 bg-gradient-to-br from-light to-blue-50 min-h-screen">
    <div class="mb-6">
        <a href="{% url 'px_sources:source_user_communication_requests' %}" class="inline-flex items-center gap-2 text-slate hover:text-navy transition text-sm font-semibold">
            <i data-lucide="arrow-left" class="w-4 h-4"></i> {% trans "Back to My Requests" %}
        </a>
    </div>

    <div class="max-w-2xl mx-auto">
        <div class="bg-white rounded-2xl border-2 border-slate-200 shadow-lg p-8">
            <div class="mb-6">
                <h1 class="text-2xl font-bold text-navy flex items-center gap-3">
                    <i data-lucide="phone-outgoing" class="w-6 h-6 text-teal-600"></i>
                    {% trans "Contact PX Team" %}
                </h1>
                <p class="text-slate text-sm mt-1">{% trans "Request the PX team to communicate with a patient" %}</p>
            </div>

            <form method="post">
                {% csrf_token %}

                <div class="mb-5">
                    <label class="block text-xs font-bold text-slate uppercase tracking-wider mb-2">{% trans "Patient Name" %}</label>
                    <input type="text" name="patient_name" class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-navy/20 focus:border-navy outline-none"
                        placeholder="{% trans 'Patient full name' %}">
                </div>

                <div class="grid grid-cols-2 gap-4 mb-5">
                    <div>
                        <label class="block text-xs font-bold text-slate uppercase tracking-wider mb-2">{% trans "Patient Phone" %}</label>
                        <input type="text" name="patient_phone" class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-navy/20 focus:border-navy outline-none"
                            placeholder="{% trans 'Phone number' %}">
                    </div>
                    <div>
                        <label class="block text-xs font-bold text-slate uppercase tracking-wider mb-2">{% trans "Patient MRN" %}</label>
                        <input type="text" name="patient_mrn" class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-navy/20 focus:border-navy outline-none"
                            placeholder="{% trans 'Medical Record Number' %}">
                    </div>
                </div>

                <div class="mb-5">
                    <label class="block text-xs font-bold text-slate uppercase tracking-wider mb-2">{% trans "Reason" %}</label>
                    <select name="reason" class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-navy/20 focus:border-navy outline-none">
                        <option value="complaint_followup">{% trans "Complaint Follow-up" %}</option>
                        <option value="general_inquiry" selected>{% trans "General Inquiry" %}</option>
                        <option value="feedback">{% trans "Feedback Sharing" %}</option>
                        <option value="urgent">{% trans "Urgent Matter" %}</option>
                        <option value="other">{% trans "Other" %}</option>
                    </select>
                </div>

                <div class="mb-6">
                    <label class="block text-xs font-bold text-slate uppercase tracking-wider mb-2">
                        {% trans "Message" %} <span class="text-red-500">*</span>
                    </label>
                    <textarea name="message" rows="4" required class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-navy/20 focus:border-navy outline-none resize-none"
                        placeholder="{% trans 'Describe what the patient needs...' %}"></textarea>
                </div>

                <div class="px-6 md:px-8 py-4 bg-slate-50 border-t border-slate-100 flex gap-3">
                    <button type="submit" class="inline-flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-xl font-semibold hover:bg-blue-700 transition">
                        <i data-lucide="check" class="w-5 h-5"></i>
                        {% trans "Send Request" %}
                    </button>
                    <a href="{% url 'px_sources:source_user_communication_requests' %}"
                       class="inline-flex items-center gap-2 px-6 py-3 bg-white border-2 border-slate-200 text-slate-700 rounded-xl font-semibold hover:bg-slate-50 transition">
                        <i data-lucide="x" class="w-5 h-5"></i>
                        {% trans "Cancel" %}
                    </a>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
