/* ═══════════════════════════════════════════════
   topbar.css  –  Standalone Topbar Component
   IndianSpermTech / BM Project
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --tb-height:         70px;
  --sb-width:          280px;
  --sb-collapsed:      68px;
  --tb-bg:             #02021A;
  --tb-border:         #1A1AAF;
  --tb-text:           #FFFFFF;
  --tb-text-dim:       #64748B;
  --tb-dropdown-bg:    #FFFFFF;
  --tb-dropdown-text:  #1E293B;
  --tb-transition:     0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Topbar Container (.app-navbar) ── */
.app-navbar {
  background: var(--tb-bg);
  border-bottom: 2px solid var(--tb-border);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  height: var(--tb-height);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  padding-left: var(--sb-width) !important;
  transition: padding-left var(--tb-transition);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Dynamic Topbar alignment shift when sidebar collapses */
.sb-main.sb-main-collapsed .app-navbar {
  padding-left: var(--sb-collapsed) !important;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #A0A0FF !important;
}

/* ── Mobile Hamburger Button ── */
.sb-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #FFFFFF;
  font-size: 1.2rem;
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.2s;
}

.sb-mobile-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Profile Dropdown in Navbar ── */
.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 6px 14px 6px 8px;
  cursor: pointer;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
  position: relative;
}

.nav-profile-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.nav-profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}

.nav-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--tb-dropdown-bg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  min-width: 190px;
  z-index: 2000;
  overflow: hidden;
  display: none;
}

.nav-profile-dropdown.open {
  display: block;
}

.nav-profile-dropdown .npd-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-profile-dropdown .npd-header strong {
  display: block;
  font-size: 0.88rem;
  color: var(--tb-dropdown-text);
}

.nav-profile-dropdown .npd-header small {
  font-size: 0.75rem;
  color: var(--tb-text-dim);
}

.nav-profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--tb-dropdown-text);
  text-decoration: none;
  transition: background 0.15s;
}

.nav-profile-dropdown a:hover {
  background: rgba(0, 0, 0, 0.04);
}

.nav-profile-dropdown a.logout {
  color: #C0392B;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-profile-dropdown a.logout:hover {
  background: rgba(192, 57, 67, 0.05);
}

/* ── Mobile Topbar Responsive ── */
@media (max-width: 991px) {
  .app-navbar {
    padding-left: 15px !important;
  }
  .sb-mobile-btn {
    display: flex !important;
  }
}

/* ── Profile dropdown: card layout (My Profile + Logout only) ── */
.nav-profile-dropdown.npd-card {
  min-width: 280px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 0;
}

.npd-card .npd-profile {
  margin: 10px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00003D 0%, #000066 55%, #0b1f8f 100%);
  color: #FFFFFF;
}

.npd-card .npd-profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.npd-card .npd-avatar-lg {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.npd-card .npd-profile-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.npd-card .npd-profile-id strong {
  font-size: 0.95rem;
  line-height: 1.2;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npd-card .npd-role-pill {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.npd-card .npd-profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
}

.npd-card .npd-profile-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npd-card .npd-online {
  font-size: 0.5rem;
  color: #34D399;
}

.nav-profile-dropdown .npd-item {
  margin: 0 10px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
}

.nav-profile-dropdown .npd-item i {
  font-size: 1rem;
}

.nav-profile-dropdown .npd-item.logout {
  border-top: none;
  margin-bottom: 10px;
  background: rgba(192, 57, 43, 0.07);
}
