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

{% block title %}Upload Health Report - RaktaPulse{% endblock %}

{% block content %}
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow-sm border-0" style="border-radius: 20px;">
                <div class="card-body p-5">
                    <h2 class="text-center mb-4" style="font-weight: 700;">Upload Medical Report</h2>
                    <p class="text-muted text-center mb-5">Save your hospital reports and health records securely.</p>
                    
                    <form method="POST" enctype="multipart/form-data">
                        {% csrf_token %}
                        
                        <div class="mb-4">
                            <label class="form-label" style="font-weight: 600;">Report Title *</label>
                            <input type="text" name="title" class="form-control" placeholder="e.g., Annual Blood Test" required style="border-radius: 10px; padding: 12px;">
                        </div>

                        <div class="mb-4">
                            <label class="form-label" style="font-weight: 600;">Hospital/Clinic Name</label>
                            <input type="text" name="hospital_name" class="form-control" placeholder="e.g., City General Hospital" style="border-radius: 10px; padding: 12px;">
                        </div>

                        <div class="row">
                            <div class="col-md-6 mb-4">
                                <label class="form-label" style="font-weight: 600;">Report Date *</label>
                                <input type="date" name="report_date" class="form-control" required style="border-radius: 10px; padding: 12px;">
                            </div>
                            <div class="col-md-6 mb-4">
                                <label class="form-label" style="font-weight: 600;">Follow-up Test Date</label>
                                <input type="date" name="next_test_date" class="form-control" style="border-radius: 10px; padding: 12px;">
                                <small class="text-muted">When should you take the next test?</small>
                            </div>
                        </div>

                        <div class="mb-4">
                            <label class="form-label" style="font-weight: 600;">Upload File (PDF/Image) *</label>
                            <input type="file" name="report_file" class="form-control" required style="border-radius: 10px; padding: 12px;">
                        </div>

                        <div class="mb-4">
                            <label class="form-label" style="font-weight: 600;">Description/Notes</label>
                            <textarea name="description" class="form-control" rows="3" placeholder="Any specific notes from the doctor..." style="border-radius: 10px; padding: 12px;"></textarea>
                        </div>

                        <div class="mb-4">
                            <div class="form-check form-switch">
                                <input class="form-check-input" type="checkbox" name="allow_notifications" id="allowNotifications">
                                <label class="form-check-label" for="allowNotifications" style="font-weight: 600;">
                                    Enable Follow-up Notifications
                                </label>
                            </div>
                            <p class="text-muted small">We'll notify you when it's time for your next test based on the date set above.</p>
                        </div>

                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary py-3" style="border-radius: 10px; font-weight: 700; background-color: var(--pulse-red); border: none;">
                                <i class="fas fa-upload me-2"></i> Save Report
                            </button>
                            <a href="{% url 'vaccination_dashboard' %}" class="btn btn-light py-3" style="border-radius: 10px; font-weight: 600;">Cancel</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
