/* Premium mobile header + bottom nav — header+nav.html */
:root {
  --hdr-h: 66px;
  --hn-max-w: 420px;
  --p-deep: #2e0057;
  --p-core: #5b0ea6;
  --p-mid: #7b2cbf;
  --p-bright: #9d4edd;
  --p-light: #c77dff;
  --p-glow: rgba(157, 78, 221, 0.55);
  --glass-border: rgba(199, 125, 255, 0.22);
  --dd-bg: rgba(20, 4, 44, 0.88);
  --dd-hover: rgba(123, 44, 191, 0.55);
  --dd-border: rgba(199, 125, 255, 0.18);
  --dd-sep: rgba(199, 125, 255, 0.12);
  --radius-hdr: 0 0 22px 22px;
  --hn-transition: 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
  --nav-h: 68px;
  --nav-active: #ff2df1;
  --nav-idle: #ffffff;
  --nav-bg: #4600b1;
}

body.hn-theme {
  padding-bottom: calc(var(--nav-h) + 12px) !important;
}

body.hn-theme #appCapsule {
  max-width: var(--hn-max-w);
  padding-top: calc(var(--hdr-h) + 18px) !important;
  padding-bottom: calc(var(--nav-h) + 12px) !important;
}

/* ── HEADER ── */
.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--hn-max-w);
  height: var(--hdr-h);
  z-index: 999;
  background: linear-gradient(135deg, #4b0082 0%, #6a0dad 50%, #7b2cbf 100%);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-radius: var(--radius-hdr);
  border: 1px solid var(--glass-border);
  border-top: none;
  box-shadow:
    0 8px 32px rgba(91, 14, 166, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(199, 125, 255, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
  overflow: visible;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.03) 40%, transparent 60%);
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 14%;
  right: 14%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--p-light), transparent);
  border-radius: 99px;
  opacity: 0.7;
  filter: blur(1px);
}

.hdr-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 18px;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff6bdf 0%, #c77dff 50%, #7b2cbf 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(199, 125, 255, 0.55), 0 0 0 1.5px rgba(255, 255, 255, 0.18) inset;
  position: relative;
  flex-shrink: 0;
  transition: transform var(--hn-transition), box-shadow var(--hn-transition);
  overflow: hidden;
}

