PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<header class="topbar" role="banner">
<div class="left">
<!-- Messages -->
<div class="dropdown">
<button aria-label="Messages" title="Messages" class="icon-btn" id="msgBtn">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M21 15a2 2 0 0 1-2 2H7l-6 4V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10z"
fill="#0C4DA2" opacity="0.12"/>
<path d="M21 3H3a2 2 0 0 0-2 2v14l6-4h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z"
stroke="#0C4DA2" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<?php if($unreadMessages>0): ?><span class="badge" id="msgBadge"><?= $unreadMessages ?></span><?php endif; ?>
</button>
<div class="dropdown-menu" id="msgDropdown">
<div class="dropdown-header">Messages</div>
<?php if(empty($messages)): ?>
<div class="dropdown-item">No messages</div>
<?php else: foreach($messages as $m):
$isUnread = ($m['status'] ?? '') !== 'seen';
$idHex = id_to_hex($m['id']);
?>
<div class="dropdown-item <?= $isUnread ? 'unread' : '' ?>" data-id="<?= $idHex ?>" onclick="openMessage(this)">
<strong><?= htmlspecialchars($m['title']) ?></strong>
<div style="font-size:13px;color:var(--muted);margin-top:6px;"><?= nl2br(htmlspecialchars(substr($m['body'],0,120))) ?></div>
<div style="font-size:11px;color:#94a3b8;margin-top:8px"><?= date('M d, Y H:i', strtotime($m['created_at'])) ?></div>
</div>
<?php endforeach; endif; ?>
<div class="dropdown-footer"><a href="messages.php">View all messages</a></div>
</div>
</div>
<!-- Logo -->
<a href="index.php" class="logo" aria-hidden="true" title="Logo">
<img src="../img/logo.png" alt="" style="width:25px;height:25px;border-radius:5%;object-fit:cover">
</a>
</div>
<div style="flex:1;display:flex;justify-content:center;align-items:center;">
<span style="font-size:14px;font-weight:600;color:var(--primary-dark);">
<?php echo $greetingMessage; ?>
</span>
</div>
<div class="right">
<!-- Notifications -->
<div class="dropdown">
<button aria-label="Notifications" title="Notifications" class="icon-btn" id="notifBtn">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M12 22a2 2 0 0 0 2-2H10a2 2 0 0 0 2 2zM18 16v-5a6 6 0 0 0-12 0v5L4 18h16l-2-2z"
stroke="#6E6E6E" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<?php if($unreadNotifs>0): ?><span class="badge" id="notifBadge"><?= $unreadNotifs ?></span><?php endif; ?>
</button>
<div class="dropdown-menu" id="notifDropdown">
<div class="dropdown-header">Notifications</div>
<?php if(empty($notifications)): ?>
<div class="dropdown-item">No notifications</div>
<?php else: foreach($notifications as $n):
$isUnread = ($n['status'] ?? '') !== 'seen';
$nidHex = id_to_hex($n['id']);
?>
<div class="dropdown-item <?= $isUnread ? 'unread' : '' ?>">
<strong><?= htmlspecialchars($n['title']) ?></strong>
<div style="font-size:13px;color:var(--muted);margin-top:6px;"><?= nl2br(htmlspecialchars(substr($n['body'],0,120))) ?></div>
<div style="font-size:11px;color:#94a3b8;margin-top:8px"><?= date('M d, Y H:i', strtotime($n['created_at'])) ?></div>
</div>
<?php endforeach; endif; ?>
<div class="dropdown-footer"><a href="notifications.php">View all notifications</a></div>
</div>
</div>
<!-- Profile -->
<div class="dropdown">
<div class="profile" id="profileBtn" title="Account">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 22a10 10 0 0 1 20 0"
stroke="#0C4DA2" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="dropdown-menu" id="profileDropdown">
<div class="dropdown-header">Account</div>
<div class="dropdown-item"><a href="profile.php">View Profile</a></div>
<div class="dropdown-item"><a href="profile_settings.php">Settings</a></div>
<div class="dropdown-item"><a href="logout.php">Logout</a></div>
</div>
</div>
</div>
</header>
<style>
.topbar {
border-radius: 20px;
top: 0; left: 0; right: 0;
background: white;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 22px;
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
z-index: 100;
}
.left, .right {
display: flex;
align-items: center;
gap: 20px;
}
.icon-btn {
position: relative;
cursor: pointer;
background: transparent;
border: 0;
}
.badge {
position: absolute;
top: -3px; right: -3px;
background: #e53935;
color: white;
font-size: 10px;
border-radius: 50%;
width: 16px; height: 16px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
}
.logo svg {
width: 28px;
height: 28px;
fill: #0C4DA2;
}
.profile svg {
cursor: pointer;
}
.dropdown {
position: relative;
}
.dropdown-menu {
display: none;
position: absolute;
top: 120%;
right: 0;
background: white;
border-radius: 10px;
box-shadow: 0 6px 20px rgba(0,0,0,0.15);
min-width: 240px;
max-width: 90vw; /* ✅ Prevents overflow */
overflow: hidden;
animation: fadeIn 0.2s ease;
z-index: 9999;
}
.dropdown-menu.active {
display: block;
}
.dropdown-header {
font-weight: 600;
color: #0C4DA2;
background: #f1f5fb;
padding: 10px 14px;
font-size: 13px;
}
.dropdown-item {
padding: 10px 14px;
border-bottom: 1px solid #eee;
font-size: 13px;
color: #333;
}
.dropdown-item:hover {
background: #f9f9f9;
}
.dropdown-footer {
text-align: center;
padding: 10px;
background: #f8fafc;
font-size: 13px;
}
.dropdown-footer a {
color: #0C4DA2;
text-decoration: none;
font-weight: 500;
}
/* 🔧 Fix mobile overflow */
@media (max-width: 600px) {
.topbar {
padding: 8px 12px;
flex-wrap: wrap;
}
.left, .right {
gap: 14px;
}
.dropdown-menu {
position: fixed;
top: 70px;
left: 10px;
right: 10px;
width: auto;
border-radius: 12px;
box-shadow: 0 4px 14px rgba(0,0,0,0.2);
max-height: 80vh;
overflow-y: auto;
}
}
@keyframes fadeIn {
from {opacity: 0; transform: translateY(-5px);}
to {opacity: 1; transform: translateY(0);}
}
</style>
<script>
const dropdowns = document.querySelectorAll('.dropdown');
dropdowns.forEach(d => {
const btn = d.querySelector('button, .profile');
const menu = d.querySelector('.dropdown-menu');
btn.addEventListener('click', e => {
e.stopPropagation();
document.querySelectorAll('.dropdown-menu').forEach(m => m !== menu && m.classList.remove('active'));
menu.classList.toggle('active');
});
});
document.addEventListener('click', () => {
document.querySelectorAll('.dropdown-menu').forEach(m => m.classList.remove('active'));
});
</script>
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E