html {
  scrollbar-gutter: stable;
}

header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #020617;
  border-bottom: 1px solid #1e293b;
  z-index: 1000;
}

header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  width: 100vw;
  height: 100%;
  background-color: #020617;
  border-bottom: 1px solid #1e293b;
  pointer-events: none;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5625rem 2rem;
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

header#top-nav .logo {
  font-size: 1.4rem;
  font-weight: bold;
  color: #38bdf8;
  text-decoration: none;
}

header#top-nav nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 420px;
  min-width: 0;
  flex-wrap: wrap;
}

#auth-area {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex: 0 0 auto;
  align-self: flex-start;
}

header#top-nav nav a {
  text-decoration: none;
  color: #e2e8f0;
}

.profile-menu {
  position: relative;
}

header#top-nav .profile-trigger {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}

header#top-nav .profile-trigger:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.avatar-img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #38bdf8;
  color: #020617;
  font-weight: 700;
}

.profile-name {
  color: white;
  font-size: .9rem;
}

.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: .5rem;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: .6rem .8rem;
  color: #e2e8f0;
  background: none;
  border: none;
  text-align: left;
}

.dropdown.open {
  display: block;
}

.dropdown-item.logout {
  color: #f87171;
}

.notif-bell {
  cursor: pointer;
  margin-left: 12px;
}

.notif-panel {
  position: absolute;
  right: 20px;
  top: 60px;
  width: 260px;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  z-index: 999;
}

.notif-panel.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.notif-count {
  background: red;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  margin-left: 4px;
}

.notif-unread {
  font-weight: bold;
  background: rgba(255,255,255,0.05);
}

.tabs button:hover {
  background: #0f172a;
}

@media (max-width: 720px) {
  header {
    position: sticky;
  }

  .nav-container {
    padding: 0.5625rem var(--page-gutter, 1rem);
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  header#top-nav nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .logo {
    order: 1;
  }

  #auth-area {
    order: 2;
    margin-left: auto;
    align-self: flex-start;
  }

  header#top-nav nav {
    order: 3;
    flex-basis: 100%;
  }


  .notif-panel {
    position: fixed;
    top: auto;
    right: var(--page-gutter, 1rem);
    left: var(--page-gutter, 1rem);
    width: auto;
  }
}
