<?php
helper('notification');
$count = notifications_unread_count();
$badge = \App\Services\NotificationService::formatBadge($count);
$label = $count > 0 ? 'Notifications, ' . $badge . ' unread' : 'Notifications';
?>
<a class="icon-btn bell-btn" href="<?= site_url('notifications') ?>" aria-label="<?= esc($label, 'attr') ?>">
    <svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path d="M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 1 0-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 1 1-6 0" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>
    <?php if ($count > 0): ?>
        <span class="bell-badge"><?= esc($badge) ?></span>
    <?php endif; ?>
</a>
