/* ===== TOP NAVBAR ===== */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #1e3a8a; /* deep blue */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: white;
  z-index: 1000;
}

/* Left side */
.nav-left .greeting {
  font-size: 16px;
  font-weight: 500;
}

/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-right a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.nav-right a:hover {
  text-decoration: underline;
}

/* Logout button */
.logout-btn {
  background-color: #dc2626; /* red */
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.logout-btn:hover {
  background-color: #b91c1c;
}

/* ===== PAGE OFFSET (IMPORTANT) ===== 
body {
  padding-top: 10px; /* space for fixed navbar
}
*/

/* Apply only to pages that contain the fixed logged-in navbar */
body.has-top-navbar {
  padding-top: 76px; /* 56px navbar + 20px breathing space */
}

.top-navbar {
  box-sizing: border-box;
}

/* Mobile navbar: greeting first, navigation links below */
@media (max-width: 760px) {
  .top-navbar {
    height: 96px !important;
    padding: 10px 16px !important;
    display: flex;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 10px;
    overflow: visible;
    box-sizing: border-box;
  }

  .top-navbar .nav-left {
    width: 100%;
  }

  .top-navbar .nav-left .greeting {
    font-size: 13px;
    line-height: 20px;
    color: white;
  }

  .top-navbar .nav-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
    gap: 10px;
    margin: 0;
  }

  .top-navbar .nav-right a {
    color: white;
    font-size: 12px;
    white-space: nowrap;
  }

  .top-navbar .logout-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* Override the 56px offset inside dashboard/membership HTML */
  body.has-top-navbar {
    padding-top: 96px !important;
  }
}

/* Dropdown links need dark text on their white background */
.top-navbar .nav-right .dropdown-menu a,
.top-navbar .nav-right .dropdown-content a {
  color: #182a40 !important;
  display: block;
  padding: 10px 14px;
  text-decoration: none;
}

.top-navbar .nav-right .dropdown-menu a:hover,
.top-navbar .nav-right .dropdown-content a:hover {
  background-color: #edf2fc;
  color: #244d9b !important;
}