{% extends 'base.html' %}

{% block title %}Dashboard - {{ block.super }}{% endblock %}

{% block content %}
<div class="hero text-center py-5">
    <div class="container">
        <h1 class="display-4">Rehabilitation Program Builder</h1>
        <p class="lead">Create, manage, and share personalized recovery programs for your patients.</p>
        <a href="{% url 'program_create' %}" class="btn btn-secondary btn-lg">Create New Program</a>
    </div>
</div>

<div class="container mt-5">
    <h2 class="mb-4">Existing Programs</h2>
    <div class="row">
        {% for program in programs %}
        <div class="col-md-6 col-lg-4 mb-4">
            <div class="card program-card h-100">
                <div class="card-body">
                    <h5 class="card-title">{{ program.patient_name }}</h5>
                    <h6 class="card-subtitle mb-2 text-muted">Clinician: {{ program.clinician_name }}</h6>
                    <p class="card-text"><small>Last updated: {{ program.updated_at|date:"d M Y" }}</small></p>
                    <a href="{% url 'program_detail' program.pk %}" class="btn btn-primary btn-sm">View Program</a>
                </div>
            </div>
        </div>
        {% empty %}
        <div class="col">
            <div class="alert alert-info" role="alert">
                No programs found. Get started by creating one!
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %}
