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

{% block content %}
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="card shadow-lg border-0 bg-dark text-white rounded-4 overflow-hidden">
                <div class="card-header bg-primary py-4">
                    <h2 class="fw-bold mb-0 text-center"><i class="bi bi-pencil-square me-2"></i> Editar Produção</h2>
                </div>
                <div class="card-body p-5">
                    <form method="POST">
                        {% csrf_token %}
                        
                        <div class="mb-4">
                            <label class="form-label fw-bold text-primary">Título da Produção</label>
                            <input type="text" name="title" class="form-control bg-dark text-white border-secondary" value="{{ project.title }}" required>
                        </div>

                        <div class="mb-4">
                            <label class="form-label fw-bold text-primary">Descrição / Sinopse</label>
                            <textarea name="description" rows="4" class="form-control bg-dark text-white border-secondary" required>{{ project.description }}</textarea>
                        </div>

                        <div class="row mb-4">
                            <div class="col-md-6">
                                <label class="form-label fw-bold text-primary">Categoria</label>
                                <input type="text" name="category" class="form-control bg-dark text-white border-secondary" value="{{ project.category }}" required>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label fw-bold text-primary">Classificação Indicativa</label>
                                <input type="text" name="rating" class="form-control bg-dark text-white border-secondary" value="{{ project.rating }}" required>
                            </div>
                        </div>

                        <div class="row mb-5">
                            <div class="col-md-6">
                                <label class="form-label fw-bold text-primary">Duração</label>
                                <input type="text" name="duration" class="form-control bg-dark text-white border-secondary" value="{{ project.duration }}" required>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label fw-bold text-primary">Orçamento Estimado</label>
                                <input type="text" name="budget" class="form-control bg-dark text-white border-secondary" value="{{ project.estimated_budget }}" required>
                            </div>
                        </div>

                        <div class="d-flex gap-3 justify-content-between">
                            <a href="{% url 'production_library' %}" class="btn btn-outline-light rounded-pill px-4">CANCELAR</a>
                            <button type="submit" class="btn btn-primary rounded-pill px-5 fw-bold shadow">SALVAR ALTERAÇÕES</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
    body { background-color: #0a0a0a; }
    .card { border: 1px solid rgba(255,255,255,0.1) !important; }
</style>
{% endblock %}
