<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-white"><i class="fas fa-gift mr-2"></i>Birthday Wishes for <?= htmlspecialchars($recipient->name) ?></h1>
    <a href="<?= $baseUrl ?>/birthdays" class="btn btn-sm btn-secondary"><i class="fas fa-arrow-left mr-1"></i>Back to Birthdays</a>
</div>

<div class="row">
    <div class="col-md-5 mb-4">
        <div class="card glass-card">
            <div class="card-body text-center">
                <?php
                $avatar = $recipient->avatar
                    ? $baseUrl . '/' . ltrim($recipient->avatar, '/')
                    : $baseUrl . '/img/undraw_profile.svg';
                ?>
                <img src="<?= $avatar ?>" class="rounded-circle mb-3" style="width: 100px; height: 100px; object-fit: cover; border: 3px solid rgba(78, 115, 223, 0.3);">
                <h4 class="text-white"><?= htmlspecialchars($recipient->name) ?></h4>
                <form method="POST" action="<?= $baseUrl ?>/birthdays/wishes/<?= $recipient->id ?>/send">
                    <div class="form-group mt-3">
                        <textarea name="message" class="form-control glass-input" rows="3" placeholder="Write your birthday wish..." required></textarea>
                    </div>
                    <button type="submit" class="btn btn-primary btn-block"><i class="fas fa-paper-plane mr-1"></i>Send Wish</button>
                </form>
            </div>
        </div>
    </div>
    <div class="col-md-7 mb-4">
        <div class="card glass-card">
            <div class="card-header"><i class="fas fa-comments mr-2"></i>Wishes (<?= count($wishes) ?>)</div>
            <div class="card-body">
                <?php if (!empty($wishes)): ?>
                <div class="list-group list-group-flush" style="background: transparent;">
                    <?php foreach ($wishes as $wish): ?>
                    <?php
                    $senderAvatar = $wish->sender_avatar
                        ? $baseUrl . '/' . ltrim($wish->sender_avatar, '/')
                        : $baseUrl . '/img/undraw_profile.svg';
                    ?>
                    <div class="list-group-item" style="background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1);">
                        <div class="d-flex">
                            <img src="<?= $senderAvatar ?>" class="rounded-circle mr-3" style="width: 40px; height: 40px; object-fit: cover;">
                            <div>
                                <strong class="text-white"><?= htmlspecialchars($wish->sender_name) ?></strong>
                                <small class="text-muted ml-2"><?= date('M j, Y g:i A', strtotime($wish->created_at)) ?></small>
                                <p class="mb-0 text-white-50 mt-1"><?= nl2br(htmlspecialchars($wish->message)) ?></p>
                            </div>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
                <?php else: ?>
                <p class="text-muted text-center mb-0">No wishes yet. Be the first to send one!</p>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
