#nav{
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 55px;
  width: 100%;
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding-left: 10px;
  padding-right: 10px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}

#nav #logo{
  background-image: url("/server-icon.png");
  width: 32px;
  height: 32px;
  background-position: center;
  background-size: cover;
}

#nav #title{ font-weight: 700; font-size: 22px; }

#nav #main-link{
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: row;
  gap: 5px;
}

#nav .nav-links{ margin-left: 10px; display: flex; gap: 12px; }
#nav .nav-actions{ margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Compact icon button for navbar (e.g., Messages) */
.btn-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background-color .22s ease, border-color .22s ease, color .22s ease;
  box-shadow: inset 0px 0px 5px black;
}
.btn-icon:hover{ background: #111a2b; border-color: var(--primary-400); }

/* Messages badge positioning */
#nav #nav-dm-btn{ position: relative; }
#nav #nav-dm-btn .badge{
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary-400);
  color: #fff;
  border: 0;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 5px;
  font-size: 11px;
  display: none;
  border-radius: 999px;
  box-shadow: inset 0px 0px 5px black;
}

.avatar{ text-decoration: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text); }
.username{ max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 520px){ .hide-sm{ display: none; } .username{ display:none; } }

/* Nav links now use .btn classes; no extra styling needed */

/* Vertically align content in the profile button */
#nav #nav-profile{
  display: inline-flex;
  align-items: center;
}
#nav #nav-profile .username{
  line-height: 1;
  display: inline-block;
}
/* Make avatar inside the profile button blend with button styling */
#nav #nav-profile .avatar{
  border-color: transparent;
  background: transparent;
}
