{% extends 'base.html' %}
{% load static %}
{% block title %}My Profile — Parent Portal{% endblock %}
{% block content %}
<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div><h1 class="h3 mb-0">My Profile</h1><p class="text-muted">Manage your contact information</p></div>
        <a href="{% url 'parents:parent_profile_edit' %}" class="btn btn-warning"><i class="fas fa-edit me-2"></i>Edit Profile</a>
    </div>
    <div class="row justify-content-center">
        <div class="col-md-7">
            <div class="card shadow">
                <div class="card-header py-3"><h6 class="m-0 font-weight-bold text-primary">Contact Details</h6></div>
                <div class="card-body">
                    <table class="table table-borderless">
                        <tr><td class="text-muted fw-bold" width="40%">Full Name</td><td class="fw-bold">{{ parent.get_full_name }}</td></tr>
                        <tr><td class="text-muted fw-bold">Relationship</td><td>{{ parent.get_relationship_display }}</td></tr>
                        <tr><td class="text-muted fw-bold">Primary Phone</td><td><i class="fas fa-phone text-success me-2"></i>{{ parent.phone }}</td></tr>
                        <tr><td class="text-muted fw-bold">Alternate Phone</td><td>{{ parent.alternate_phone|default:"—" }}</td></tr>
                        <tr><td class="text-muted fw-bold">Email</td><td>{{ parent.email|default:"—" }}</td></tr>
                        <tr><td class="text-muted fw-bold">Address</td><td>{{ parent.address|default:"—" }}</td></tr>
                        <tr><td class="text-muted fw-bold">Occupation</td><td>{{ parent.get_occupation_display|default:"—" }}</td></tr>
                        <tr><td class="text-muted fw-bold">Employer</td><td>{{ parent.employer|default:"—" }}</td></tr>
                    </table>
                    <hr>
                    <h6 class="text-muted text-uppercase small mb-3">Notification Preferences</h6>
                    <div class="d-flex gap-3">
                        <span class="badge bg-{% if parent.receive_sms %}success{% else %}secondary{% endif %} p-2"><i class="fas fa-sms me-1"></i>SMS {{ parent.receive_sms|yesno:"On,Off" }}</span>
                        <span class="badge bg-{% if parent.receive_email %}success{% else %}secondary{% endif %} p-2"><i class="fas fa-envelope me-1"></i>Email {{ parent.receive_email|yesno:"On,Off" }}</span>
                        <span class="badge bg-{% if parent.receive_whatsapp %}success{% else %}secondary{% endif %} p-2"><i class="fab fa-whatsapp me-1"></i>WhatsApp {{ parent.receive_whatsapp|yesno:"On,Off" }}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
