{% extends "indy_hub/base.html" %}
{% load i18n %}

{% block page_title %}{% trans "Rename Simulation" %}{% endblock page_title %}

{% block content %}
<div class="container my-4">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card shadow-lg border-0">
                <div class="card-header bg-gradient bg-warning text-white fw-bold">
                    <i class="fas fa-edit me-2"></i>
                    {% trans "Rename Production Simulation" %}
                </div>
                <div class="card-body">
                    <div class="mb-3">
                        <div class="d-flex align-items-center gap-2 mb-2">
                            <img src="https://images.evetech.net/types/{{ simulation.blueprint_type_id }}/bp?size=32" alt="{{ simulation.blueprint_name }}" style="width:32px;height:32px;object-fit:cover;border-radius:6px;background:#f3f4f6;" onerror="this.style.display='none';">
                            <div>
                                <div class="fw-semibold">{{ simulation.blueprint_name }}</div>
                                <small class="text-muted">{{ simulation.runs }} runs</small>
                            </div>
                        </div>
                        <p class="text-muted mb-0">
                            {% trans "Current name:" %} <strong>{{ simulation.display_name }}</strong>
                        </p>
                    </div>

                    <form method="post">
                        {% csrf_token %}
                        <div class="mb-3">
                            <label for="simulation_name" class="form-label">{% trans "New Name" %}</label>
                            <input type="text" class="form-control" id="simulation_name" name="simulation_name" value="{{ simulation.simulation_name }}" placeholder="{% trans 'Leave empty to use default name' %}" maxlength="255">
                            <div class="form-text">
                                {% trans "Leave empty to use the default name format: Blueprint Name x Runs" %}
                            </div>
                        </div>

                        <div class="d-flex gap-2">
                            <button type="submit" class="btn btn-warning">
                                <i class="fas fa-save me-1"></i>{% trans "Save Changes" %}
                            </button>
                            <a href="{% url 'indy_hub:production_simulations' %}" class="btn btn-outline-secondary">
                                <i class="fas fa-times me-1"></i>{% trans "Cancel" %}
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock content %}
