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

{% block title %}Editar Patrocinio | Gades Manager{% endblock title %}

{% block content %}
<div class="row mb-3 flex-shrink-0">
    <div class="col-12">
        <div class="bg-dark text-white p-3 rounded-3 shadow-sm" style="border-left: 5px solid #0d6efd;">
            <h1 class="display-6 fw-bold mb-1">Editar Patrocinio</h1>
            <p class="text-white-50 mb-0">{{ patrocinio.empresa }}</p>
        </div>
    </div>
</div>

<div class="row g-4" style="overflow-y: auto;">
    <div class="col-12 col-lg-6">
        <div class="card border-0 shadow-sm">
            <div class="card-body p-4">
                <h5 class="card-title fw-bold mb-3">Datos del Patrocinio</h5>

                <form method="post">
                    {% csrf_token %}

                    {% for field in form %}
                    <div class="mb-3">
                        <label for="{{ field.id_for_label }}" class="form-label fw-semibold">{{ field.label }}</label>
                        {{ field }}
                        {% for error in field.errors %}
                            <div class="text-danger small mt-1">{{ error }}</div>
                        {% endfor %}
                    </div>
                    {% endfor %}

                    <div class="d-flex gap-2 mt-4">
                        <button type="submit" class="btn btn-primary fw-bold px-4">Guardar Cambios</button>
                        <a href="{% url 'patrocinios' %}" class="btn btn-outline-secondary px-4">Cancelar</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock content %}
