{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load i18n %}

{% block title %}{{ _("Update Dealer Information") }}{% endblock title %}

{% block content %}
<div class="container my-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <!-- Form Header -->
            <div class="card shadow-sm">
                <div class="card-header bg-primary text-white">
                    <h4 class="mb-0">{{ _("Update Dealer Information") }}</h4>
                </div>

                <!-- Form Body -->
                <div class="card-body">
                    <form method="post" enctype="multipart/form-data" class="needs-validation" novalidate>
                        {% csrf_token %}
                        {{ form|crispy }}

                        <!-- Save Button -->
                        <div class="d-grid gap-2 mt-3">
                            <button type="submit" class="btn btn-primary btn-lg">
                                <i class="bi bi-save"></i> {{ _("Save Changes") }}
                            </button>
                        </div>
                    </form>
                </div>
            </div>

            <!-- Cancel Button -->
            <div class="text-center mt-4">
                <a href="{% url 'dealer_detail' dealer.pk %}" class="btn btn-secondary">
                &nbsp;{{ _("Back") }}&nbsp;
                    {% if LANGUAGE_CODE == 'ar' %}
                    <i class="bi bi-arrow-left-circle"></i>
                    {% else %}
                    <i class="bi bi-arrow-right-circle"></i>
                    {% endif %}
                </a>
            </div>
        </div>
    </div>
</div>
{% endblock %}