<?php $title = 'Documents - Ghana Anaesthesiologists Society'; ?>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-white font-weight-bold"><i class="fas fa-folder-open mr-2"></i>Document Library</h1>
    <a href="<?= $baseUrl ?>/documents/upload" class="glass-btn glass-btn-primary"><i class="fas fa-upload mr-1"></i>Upload Document</a>
</div>
<div class="row">
    <?php if (!empty($categories)): ?>
        <?php foreach ($categories as $cat): ?>
        <div class="col-lg-4 col-md-6 mb-4">
            <a href="<?= $baseUrl ?>/documents/category/<?= $cat->id ?>" style="text-decoration: none;">
                <div class="glass-card h-100">
                    <div class="text-center">
                        <i class="fas fa-folder fa-3x mb-3" style="color: #4e73df;"></i>
                        <h5 class="font-weight-bold"><?= htmlspecialchars($cat->name) ?></h5>
                        <p style="color: rgba(255,255,255,0.6); font-size: 0.9rem;"><?= htmlspecialchars($cat->description ?? '') ?></p>
                        <span class="glass-badge"><?= $cat->document_count ?? 0 ?> documents</span>
                    </div>
                </div>
            </a>
        </div>
        <?php endforeach; ?>
    <?php else: ?>
    <div class="col-12"><div class="empty-state"><i class="fas fa-folder-open"></i><p>No document categories</p></div></div>
    <?php endif; ?>
</div>
