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

{% block title %}{% trans "Editar Temporada" %} - {% 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 Temporada" %}
                        </h2>
                        <p class="text-white-50 mb-0">{{ 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="name" class="form-label text-white">{% trans "Nome da Temporada" %} *</label>
                                <input type="text" class="form-control form-dark" id="name" name="name" value="{{ season.name }}" required>
                            </div>
                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label for="start_date" class="form-label text-white">{% trans "Data de Início" %} *</label>
                                    <input type="datetime-local" class="form-control form-dark" id="start_date" name="start_date" 
                                           value="{{ season.start_date|date:'Y-m-d\TH:i' }}" required>
                                </div>
                                <div class="col-md-6 mb-3">
                                    <label for="end_date" class="form-label text-white">{% trans "Data de Término" %} *</label>
                                    <input type="datetime-local" class="form-control form-dark" id="end_date" name="end_date" 
                                           value="{{ season.end_date|date:'Y-m-d\TH:i' }}" required>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label for="premium_price" class="form-label text-white">{% trans "Preço Premium (Moedas)" %}</label>
                                    <input type="number" class="form-control form-dark" id="premium_price" name="premium_price" 
                                           value="{{ season.premium_price }}" min="0">
                                </div>
                                <div class="col-md-6 mb-3">
                                    <div class="form-check mt-4">
                                        <input class="form-check-input" type="checkbox" id="is_active" name="is_active" 
                                               {% if season.is_active %}checked{% endif %}>
                                        <label class="form-check-label text-white" for="is_active">
                                            {% trans "Temporada Ativa" %}
                                        </label>
                                    </div>
                                </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 %}

