{# fortunaisk/templates/fortunaisk/resolve_anomaly_confirm.html #}
{% extends "fortunaisk/base.html" %}
{% load i18n static humanize %}

{% block page_title %}
    {% trans "Resolve Anomaly" %}
{% endblock page_title %}

{% block details %}
<div class="container my-5">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card shadow-lg border-0">
                <div class="card-header text-white" style="background: linear-gradient(135deg, #f1c40f, #27ae60);">
                    <h4 class="mb-0">
                        <i class="fas fa-exclamation-triangle me-2"></i>
                        {% trans "Resolve Anomaly" %} #{{ anomaly.id }}
                    </h4>
                </div>
                <div class="card-body">
                    <p class="alert alert-warning">
                        <i class="fas fa-info-circle me-2"></i>
                        {% trans "Are you sure you want to resolve this anomaly?" %}
                    </p>

                    <dl class="row mb-4">
                        <dt class="col-sm-4">{% trans "Reason" %}</dt>
                        <dd class="col-sm-8">{{ anomaly.reason }}</dd>
                        <dt class="col-sm-4">{% trans "Amount (ISK)" %}</dt>
                        <dd class="col-sm-8">{{ anomaly.amount|intcomma }}</dd>
                        <dt class="col-sm-4">{% trans "Payment Date" %}</dt>
                        <dd class="col-sm-8">{{ anomaly.payment_date|date:"Y-m-d H:i" }}</dd>
                    </dl>

                    <form method="post">
                        {% csrf_token %}
                        <div class="mb-3">
                            <label for="detail" class="form-label">
                                {% trans "Resolution Details" %}
                            </label>
                            <textarea
                                name="detail"
                                id="detail"
                                class="form-control"
                                rows="4"
                                placeholder="{% trans 'Enter any notes or comments about how this anomaly was resolved.' %}"
                            >{{ anomaly.detail }}</textarea>
                        </div>
                        <div class="d-flex justify-content-between">
                            <a href="{% url 'fortunaisk:anomalies_list' %}" class="btn btn-outline-secondary">
                                <i class="fas fa-arrow-left me-1"></i> {% trans "Cancel" %}
                            </a>
                            <button type="submit" class="btn btn-success">
                                <i class="fas fa-check me-1"></i> {% trans "Yes, Resolve" %}
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock details %}
