<?php $pageTitle = 'Question Banks'; ?>
<div class="mb-4"><p class="text-secondary">Manage your question banks</p></div>
<?php if (empty($banks)): ?>
    <div class="empty-state"><i class="fas fa-database"></i><h5>No Question Banks</h5><p>Create question banks from the admin panel or ask an administrator.</p></div>
<?php else: ?>
<div class="card-cix">
    <div class="table-responsive">
        <table class="table-cix">
            <thead><tr><th>Bank Name</th><th>Category</th><th>Difficulty</th><th>Questions</th><th>Date</th></tr></thead>
            <tbody>
            <?php foreach ($banks as $b): ?>
            <tr>
                <td><strong><?= e($b['name']) ?></strong><br><small class="text-secondary"><?= e($b['description'] ?? '') ?></small></td>
                <td class="text-secondary"><?= e($b['category'] ?? '-') ?></td>
                <td><span class="badge-cix badge-<?= $b['difficulty'] === 'easy' ? 'active' : ($b['difficulty'] === 'hard' ? 'rejected' : 'submitted') ?>"><?= ucfirst($b['difficulty']) ?></span></td>
                <td><?= (int)$b['question_count'] ?></td>
                <td class="text-secondary small"><?= time_elapsed($b['created_at']) ?></td>
            </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>
<?php endif; ?>
