<?php $title = htmlspecialchars($message->subject); ?>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-white font-weight-bold"><?= htmlspecialchars($message->subject) ?></h1>
    <div>
        <a href="<?= $baseUrl ?>/messages/inbox" class="glass-btn"><i class="fas fa-arrow-left mr-1"></i>Back</a>
        <form method="POST" action="<?= $baseUrl ?>/messages/<?= $message->id ?>/delete" style="display:inline;" onsubmit="return confirm('Delete this message?');">
            <button type="submit" class="glass-btn glass-btn-danger"><i class="fas fa-trash mr-1"></i>Delete</button>
        </form>
    </div>
</div>
<div class="glass-card">
    <div class="mb-3" style="border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 1rem;">
        <div><strong>From:</strong> <?= htmlspecialchars($message->sender_name ?? 'System') ?></div>
        <div><strong>Date:</strong> <?= date('F d, Y H:i', strtotime($message->created_at)) ?></div>
        <div><strong>Priority:</strong> <span class="glass-badge"><?= htmlspecialchars($message->priority) ?></span></div>
    </div>
    <div style="color: rgba(255,255,255,0.8); line-height: 1.7;"><?= nl2br(htmlspecialchars($message->body)) ?></div>
</div>
