/* Shared Client top navigation — the single standard navbar across all Client pages.
   Visual theming (colors, dark mode) lives in client-redesign.css; this file owns
   the structural layout so every page's navbar is identical. */

.site-navbar {
  position: sticky;
  top: 12px;
  z-index: 1000;
  width: min(calc(100vw - 24px), 1600px);
  max-width: calc(100vw - 24px);
  margin: 12px auto 0;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.site-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: nowrap;
  padding: 8px 16px;
}

.site-nav-content {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.site-brand {
  flex: 0 0 auto;
}

.site-brand img {
  height: 52px;
  width: auto;
}

.site-nav-links,
.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.site-nav-actions {
  justify-content: flex-end;
}

/* Utility controls must never collapse into or underneath one another. */
.site-nav-actions > *,
.site-nav-context > * {
  flex: 0 0 auto;
}

.site-nav-context {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav-wallet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 10px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.92);
  color: #1d4ed8;
  line-height: 1.05;
  white-space: nowrap;
  text-decoration: none;
}

.site-nav-wallet[hidden] { display: none !important; }
.site-nav-wallet:hover { background: rgba(219, 234, 254, 0.95); color: #1e40af; text-decoration: none; }
.site-nav-wallet > i { font-size: 15px; }
.site-nav-wallet__text { display: flex; flex-direction: column; }
.site-nav-wallet__label { color: #64748b; font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.site-nav-wallet strong { font-size: 12px; font-weight: 700; }

.site-nav-user {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 38px;
  padding: 5px 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.92);
  color: #172033;
  line-height: 1.1;
  white-space: nowrap;
}

.site-nav-user__label {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-nav-user-name {
  max-width: 150px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
}

.site-nav-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.site-nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: #1e293b;
}

/* Higher specificity than ui-preferences' .site-nav-link so the navbar stays
   compact on one line (the 20px content scale would otherwise wrap it). */
.site-navbar .site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 999px;
  color: #334155;
  font-weight: 600;
  font-size: 14px !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-navbar .btn-back {
  font-size: 14px !important;
  padding: 8px 12px;
  white-space: nowrap;
}

.site-nav-link:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #0f172a;
  text-decoration: none;
}

.site-nav-link.is-current {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.nav-preferences-item {
  display: flex;
  align-items: center;
}

.nav-preferences-item .daia-ui-switcher-host {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* Compact the inline theme/language switcher so the navbar fits one line. */
.site-navbar .daia-ui-switcher--inline .daia-ui-switcher__controls {
  gap: 6px;
}
.site-navbar .daia-ui-switcher--inline .daia-ui-switcher__row {
  width: auto;
}
.site-navbar .daia-ui-switcher--inline .daia-ui-switcher__button,
.site-navbar .daia-ui-switcher--inline .daia-ui-switcher__select {
  min-height: 32px !important;
  font-size: 13px !important;
  border-radius: 9px;
}
.site-navbar .daia-ui-switcher--inline .daia-ui-switcher__select {
  min-width: 104px;
  max-width: 118px;
  padding: 0 8px;
}
.site-navbar .daia-ui-switcher--inline .daia-ui-switcher__label {
  font-size: 13px !important;
  white-space: nowrap;
}

/* The navbar context is already obvious; hide repeated headings to keep it compact. */
.site-navbar .daia-ui-switcher__title,
.site-navbar .daia-ui-switcher__label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #5866e9 0%, #4a5fd8 100%);
  color: white !important;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(88, 102, 233, 0.28);
}

.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
  text-decoration: none;
  color: white !important;
}

/* Malay/Chinese labels and the wallet chip need more horizontal room. At
   narrower desktop widths use the expandable layout before controls overlap. */
@media (max-width: 1650px) {
  .site-navbar {
    top: 6px;
    width: calc(100% - 16px);
    margin-top: 6px;
  }

  .site-navbar__inner {
    flex-wrap: wrap;
    padding: 8px 10px;
  }

  .site-nav-toggle {
    display: block;
    margin-left: auto;
  }

  .site-nav-content {
    display: none;
    flex: 1 0 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 4px;
  }

  .site-navbar.is-open .site-nav-content {
    display: flex;
  }

  .site-nav-links,
  .site-nav-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-navbar .site-nav-link {
    flex: 1 1 125px;
  }

  .site-nav-actions {
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
  }
}

@media (max-width: 620px) {
  .site-brand img { height: 42px; }
  .site-nav-links { display: grid; grid-template-columns: 1fr 1fr; }
  .site-navbar .site-nav-link { width: 100%; }
  .site-nav-actions { flex-direction: column; align-items: stretch; }
  .site-nav-context,
  .site-nav-actions .nav-preferences-item { justify-content: center; }
  .site-nav-user { align-items: center; }
  .site-navbar .btn-back { justify-content: center; }
}

html[data-theme="dark"] .site-navbar {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.96);
}

html[data-theme="dark"] .site-navbar .site-nav-link,
html[data-theme="dark"] .site-nav-user,
html[data-theme="dark"] .site-nav-wallet {
  color: #e5e7eb;
}

html[data-theme="dark"] .site-nav-user,
html[data-theme="dark"] .site-nav-toggle,
html[data-theme="dark"] .site-nav-wallet {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.96);
}

html[data-theme="dark"] .site-nav-toggle span { background: #e5e7eb; }

/* Home / Back-To-Home nav removed across client pages (home is now the Auction Events page). */
.js-nav-home, .js-nav-home2 { display: none !important; }
