{% extends 'layouts/base.html' %}
{% load i18n static %}

{% block title %}{% trans "Delete Attachment" %}{% endblock %}

{% block extra_css %}
<style>
    :root {
        --hh-navy: #005696;
        --hh-blue: #007bbd;
        --hh-light: #eef6fb;
        --hh-slate: #64748b;
    }

    .page-header-gradient {
        background: linear-gradient(135deg, var(--hh-navy) 0%, #0069a8 50%, var(--hh-blue) 100%);
        color: white;
        padding: 1.5rem 2rem;
        border-radius: 1rem;
        margin-bottom: 1.5rem;
        box-shadow: 0 10px 15px -3px rgba(0, 86, 150, 0.2);
    }

    .section-card {
        background: white;
        border-radius: 1rem;
        border: 2px solid #e2e8f0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .btn-transition {
        transition: all 0.2s ease-in-out;
    }
</style>
{% endblock %}

{% block content %}
<div class="px-6 py-4">
    <div class="page-header-gradient">
        <div class="flex justify-between items-center">
            <div>
                <h1 class="text-2xl font-bold mb-1">{% trans "Delete Attachment" %}</h1>
                <p class="text-blue-100 text-sm">{% trans "Confirm deletion of evidence file" %}</p>
            </div>
            <div class="flex gap-2">
                <a href="{% url 'standards:standard_compliance_update' compliance_id=attachment.compliance.id %}" 
                   class="btn-transition inline-flex items-center px-4 py-2.5 bg-white/10 border-2 border-white/30 text-white font-semibold rounded-xl hover:bg-white hover:text-navy transition">
                    <i data-lucide="arrow-left" class="w-4 h-4 me-2"></i>{% trans "Back to Assessment" %}
                </a>
            </div>
        </div>
    </div>

    <div class="max-w-2xl mx-auto">
        <div class="section-card">
            <div class="p-6">
                <div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-6 rounded-r-lg">
                    <div class="flex items-start">
                        <i data-lucide="alert-triangle" class="w-5 h-5 text-yellow-600 flex-shrink-0 mt-0.5"></i>
                        <div class="ml-3">
                            <h3 class="text-sm font-semibold text-yellow-800">{% trans "Warning" %}</h3>
                            <p class="text-sm text-yellow-700 mt-1">{% trans "This action cannot be undone. The file will be permanently deleted." %}</p>
                        </div>
                    </div>
                </div>

                <h3 class="text-lg font-semibold text-navy mb-4">{% trans "Are you sure you want to delete this attachment?" %}</h3>

                <div class="bg-slate-50 rounded-lg p-4 mb-6">
                    <dl class="divide-y divide-slate-100">
                        <div class="py-3 flex justify-between">
                            <dt class="text-sm font-semibold text-slate">{% trans "File Name" %}</dt>
                            <dd class="text-sm font-semibold text-navy">{{ attachment.filename }}</dd>
                        </div>
                        <div class="py-3 flex justify-between">
                            <dt class="text-sm font-semibold text-slate">{% trans "Description" %}</dt>
                            <dd class="text-sm text-navy">{{ attachment.description|default:"-" }}</dd>
                        </div>
                        <div class="py-3 flex justify-between">
                            <dt class="text-sm font-semibold text-slate">{% trans "Uploaded By" %}</dt>
                            <dd class="text-sm text-navy">{{ attachment.uploaded_by.get_full_name }}</dd>
                        </div>
                        <div class="py-3 flex justify-between">
                            <dt class="text-sm font-semibold text-slate">{% trans "Upload Date" %}</dt>
                            <dd class="text-sm text-navy">{{ attachment.created_at|date:"Y-m-d H:i" }}</dd>
                        </div>
                        <div class="py-3 flex justify-between">
                            <dt class="text-sm font-semibold text-slate">{% trans "Standard" %}</dt>
                            <dd class="text-sm text-navy">{{ attachment.compliance.standard.code }}</dd>
                        </div>
                        <div class="py-3 flex justify-between">
                            <dt class="text-sm font-semibold text-slate">{% trans "Department" %}</dt>
                            <dd class="text-sm text-navy">{{ attachment.compliance.department.name }}</dd>
                        </div>
                    </dl>
                </div>

                <form method="post">
                    {% csrf_token %}
                    <div class="flex gap-3">
                        <button type="submit" class="btn-transition inline-flex items-center px-6 py-2.5 bg-red-500 text-white font-semibold rounded-xl hover:bg-red-600 transition">
                            <i data-lucide="trash-2" class="w-4 h-4 me-2"></i>{% trans "Delete Attachment" %}
                        </button>
                        <a href="{% url 'standards:standard_compliance_update' compliance_id=attachment.compliance.id %}" 
                           class="btn-transition inline-flex items-center px-6 py-2.5 border border-slate-200 text-slate rounded-xl font-semibold hover:bg-slate-50 transition">
                            {% trans "Cancel" %}
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