.logo-wrap:hover .logo-icon {
  transform: scale(1.07) rotate(-4deg);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-icon i {
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.logo-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background: #00f5a0;
  border-radius: 50%;
  border: 1.5px solid #4b0082;
  box-shadow: 0 0 6px #00f5a080;
  animation: hn-pulse-dot 2.2s ease-in-out infinite;
  z-index: 2;
}

@keyframes hn-pulse-dot {
  0%, 100% { box-shadow: 0 0 6px #00f5a080; }
  50% { box-shadow: 0 0 14px #00f5a0cc; }
}

.site-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(90deg, #fff 20%, #e0b0ff 60%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: hn-shimmer-text 4s linear infinite;
  text-shadow: none;
}

@keyframes hn-shimmer-text {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-btn {
  all: unset;
  cursor: pointer;
  display: block;
  position: relative;
  text-decoration: none;
}

.avatar-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 2.5px;
  background: conic-gradient(from 0deg, #c77dff, #ff6bdf, #7b2cbf, #c77dff);
  box-shadow: 0 0 16px var(--p-glow), 0 2px 8px rgba(0, 0, 0, 0.4);
  animation: hn-spin-ring 5s linear infinite;
  transition: box-shadow var(--hn-transition), transform var(--hn-transition);
}

.avatar-btn:hover .avatar-ring,
.avatar-btn:focus-visible .avatar-ring {
  box-shadow: 0 0 28px var(--p-glow), 0 2px 12px rgba(0, 0, 0, 0.5);
  transform: scale(1.06);
}

@keyframes hn-spin-ring {
  to { filter: hue-rotate(360deg); }
}

.avatar-btn.ripple::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(199, 125, 255, 0.28);
  animation: hn-ripple-out 0.55s ease-out forwards;
}

@keyframes hn-ripple-out {
  from { opacity: 1; transform: scale(0.7); }
  to { opacity: 0; transform: scale(1.6); }
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: #7b2cbf;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7b2cbf;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-size: 16px;
}

.hn-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  min-width: 210px;
  background: var(--dd-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--dd-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(91, 14, 166, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.26s cubic-bezier(0.34, 1.2, 0.64, 1), transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.hn-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hn-dropdown::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 14px;
  width: 14px;
  height: 14px;
  background: var(--dd-bg);
  border-left: 1px solid var(--dd-border);
  border-top: 1px solid var(--dd-border);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.dd-head {
  padding: 14px 18px 12px;
  background: linear-gradient(135deg, rgba(123, 44, 191, 0.35) 0%, rgba(46, 0, 87, 0.25) 100%);
  border-bottom: 1px solid var(--dd-sep);
  display: flex;
  align-items: center;
  gap: 11px;
}

.dd-head-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(199, 125, 255, 0.5);
  box-shadow: 0 0 10px rgba(199, 125, 255, 0.35);
  flex-shrink: 0;
  background: #7b2cbf;
}

.dd-head-info {
  overflow: hidden;
  min-width: 0;
}

.dd-head-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-head-role {
  font-size: 10px;
  font-weight: 500;
  color: var(--p-light);
  letter-spacing: 0.6px;
  margin-top: 1px;
}

.dd-menu {
  padding: 8px 0;
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 18px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background 0.18s, color 0.18s, padding-left 0.22s;
  border: none;
  background: transparent;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.1px;
}

.dd-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--p-bright), transparent);
  opacity: 0.7;
  transition: width 0.22s ease;
  border-radius: 0 4px 4px 0;
}

.dd-item:hover {
  background: var(--dd-hover);
  color: #fff;
  padding-left: 22px;
}

.dd-item:hover::before {
  width: 3px;
}

.dd-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(123, 44, 191, 0.35);
  border: 1px solid rgba(199, 125, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s, transform 0.18s;
}

.dd-item:hover .dd-icon-wrap {
  background: rgba(157, 78, 221, 0.55);
  transform: scale(1.1);
}

.dd-icon-wrap i {
  font-size: 12px;
  color: var(--p-light);
}

.dd-sep-line {
  height: 1px;
  margin: 4px 14px;
  background: var(--dd-sep);
}

.dd-item.logout {
  color: rgba(255, 120, 120, 0.9);
}

.dd-item.logout .dd-icon-wrap {
  background: rgba(255, 80, 80, 0.15);
  border-color: rgba(255, 100, 100, 0.2);
}

.dd-item.logout .dd-icon-wrap i {
  color: #ff8a8a;
}

.dd-item.logout:hover {
  background: rgba(200, 40, 40, 0.25);
  color: #ffaaaa;
}

/* ── BOTTOM NAV ── */
#appBottomNav.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 100%;
  max-width: var(--hn-max-w);
  height: var(--nav-h);
  z-index: 998;
  background: var(--nav-bg);
  border-top: 1px solid rgba(199, 125, 255, 0.13);
  border-radius: 22px 22px 0 0;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(255, 255, 255, 0.04) inset;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#appBottomNav.bottom-nav.is-hidden {
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  pointer-events: none;
}

#appBottomNav.bottom-nav::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(199, 125, 255, 0.45), transparent);
  border-radius: 99px;
  pointer-events: none;
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  padding: 10px 2px 8px;
  cursor: pointer;
  position: relative;
  border: none;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
  text-decoration: none;
  color: inherit;
}

.bottom-nav .nav-item:active {
  transform: scale(0.9);
}

.bottom-nav .nav-icon {
  font-size: 20px;
  color: var(--nav-idle);
  transition: color 0.22s ease, transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), filter 0.22s ease;
  line-height: 1;
}

.bottom-nav .nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--nav-idle);
  transition: color 0.22s ease;
  line-height: 1;
}

.bottom-nav .nav-item.active .nav-icon {
  color: var(--nav-active);
  transform: translateY(-3px) scale(1.18);
  filter: drop-shadow(0 0 8px rgba(255, 45, 138, 0.75));
}

.bottom-nav .nav-item.active .nav-label {
  color: var(--nav-active);
}

.bottom-nav .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, #ff6bdf, #ff2d8a);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 10px rgba(255, 45, 138, 0.7);
  animation: hn-pip-in 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

@keyframes hn-pip-in {
  from { width: 0; opacity: 0; }
  to { width: 28px; opacity: 1; }
}

.bottom-nav .nav-ripple {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 45, 138, 0.18);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: hn-nav-ripple 0.5s ease-out forwards;
}

@keyframes hn-nav-ripple {
  to { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

@media (hover: hover) {
  .bottom-nav .nav-item:not(.active):hover .nav-icon {
    color: rgba(199, 125, 255, 0.7);
    transform: translateY(-2px);
  }
  .bottom-nav .nav-item:not(.active):hover .nav-label {
    color: rgba(199, 125, 255, 0.65);
  }
}

@media (min-width: 421px) {
  .site-header {
    border-radius: var(--radius-hdr);
  }
}

/* Dark/light body backgrounds — see global_dark_theme.css */
