
*,
*::before,
*::after {
  box-sizing: border-box;
}

.navbar {
  position: sticky;
  top: 0;
  width: 99.5%;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  z-index: 1000;
}

.navbar__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem var(--container-padding, 1rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar__logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.navbar__title {
  color: var(--color-text-primary);
  font-weight: 700;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.navbar__links>*{
}

.navbar__auth {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-left: .5rem;
}

.navbar__btn {
  display: inline-block;
  padding: .45rem .85rem;
  border-radius: var(--radius-medium);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  background: transparent;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .1s ease;
  text-decoration: none;
}

.navbar__btn:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  
}

.navbar__btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.navbar__btn--primary:hover {
  background: var(--color-background);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-medium);
}

.navbar__link {
  display: inline-block;
  /* padding: 0.5rem 0.8rem; */
  border-radius: var(--radius-medium);
  color: var(--color-text-primary);
}
/* Profile avatar circle */
.navbar__link--profile { padding: 0.25rem 0.25rem; }
.navbar__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 28px;
  block-size: 28px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-soft);
}

/* A11y helper already in footer; duplicate here for isolation */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.navbar__link:hover {
  color: var(--color-primary);
}

/* Active link state (pill highlight) */
.navbar__link.is-active {
  color: var(--color-primary);
  font-weight: 700;
}

.navbar__link.is-active:hover {
}

@media (min-width: 901px) {
  .navbar__link.is-active {
    box-shadow: none;
  }
}

.navbar__cta {
  background: var(--color-primary);
  color: #fff !important;
  box-shadow: var(--shadow-soft);
}

.navbar__cta:hover {
  background: var(--color-secondary);
  box-shadow: var(--shadow-medium);
}

/* Hide arrow row by default (desktop) */
.navbar__arrow-row { display: none; }

/* Toggle (mobile) */
.navbar__toggle {
  display: none;
  width: 40px;
  height: 32px;
  position: relative;
  cursor: pointer;
}

.navbar__toggle span {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 3px;
  background: var(--color-text-primary);
  border-radius: 3px;
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}

.navbar__toggle span:nth-child(1) {
  top: 8px;
}

.navbar__toggle span:nth-child(2) {
  top: 15px;
}

.navbar__toggle span:nth-child(3) {
  top: 22px;
}

.navbar__toggle-checkbox {
  display: none;
}

/* Mobile layout */
@media (max-width: 900px) {
  .navbar__links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    justify-items: stretch;
    /* make items take full width */
    /* border: 3px solid red; */
    /* padding-bottom: 1em; */
    z-index: 1001; /* above overlay */
  }

  /* Screen overlay: blocks background, closes on tap */
  .navbar__overlay {
    display: none;
  }
  .navbar__toggle-checkbox:checked ~ .navbar__overlay {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: 56px; /* only outside the menu bar area */
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: saturate(120%) blur(1px);
    backdrop-filter: saturate(120%) blur(1px);
    z-index: 998; /* under the panel (1001) */
    pointer-events: auto; /* allow clicks to close menu */
  }

  .navbar__toggle {
    display: inline-block;
  }

  .navbar__toggle-checkbox:checked~.navbar__links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .navbar__links li {
    width: 100%;
  }

  .navbar__link {
    display: block;
    width: 100%;
    padding: 0.9rem 0rem;
    border-radius: 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    /* center text */
  }

  /* Dashboard and Logout buttons in mobile - style as buttons, not full-width links */
  .navbar__links form {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
    margin: 0;
  }

  .navbar__links form li {
    width: auto;
    list-style: none;
  }

  .admin_dashboard_option,
  .logout_option {
    display: inline-block;
    width: auto;
    min-width: 120px;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-medium);
    text-align: center;
    border-top: none;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
  }

  .navbar__toggle-checkbox:checked+.navbar__toggle span:nth-child(1) {
    top: 15px;
    transform: rotate(45deg);
  }

  .navbar__toggle-checkbox:checked+.navbar__toggle span:nth-child(2) {
    opacity: 0;
  }

  .navbar__toggle-checkbox:checked+.navbar__toggle span:nth-child(3) {
    top: 15px;
    transform: rotate(-45deg);
  }

  /* Hide desktop auth on mobile; show mobile versions inside menu */
  .navbar__auth {
    display: none;
  }

  .navbar__auth-mobile {
    display: flex;
    width: 50%;
    justify-content: center;
    align-items: center;
  }

  .navbar__auth-mobile .navbar__btn {
    width: 50%;
    margin: .6rem 0 0 0;
    text-align: center;
  }

  /* Arrow row at the end of the menu list */
  .navbar__arrow-row {
    margin-top: 1rem;
    padding: .5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--color-surface), var(--color-background));
    border-top: 1px solid var(--color-border);
    cursor: pointer;
  }

  .navbar__arrow-up {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    color: var(--color-primary);
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    
  }
}

.navbar__link{
  /* border: 3px solid red; */
}

.admin_dashboard_option {
  background: linear-gradient(180deg, var(--color-surface), var(--color-background));
  border-radius: var(--radius-medium);
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .2s;
  position: relative;
  z-index: 1;
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: inline-block;
  overflow: hidden;
  color: var(--color-primary);
}

.admin_dashboard_option:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.logout_option {
  background: linear-gradient(180deg, #ffeded, #ffeaea 90%);
  border-radius: var(--radius-medium);
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .2s, background .2s, color .2s, transform .15s;
  position: relative;
  z-index: 1;
  border: 1px solid #ff3c51;
  cursor: pointer;
  display: inline-block;
  overflow: hidden;
  color: #e60023;
}

.logout_option:hover {
  background: #e60023;
  color: #fff;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 2px 12px 0 #fa19339e;
}