/* HeliEx header (all exchange pages). Loaded after styles.css and overrides its
   older .top-nav / header rules. Same look and wording as the heliex.net swap
   page: Swap, Markets, Faucet & rain | theme, bell, Account (or Log in,
   Create account). nav.js adds html.nav-js and drives the menus; without it
   every link simply stays visible. */
:root {
  --nav-link: #b3c5d9;
  --nav-link-hover: #effaff;
  --nav-hover-bg: #162638;
  --nav-current: #95e0ed;
  --nav-current-bg: #142b36;
  --nav-current-border: #315565;
  --nav-cta: #b2edf0;
  --nav-cta-bg: #14343e;
  --nav-cta-border: #3a6470;
  --nav-menu-bg: #102033;
  --nav-menu-border: #36506a;
  --nav-menu-text: #c6d9e9;
  --nav-menu-hover: #1b344b;
  --nav-divider: #223348;
  --nav-shadow: 0 16px 38px rgba(0, 0, 0, 0.45);
}
body.theme-light {
  --nav-link: #34465c;
  --nav-link-hover: #0f1b2a;
  --nav-hover-bg: #dde6f0;
  --nav-current: #0b6475;
  --nav-current-bg: #dcf1f4;
  --nav-current-border: #93cbd5;
  --nav-cta: #0b5c68;
  --nav-cta-bg: #d6eff2;
  --nav-cta-border: #86c3cc;
  --nav-menu-bg: #f7f9fc;
  --nav-menu-border: #b8c4d6;
  --nav-menu-text: #1f2d3d;
  --nav-menu-hover: #e3eaf3;
  --nav-divider: #c5d0de;
  --nav-shadow: 0 16px 38px rgba(27, 36, 48, 0.18);
}

/* Bar */
.hx-header {
  display: block;
  position: relative;
  z-index: 60;
  padding: 10px 24px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--nav-divider);
}
.hx-header .header-box {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px;
  min-height: 52px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.hx-header .brand-link {
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
}
.hx-header .brand-logo { height: 40px; }
.hx-header .brand-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.top-nav.hx-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: none;
  border: 0;
  position: static;
}
body.is-admin .top-nav.hx-nav { flex-wrap: nowrap; overflow: visible; }
.top-nav.hx-nav .nav-primary { display: flex; align-items: center; gap: 4px; min-width: 0; }
.top-nav.hx-nav .nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }

/* Text links (swap-page style) */
.top-nav.hx-nav .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--nav-link);
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
}
.top-nav.hx-nav .nav-link:hover { color: var(--nav-link-hover); background: var(--nav-hover-bg); text-decoration: none; }
.top-nav.hx-nav .nav-link[aria-current="page"] {
  color: var(--nav-current);
  border-color: var(--nav-current-border);
  background: var(--nav-current-bg);
}
.top-nav.hx-nav .nav-link.nav-signup { color: var(--nav-cta); border-color: var(--nav-cta-border); background: var(--nav-cta-bg); }
.top-nav.hx-nav .nav-link.nav-signup:hover { color: var(--nav-link-hover); border-color: var(--nav-current-border); }
.top-nav.hx-nav .nav-panel-only { display: none; }

/* Icon buttons: theme, bell, menu */
.top-nav.hx-nav .nav-icon-btn,
.top-nav.hx-nav .notif-wrapper .notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  color: var(--nav-link);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
}
.top-nav.hx-nav .nav-icon-btn:hover,
.top-nav.hx-nav .notif-wrapper .notif-bell:hover,
.top-nav.hx-nav .notif-wrapper.open .notif-bell,
.top-nav.hx-nav .nav-menu-toggle[aria-expanded="true"] {
  color: var(--nav-link-hover);
  background: var(--nav-hover-bg);
}
.top-nav.hx-nav .nav-icon-btn svg,
.top-nav.hx-nav .notif-bell svg { width: 20px; height: 20px; display: block; }
.top-nav.hx-nav .theme-toggle .icon-moon { display: none; }
body.theme-light .top-nav.hx-nav .theme-toggle .icon-moon { display: block; }
body.theme-light .top-nav.hx-nav .theme-toggle .icon-sun { display: none; }
.top-nav.hx-nav .notif-badge { top: 3px; right: 2px; }
.top-nav.hx-nav .nav-menu-toggle { display: none; }
.top-nav.hx-nav .nav-menu-toggle .icon-close { display: none; }
.top-nav.hx-nav .nav-menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.top-nav.hx-nav .nav-menu-toggle[aria-expanded="true"] .icon-menu { display: none; }

/* Bell (styles.css offsets the old phone bell with top/right: undo that here) */
.top-nav.hx-nav .notif-wrapper { position: relative; top: auto; right: auto; left: auto; margin: 0; flex: 0 0 auto; }

