{% extends 'base.html' %}
{% load humanize %}

{% block title %}Delete Expense - HAVEN GRAZURI ADVANCE{% endblock %}

{% block content %}
<div class="max-w-2xl mx-auto">
    <div class="mb-6">
        <a href="{% url 'expenses:expense_detail' expense.pk %}" class="inline-flex items-center text-sm text-gray-500 hover:text-gray-700">
            <span>←</span> Back to Expense
        </a>
    </div>

    <div class="bg-white shadow-lg rounded-lg overflow-hidden">
        <div class="px-6 py-4 bg-gray-800 border-b border-gray-200">
            <h2 class="text-xl font-semibold text-white">
                <span>🗑️</span> Delete Expense
            </h2>
        </div>

        <div class="px-6 py-6">
            <div class="mb-6">
                <div class="bg-red-50 border-l-4 border-red-400 p-4 mb-6">
                    <div class="flex">
                        <div class="flex-shrink-0">
                            <span>⚠️</span>
                        </div>
                        <div class="ml-3">
                            <p class="text-sm text-red-700">
                                Warning: This action cannot be undone. The expense record will be permanently deleted.
                            </p>
                        </div>
                    </div>
                </div>

                <p class="text-sm text-gray-600 mb-4">
                    You are about to delete the following expense:
                </p>
                
                <div class="bg-gray-50 rounded-lg p-4 space-y-3">
                    <div class="flex justify-between">
                        <span class="text-sm font-medium text-gray-500">Title:</span>
                        <span class="text-sm text-gray-900">{{ expense.title }}</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-sm font-medium text-gray-500">Amount:</span>
                        <span class="text-sm font-bold text-gray-900">KES {{ expense.amount|floatformat:2|intcomma }}</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-sm font-medium text-gray-500">Category:</span>
                        <span class="text-sm text-gray-900">{{ expense.get_category_display }}</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-sm font-medium text-gray-500">Status:</span>
                        <span class="text-sm text-gray-900">{{ expense.get_status_display }}</span>
                    </div>
                </div>
            </div>

            <form method="post">
                {% csrf_token %}
                <div class="flex items-center justify-end gap-x-4">
                    <a href="{% url 'expenses:expense_detail' expense.pk %}" class="rounded-md bg-white px-4 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50">
                        Cancel
                    </a>
                    <button type="submit" class="rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-700">
                        <span>🗑️</span> Confirm Delete
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}
