/* ============================================================
   App shell - top navbar and category bar
   ------------------------------------------------------------
   Brings the two bars that frame every page onto the same palette as the
   binary plan screens: navy #16235c with the gold #f7a839 accent, and the
   same soft-tile card treatment.

   LOAD ORDER: linked LAST in base.html, after responsive.css. It has to beat
   base.html's own inline <style> (which sets the older #0f172a / #d4af37
   values) and responsive.css's .jh-nav-link padding. It deliberately does NOT
   touch .jh-navbar > .container-fluid, so responsive.css keeps ownership of
   the desktop content width.

   Category-bar rules are prefixed #menu-bar on purpose: menu.html ships its
   own <style> inside the BODY, so it comes after this file in document order
   and would win any tie at equal specificity. The id settles it.

   Remember: manage.py collectstatic, or the server keeps serving the old file.
   ============================================================ */

:root {
  --jh-navy: #16235c;
  --jh-navy-2: #1c2b6b;
  --jh-gold: #f7a839;
  --jh-navbar-bg: #16235c;
  --jh-accent-color: #f7a839;
}

/* ------------------------------------------------------------- top navbar - */

.jh-navbar {
  background: linear-gradient(135deg, var(--jh-navy-2), var(--jh-navy)) !important;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .18);
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Avatar reads as the account marker, so it gets the accent ring. */
.jh-avatar,
.jh-avatar-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--jh-gold);
  box-shadow: 0 2px 10px rgba(247, 168, 57, .28);
}

.jh-avatar { object-fit: cover; }

.jh-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--jh-gold);
  color: var(--jh-navy);
  font-weight: 800;
  font-size: 17px;
}

.username-txt {
  font-weight: 700;
  letter-spacing: -.1px;
  line-height: 1.15;
}

.userid-txt {
  color: rgba(255, 255, 255, .6) !important;
  font-size: 11px;
  letter-spacing: .2px;
}

/* Action icons become pill buttons so they read as targets, not decoration. */
.jh-nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px !important;
  margin-left: 4px;
  border-radius: 12px;
  color: #fff !important;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.jh-nav-link:hover,
.jh-nav-link:focus-visible {
  background: rgba(255, 255, 255, .10);
  color: var(--jh-gold) !important;
  transform: translateY(-1px);
}

.jh-nav-link i { font-size: 19px; line-height: 1; }

.jh-nav-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  opacity: .82;
}

.jh-badge-circle {
  position: absolute;
  top: 0;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e02424;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  border: 2px solid var(--jh-navy);
}

/* The hamburger sits next to the avatar - give it the same tap target. */
.jh-navbar .btn-link {
  border-radius: 10px;
  padding: 6px 9px !important;
  transition: background .18s ease;
}

.jh-navbar .btn-link:hover { background: rgba(255, 255, 255, .10); }


/* --------------------------------------------------------- category bar - */

#menu-bar {
  gap: 6px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e8ebf3;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
  border-radius: 0;
}

#menu-bar .nav-item-link {
  padding: 0;
  border-radius: 16px;
}

/* Each category is a tile, matching the binary services grid. */
#menu-bar .nav-item-box {
  width: auto;
  min-width: 78px;
  gap: 7px;
  padding: 9px 8px 8px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

#menu-bar .nav-item-link:hover .nav-item-box {
  background: #f7f9fc;
  border-color: #e3e8f2;
  transform: translateY(-2px);
}

#menu-bar .icon-wrapp,
#menu-bar .icon-wrappers1 {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #eef1fa;
  border: 1px solid #e3e8f2;
  color: var(--jh-navy);
  box-shadow: none;
  padding: 0;
  overflow: hidden;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

#menu-bar .nav-icon-img {
  width: 26px;
  height: 26px;
  border-radius: 0;
  object-fit: contain;
}

/* Shown only when the <img> fails - these come from the API and a broken one
   used to render as clipped alt text inside the circle. */
#menu-bar .nav-icon-fallback {
  display: none;
  font-size: 16px;
  font-weight: 800;
  color: var(--jh-navy);
}

#menu-bar .is-fallback .nav-icon-fallback { display: block; }

#menu-bar .nav-item-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0;
}

/* Active: filled navy tile, gold label, and a gold rail under the item -
   the same "you are here" language the binary tabs use. */
#menu-bar .nav-item-link.active .nav-item-box {
  background: #f4f6fc;
  border-color: #dfe4f2;
  position: relative;
}

#menu-bar .nav-item-link.active .icon-wrapp,
#menu-bar .nav-item-link.active .icon-wrappers1 {
  background: linear-gradient(135deg, var(--jh-navy-2), var(--jh-navy));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(22, 35, 92, .28);
}

#menu-bar .nav-item-link.active .nav-icon-fallback { color: #fff; }

#menu-bar .nav-item-link.active .nav-item-name {
  color: var(--jh-navy);
}

#menu-bar .nav-item-link.active .nav-item-box::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--jh-gold);
}

@media (min-width: 992px) {
  #menu-bar {
    justify-content: center;
    gap: 10px;
    padding: 12px;
  }

  #menu-bar .nav-item-box { min-width: 92px; }

  #menu-bar .icon-wrapp,
  #menu-bar .icon-wrappers1 { width: 52px; height: 52px; border-radius: 16px; }

  #menu-bar .nav-icon-img { width: 30px; height: 30px; }
  #menu-bar .nav-item-name { font-size: 12.5px; }
}


/* Caption that replaced the cashback card's Add Money button. Base styling -
   responsive.css re-places it beside the figure on wide screens. */
.wallet .wallet-note {
  display: block;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .72);
}
