<?php
$tb_doctor_id = $_SESSION['doctor_id'];
$tb_stmt = $conn->prepare("SELECT full_name, profile_photo FROM doctors WHERE id=?");
$tb_stmt->bind_param('i', $tb_doctor_id);
$tb_stmt->execute();
$tb_d = $tb_stmt->get_result()->fetch_assoc();
?>
<style>
  .topbar {
    background: linear-gradient(135deg, #0B4ACB, #3B63E6);
    padding: 0 24px; height: 58px;
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 300;
    box-shadow: 0 2px 16px rgba(11,74,203,.3);
  }
  .topbar-left { display:flex; align-items:center; gap:12px; }
  .topbar-right { display:flex; align-items:center; gap:10px; }

  .tb-profile {
    display:flex; align-items:center; gap:8px;
    padding:5px 12px 5px 5px; border-radius:12px;
    background:rgba(255,255,255,.15); border:1.5px solid rgba(255,255,255,.25);
    text-decoration:none; transition:all .2s;
  }
  .tb-profile:hover { background:rgba(255,255,255,.25); }
  .tb-profile-img {
    width:30px; height:30px; border-radius:8px;
    display:flex; align-items:center; justify-content:center;
    overflow:hidden; flex-shrink:0; background:rgba(255,255,255,.2);
  }
  .tb-profile-img img { width:100%; height:100%; object-fit:cover; }
  .tb-profile-img i { color:#fff; font-size:14px; }
  .tb-profile-name { font-size:12px; font-weight:600; color:#fff; }

  .doc-main { padding-top: 58px; }

  @media(max-width:768px) {
    .topbar { padding: 0 12px; }
    .tb-profile-name { display:none; }
  }
</style>

<div class="topbar">
  <div class="topbar-left">
    <button class="sb-hamburger" onclick="mobToggle()" style="position:static;box-shadow:none;background:rgba(255,255,255,.15);">
      <i class="fas fa-bars"></i>
    </button>
    <img src="<?= SITE_URL ?>/black.png" alt="HealthLink" style="height:44px;object-fit:contain;">
  </div>
  <div class="topbar-right">
    <a href="profile.php" class="tb-profile">
      <div class="tb-profile-img">
        <?php if(!empty($tb_d['profile_photo'])): ?>
          <img src="<?= SITE_URL ?>/<?= $tb_d['profile_photo'] ?>" alt="">
        <?php else: ?>
          <i class="fas fa-user-md"></i>
        <?php endif; ?>
      </div>
      <span class="tb-profile-name">Dr. <?= htmlspecialchars(explode(' ', $tb_d['full_name'])[0]) ?></span>
    </a>
  </div>
</div>
