{% extends "layouts/base.html" %}
{% load static i18n %}

{% block title %}{% trans "Editar Recompensa" %} - {% trans "Battle Pass Manager" %}{% endblock %}

{% block extrastyle %}
{% include 'battle_pass/manager/_base_styles.html' %}
{% endblock %}

{% block content %}
<div class="manager-bg">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-lg-8">
                <div class="d-flex flex-column flex-md-row justify-content-between align-items-start align-items-md-center mb-5">
                    <div class="page-header mb-3 mb-md-0">
                        <h2 class="mb-2">
                            <i class="bi bi-pencil text-warning me-2"></i>
                            {% trans "Editar Recompensa" %}
                        </h2>
                        <p class="text-white-50 mb-0">
                            {% trans "Nível" %} {{ level.level }} - {{ season.name }}
                        </p>
                    </div>
                    <a href="{% url 'games:battle_pass_manager_season_detail' season_id=season.id %}" class="btn btn-solid-white">
                        <i class="bi bi-arrow-left me-2"></i>{% trans "Voltar" %}
                    </a>
                </div>

                <div class="card card-glow">
                    <div class="card-body">
                        <form method="post">
                            {% csrf_token %}
                            <div class="mb-3">
                                <label for="description" class="form-label text-white">{% trans "Descrição" %} *</label>
                                <input type="text" class="form-control form-dark" id="description" name="description" 
                                       value="{{ reward.description }}" required>
                            </div>
                            <div class="mb-3">
                                <div class="form-check">
                                    <input class="form-check-input" type="checkbox" id="is_premium" name="is_premium" 
                                           {% if reward.is_premium %}checked{% endif %}>
                                    <label class="form-check-label text-white" for="is_premium">
                                        ⭐ {% trans "Recompensa Premium" %}
                                    </label>
                                </div>
                            </div>
                            <hr class="border-secondary my-4">
                            <h5 class="text-white mb-3">{% trans "Item da Recompensa" %}</h5>
                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label for="item_id" class="form-label text-white">{% trans "Item ID" %}</label>
                                    <input type="number" class="form-control form-dark" id="item_id" name="item_id" 
                                           value="{% if reward.item_id %}{{ reward.item_id }}{% endif %}" min="0">
                                </div>
                                <div class="col-md-6 mb-3">
                                    <label for="item_name" class="form-label text-white">{% trans "Nome do Item" %}</label>
                                    <input type="text" class="form-control form-dark" id="item_name" name="item_name" 
                                           value="{% if reward.item_name %}{{ reward.item_name }}{% endif %}">
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label for="item_enchant" class="form-label text-white">{% trans "Encantamento" %}</label>
                                    <input type="number" class="form-control form-dark" id="item_enchant" name="item_enchant" 
                                           value="{{ reward.item_enchant }}" min="0">
                                </div>
                                <div class="col-md-6 mb-3">
                                    <label for="item_amount" class="form-label text-white">{% trans "Quantidade" %}</label>
                                    <input type="number" class="form-control form-dark" id="item_amount" name="item_amount" 
                                           value="{{ reward.item_amount }}" min="1">
                                </div>
                            </div>
                            <div class="d-flex gap-2 mt-4">
                                <button type="submit" class="btn btn-warning">
                                    <i class="bi bi-check-circle me-2"></i>{% trans "Salvar Alterações" %}
                                </button>
                                <a href="{% url 'games:battle_pass_manager_season_detail' season_id=season.id %}" class="btn btn-solid-white">
                                    {% trans "Cancelar" %}
                                </a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

