<div class="d-flex justify-content-between align-items-center mb-3">
    <h3>Nástěnka</h3>
    <?php if ($user['role'] !== 'sportovec'): ?>
        <a href="<?= BASE_URL ?>/nastenka/pridat" class="btn btn-primary"><i class="ti ti-clipboard-plus fs-4"></i></a>
    <?php endif; ?>
</div>
<div class="card mb-4">
    <div class="card-body">
        <?php if (empty($notes)): ?>
            <div class="alert alert-info" role="alert">
                <i class="ti ti-info-circle"></i>
                Zatím žádné poznámky.
            </div>
        <?php else: ?>
            <?php foreach($notes as $note): ?>
                <a href="<?= BASE_URL ?>/nastenka/show?id=<?= $note['id'] ?>" style="text-decoration: none; color: inherit;">
                    <div class="card note-card mb-3" style="cursor: pointer; transition: all 0.2s; border-left: 4px solid #0d6efd !important;" onmouseover="this.style.boxShadow='0 4px 8px rgba(0,0,0,0.15)'" onmouseout="this.style.boxShadow=''">
                        <div class="card-body">
                            <div class="d-flex justify-content-between">
                                <div>
                                    <strong><?= htmlspecialchars($note['jmeno'] . ' ' . $note['prijmeni']) ?></strong>
                                    <br><small class="text-muted"><?= htmlspecialchars($note['tym_nazev']) ?></small>
                                </div>
                                <small class="text-muted"><?= date('H:i | d.m.Y', strtotime($note['datum'])) ?></small>
                            </div>
                            <p class="mt-2 mb-0"><?= htmlspecialchars($note['obsah']) ?></p>
                        </div>
                    </div>
                </a>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>
</div>