<div class="p-3">
    <div class="card border-secondary shadow-sm mb-2">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h2 class="h6 mb-0">Self Review</h2>
            <span class="badge bg-primary-subtle text-primary-emphasis">{{ user_exam.exam }}</span>
        </div>
        <div class="card-body">
            <div class="small text-muted mb-2">Case: <strong>{{ case }}</strong></div>

            <div class="row g-2 mb-3">
                <div class="col-6">
                    <div class="p-2 border rounded">
                        <div class="small text-muted">Findings</div>
                        <div class="fw-semibold">{{ review.findings|default:"-" }}/5</div>
                    </div>
                </div>
                <div class="col-6">
                    <div class="p-2 border rounded">
                        <div class="small text-muted">Interpretation</div>
                        <div class="fw-semibold">{{ review.interpretation|default:"-" }}/5</div>
                    </div>
                </div>
            </div>

            <div class="mb-3">
                <div class="small text-muted mb-1">Comments</div>
                <div class="p-2 border rounded bg-body-tertiary">
                    {% if review.comments %}
                        {{ review.comments|linebreaksbr }}
                    {% else %}
                        <span class="text-muted">No comments added.</span>
                    {% endif %}
                </div>
            </div>

            <div class="small text-muted mb-3">
                Updated: {{ review.review_update_date }}
            </div>

            <div class="d-flex gap-2 flex-wrap">
                <a class="btn btn-outline-warning btn-sm"
                   href="{% url 'atlas:self_review_update' user_exam.id case.id review.id %}?embed=1">
                    Edit in sidebar
                </a>
                <a class="btn btn-outline-secondary btn-sm"
                   href="{% url 'atlas:self_review_detail' user_exam.id case.id review.id %}">
                    Open full page
                </a>
            </div>
        </div>
    </div>
</div>
