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

{% block title %}Add Project - webFirma{% endblock %}

{% block content %}
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow-sm">
                <div class="card-header bg-primary text-white">
                    <h4 class="mb-0">Create a New Project</h4>
                </div>
                <div class="card-body">
                    <form method="post">
                        {% csrf_token %}
                        <div class="row">
                            <div class="col-md-6 mb-3">
                                <div class="form-floating">
                                    {{ form.name }}
                                    <label for="{{ form.name.id_for_label }}">Project Name</label>
                                </div>
                            </div>
                            <div class="col-md-6 mb-3">
                                <div class="form-floating">
                                    {{ form.client }}
                                    <label for="{{ form.client.id_for_label }}">Client</label>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 mb-3">
                                <div class="form-floating">
                                    {{ form.start_date }}
                                    <label for="{{ form.start_date.id_for_label }}">Start Date</label>
                                </div>
                            </div>
                            <div class="col-md-6 mb-3">
                                <div class="form-floating">
                                    {{ form.end_date }}
                                    <label for="{{ form.end_date.id_for_label }}">End Date</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-floating mb-3">
                            {{ form.status }}
                            <label for="{{ form.status.id_for_label }}">Status</label>
                        </div>
                        <div class="d-flex justify-content-end">
                            <a href="{% url 'projects' %}" class="btn btn-secondary me-2">Cancel</a>
                            <button type="submit" class="btn btn-primary">Save Project</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    .form-floating .form-control, .form-floating .form-select {
        height: calc(3.5rem + 2px);
        padding: 1rem;
    }
    .form-floating > label {
        padding: 1rem;
    }
</style>
{% endblock %}