<div class="container py-4">
    <nav aria-label="breadcrumb" class="mb-4">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="<?= APP_URL ?>/universities" class="text-decoration-none">Discovery Center</a></li>
            <li class="breadcrumb-item"><a href="<?= APP_URL ?>/universities/<?= $university['slug'] ?>" class="text-decoration-none"><?= htmlspecialchars($university['name']) ?></a></li>
            <li class="breadcrumb-item active" aria-current="page">Programs</li>
        </ol>
    </nav>

    <div class="card border-0 shadow-sm p-4">
        <h3 class="fw-bold font-outfit text-dark mb-4 border-bottom pb-2">Academic Programs at <?= htmlspecialchars($university['name']) ?></h3>
        <?php if (!empty($programs)): ?>
            <div class="row g-3">
                <?php foreach ($programs as $prog): ?>
                    <div class="col-md-6">
                        <div class="border rounded p-3 h-100 bg-light-subtle d-flex flex-column">
                            <div class="d-flex justify-content-between align-items-start mb-2">
                                <h6 class="fw-bold text-dark m-0"><?= htmlspecialchars($prog['name']) ?></h6>
                                <span class="badge bg-secondary text-uppercase text-2xs"><?= htmlspecialchars($prog['duration_years']) ?> Years</span>
                            </div>
                            <p class="text-xs text-muted mb-3"><?= htmlspecialchars(ucfirst($prog['degree_level'] ?? 'bachelor')) ?> Degree</p>
                            <div class="mt-auto pt-2 border-top text-xs text-muted">
                                Required WASSCE Cut-off: <strong class="text-primary"><?= $prog['min_aggregate'] ?: 'N/A' ?></strong>
                            </div>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        <?php else: ?>
            <div class="text-center py-5 text-muted">
                <p>No programs logged in the database yet.</p>
            </div>
        <?php endif; ?>
    </div>
</div>
