{% extends 'base.html' %}
{% block title %}Add Income - Astron Hosts Expense Tracker{% endblock %}
{% block content %}
<div class="container d-flex align-items-center justify-content-center min-vh-100">
    <div class="row justify-content-center w-100">
        <div class="col-md-6">
            <div class="card shadow-lg p-4 rounded-4 border-0" style="background: #fff;">
                <div class="text-center mb-3">
                    <span style="font-size:2.5rem;">💵</span>
                </div>
                <h2 class="mb-4 text-center display-6 fw-bold" style="letter-spacing:1px;">Add Income</h2>
                <form method="post" novalidate>
                    {% csrf_token %}
                    <div class="mb-3">
                        <label for="id_source" class="form-label">Source</label>
                        <input type="text" name="source" class="form-control rounded-3{% if form.source.errors %} is-invalid{% endif %}" id="id_source" value="{{ form.source.value|default_if_none:'' }}">
                        {% for error in form.source.errors %}
                            <div class="invalid-feedback">{{ error }}</div>
                        {% endfor %}
                    </div>
                    <div class="mb-3">
                        <label for="id_amount" class="form-label">Amount</label>
                        <input type="number" step="0.01" name="amount" class="form-control rounded-3{% if form.amount.errors %} is-invalid{% endif %}" id="id_amount" value="{{ form.amount.value|default_if_none:'' }}">
                        {% for error in form.amount.errors %}
                            <div class="invalid-feedback">{{ error }}</div>
                        {% endfor %}
                    </div>
                    <div class="mb-3">
                        <label for="id_date" class="form-label">Date</label>
                        <input type="date" name="date" class="form-control rounded-3{% if form.date.errors %} is-invalid{% endif %}" id="id_date" value="{{ form.date.value|default_if_none:'' }}">
                        {% for error in form.date.errors %}
                            <div class="invalid-feedback">{{ error }}</div>
                        {% endfor %}
                    </div>
                    <button type="submit" class="btn btn-success w-100 rounded-3 py-2 fw-bold" style="font-size:1.1rem;">Add Income</button>
                </form>
                <a href="{% url 'dashboard' %}" class="btn btn-link mt-3">Back to Dashboard</a>
            </div>
        </div>
    </div>
</div>
{% endblock %}