{% extends 'users/base.html' %}

{% block title %}Delete User: {{ object.get_full_name|default:object.email }}{% endblock %}

{% block card_content %}
<div class="alert alert-danger">
    <h4 class="alert-heading">Warning!</h4>
    <p>You are about to delete the user account for <strong>{{ object.get_full_name|default:object.email }}</strong>. This action cannot be undone.</p>
    <hr>
    <p class="mb-0">All data associated with this user will be permanently removed from the system.</p>
</div>

<div class="card mb-4">
    <div class="card-header">
        <h5>User Details</h5>
    </div>
    <div class="card-body">
        <table class="table table-bordered">
            <tr>
                <th>Name</th>
                <td>{{ object.get_full_name|default:"-" }}</td>
            </tr>
            <tr>
                <th>Email</th>
                <td>{{ object.email }}</td>
            </tr>
            <tr>
                <th>Role</th>
                <td>{{ object.role.name|default:"-" }}</td>
            </tr>
            <tr>
                <th>Status</th>
                <td>
                    <span class="badge {% if object.is_active %}bg-success{% else %}bg-danger{% endif %}">
                        {% if object.is_active %}Active{% else %}Inactive{% endif %}
                    </span>
                </td>
            </tr>
        </table>
    </div>
</div>

<form method="post">
    {% csrf_token %}
    <div class="d-flex justify-content-between">
        <a href="{% url 'users:user_detail' object.pk %}" class="btn btn-secondary">
            <i class="fas fa-arrow-left"></i> Cancel
        </a>
        <button type="submit" class="btn btn-danger">
            <i class="fas fa-trash"></i> Confirm Delete
        </button>
    </div>
</form>
{% endblock %}
