<?php $pageTitle = 'Announcements'; ?>
<?php if (empty($announcements)): ?>
    <div class="empty-state"><i class="fas fa-bullhorn"></i><h5>No Announcements</h5><p>Check back later for updates from your academy.</p></div>
<?php else: ?>
    <?php foreach ($announcements as $ann): ?>
    <div class="card-cix mb-3">
        <div class="d-flex align-items-center gap-2 mb-2">
            <?php if ($ann['is_pinned']): ?><span class="badge-cix badge-submitted" style="font-size:0.65rem;"><i class="fas fa-thumbtack"></i> PINNED</span><?php endif; ?>
            <h5 class="mb-0"><?= e($ann['title']) ?></h5>
        </div>
        <p style="line-height:1.8;"><?= nl2br(e($ann['content'])) ?></p>
        <small class="text-secondary"><i class="fas fa-clock me-1"></i> <?= time_elapsed($ann['created_at']) ?></small>
    </div>
    <?php endforeach; ?>
<?php endif; ?>