/* Account menu */
.top-nav.hx-nav .nav-account { position: relative; display: none; flex: 0 0 auto; }
body.authed .top-nav.hx-nav .nav-account { display: inline-flex; }
body.authed .top-nav.hx-nav .nav-guest { display: none; }
.top-nav.hx-nav .nav-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px 8px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--nav-link-hover);
  background: var(--nav-hover-bg);
  border: 1px solid var(--nav-menu-border);
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}
.top-nav.hx-nav .nav-account-toggle:hover,
.top-nav.hx-nav .nav-account-toggle[aria-expanded="true"] { border-color: var(--nav-current-border); color: var(--nav-current); }
.top-nav.hx-nav .nav-account-toggle svg { width: 18px; height: 18px; flex: 0 0 auto; }
.top-nav.hx-nav .nav-account-toggle .nav-chevron { width: 14px; height: 14px; transition: transform 0.15s ease; }
.top-nav.hx-nav .nav-account-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

.top-nav.hx-nav .nav-account-menu {
  position: absolute;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px;
  background: var(--nav-menu-bg);
  border: 1px solid var(--nav-menu-border);
  border-radius: 12px;
  box-shadow: var(--nav-shadow);
}
.top-nav.hx-nav .nav-account-menu { right: 0; top: calc(100% + 8px); width: 232px; }
.top-nav.hx-nav .nav-account-menu[hidden] { display: none; }
.top-nav.hx-nav .nav-account-menu a,
.top-nav.hx-nav .nav-account-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--nav-menu-text);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.top-nav.hx-nav .nav-account-menu a:hover,
.top-nav.hx-nav .nav-account-menu button:hover,
.top-nav.hx-nav .nav-account-menu a[aria-current="page"] { background: var(--nav-menu-hover); color: var(--nav-link-hover); }
.top-nav.hx-nav .nav-account-menu .nav-admin-link { color: var(--nav-current); }
.top-nav.hx-nav .nav-menu-sep { height: 1px; margin: 4px 6px; background: var(--nav-divider); }

.top-nav.hx-nav a:focus-visible,
.top-nav.hx-nav button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tablet and phone: primary links fold into the menu button. */
@media (max-width: 900px) {
  .hx-header { padding: 8px 16px; }
  .hx-header .header-box { gap: 12px; }
  .hx-header .brand-logo { height: 36px; }
  html.nav-js .top-nav.hx-nav .nav-menu-toggle { display: inline-flex; }
  html.nav-js .top-nav.hx-nav .nav-primary.nav-panel {
    position: absolute;
    z-index: 120;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    background: var(--nav-menu-bg);
    border: 1px solid var(--nav-menu-border);
    border-radius: 12px;
    box-shadow: var(--nav-shadow);
    top: calc(100% + 9px);
    right: 0;
    width: min(300px, 100%);
  }
  html.nav-js .top-nav.hx-nav .nav-primary.nav-panel.is-open { display: flex; }
  html.nav-js .top-nav.hx-nav .nav-primary .nav-link {
    justify-content: flex-start;
    width: 100%;
    padding: 11px 12px;
  }
  html:not(.nav-js) .top-nav.hx-nav { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .hx-header { padding: 8px 12px; }
  .hx-header .header-box { gap: 8px; min-height: 48px; }
  .hx-header .brand-logo { height: 32px; }
  .top-nav.hx-nav .nav-actions { gap: 2px; }
  .top-nav.hx-nav .nav-link { padding: 10px; }
  html.nav-js .top-nav.hx-nav .nav-primary.nav-panel { left: 0; right: 0; width: auto; }
  html.nav-js .top-nav.hx-nav .nav-wide-only { display: none; }
  html.nav-js .top-nav.hx-nav .nav-primary .nav-panel-only { display: flex; margin-top: 4px; justify-content: center; }
  body.authed .top-nav.hx-nav .nav-primary .nav-panel-only { display: none; }
  .top-nav.hx-nav .nav-account { position: static; }
  /* Phone: the account button matches the sun/bell/menu icon buttons (no box, 20px icon). */
  .top-nav.hx-nav .nav-account-toggle { width: 44px; padding: 0; justify-content: center; color: var(--nav-link); background: transparent; border-color: transparent; }
  .top-nav.hx-nav .nav-account-toggle:hover,
  .top-nav.hx-nav .nav-account-toggle[aria-expanded="true"] { color: var(--nav-link-hover); background: var(--nav-hover-bg); border-color: transparent; }
  .top-nav.hx-nav .nav-account-toggle svg { width: 20px; height: 20px; }
  .top-nav.hx-nav .nav-account-toggle .nav-account-label,
  .top-nav.hx-nav .nav-account-toggle .nav-chevron { display: none; }
  .top-nav.hx-nav .nav-account-menu { left: 0; right: 0; width: auto; top: calc(100% + 9px); }
  .top-nav.hx-nav .notif-wrapper { position: static; }
  .top-nav.hx-nav .notif-dropdown {
    left: 0;
    right: 0;
    top: calc(100% + 9px);
    width: auto;
    min-width: 0;
    max-width: none;
  }
}
@media (max-width: 360px) {
  .hx-header .brand-logo { height: 28px; }
  .top-nav.hx-nav .nav-login { padding: 10px 8px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .top-nav.hx-nav .nav-account-toggle .nav-chevron { transition: none; }
}
