/* ============================================================================
   AETHERION LABS — Platform app shell
   Extends aetherion.css for logged-in pages: nav, user menu, backgrounds.
   ========================================================================== */

/* App page background */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 75% -10%, rgba(201,169,97,0.06), transparent 60%),
    radial-gradient(900px 700px at 10% 100%, rgba(98,214,162,0.04), transparent 55%),
    linear-gradient(180deg, #08080d 0%, #060609 45%, #050507 100%);
}

/* ── App nav overrides (sticky, gold accents) ─────────────────────────── */
.nav[data-layout-v4] {
  position: sticky;
  top: 0;
  height: 70px;
  min-height: 70px;
  display: flex;
  align-items: center;
  background: rgba(6, 6, 11, 0.82);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: none;
  animation: navSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nav[data-layout-v4]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 169, 97, 0.12) 20%,
    rgba(201, 169, 97, 0.35) 50%,
    rgba(201, 169, 97, 0.12) 80%,
    transparent 100%
  );
  pointer-events: none;
}

@keyframes navSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav[data-layout-v4] .nav-inner {
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  height: 100%;
}

.nav[data-layout-v4] .nav-left {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  min-width: 0;
}

.nav[data-layout-v4] .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--t1);
  font-size: 17.5px;
  white-space: nowrap;
  text-decoration: none;
  padding-right: 20px;
  margin-right: 4px;
  flex-shrink: 0;
  position: relative;
  transition: opacity 0.2s ease;
}

.nav[data-layout-v4] .brand:hover { opacity: 0.8; }

.nav[data-layout-v4] .brand::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.07);
}

.nav[data-layout-v4] .brand-mark {
  height: 34px;
  width: 34px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(201,169,97,0.25));
}

.nav[data-layout-v4] .brand .brand-name { display: none; }

.nav[data-layout-v4] .nav-menus {
  display: flex;
  align-items: center;
  padding-left: 8px;
  min-width: 0;
  flex: 1;
}

.nav[data-layout-v4] .nav-divider {
  display: inline-block;
  width: 1px;
  height: 20px;
  margin: 0 8px 0 4px;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
  align-self: center;
  border-radius: 1px;
}

.nav[data-layout-v4] .nav-tools {
  display: flex;
  align-items: center;
  margin-right: 4px;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.nav[data-layout-v4] .nav-link--locked,
.nav[data-layout-v4] .nav-tools a.nav-link--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav[data-layout-v4] .navtabs,
.nav[data-layout-v4] .navtabs-primary {
  height: auto;
  flex-wrap: nowrap;
  padding-left: 8px;
}

.nav[data-layout-v4] .navtabs a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav[data-layout-v4] a.nav-help {
  margin-right: 8px;
}

.nav[data-layout-v4] .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav[data-layout-v4] .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a3528, #1a1810);
  border: 1.5px solid rgba(201, 169, 97, 0.22);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--gold-200);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav[data-layout-v4] .avatar:hover {
  border-color: rgba(201, 169, 97, 0.5);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1), 0 0 12px rgba(201, 169, 97, 0.12);
  transform: scale(1.05);
}

/* ── User dropdown ─────────────────────────────────────────────────────── */
.nav-user-wrap { position: relative; }

#nav-avatar {
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

#nav-avatar:hover {
  opacity: 0.9;
  box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.4);
}

#nav-avatar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.6);
}

.nav-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--hair-2);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 8px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.nav-user-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.num-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  cursor: default;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.num-avatar-lg {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5a5038, #2a2418);
  border: 1px solid rgba(201, 169, 97, 0.22);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  flex-shrink: 0;
}

.num-identity { min-width: 0; }

.num-display-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.num-email {
  font-size: 12px;
  color: var(--t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.num-tier {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pos);
  margin-top: 4px;
}

.num-tier--none {
  color: var(--t3);
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 400;
}

.num-divider {
  height: 1px;
  background: var(--hair);
  margin: 6px 0;
}

.num-divider--spaced {
  margin: 10px 0;
  background: var(--hair-2);
}

.num-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px 9px 14px;
  border-radius: 9px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--t2);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.12s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.num-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--t1);
}

.num-item--danger:hover {
  background: rgba(240, 128, 154, 0.12);
  color: var(--neg);
}

.num-item--admin { color: var(--t3); }

.num-item--admin:hover {
  background: rgba(201, 169, 97, 0.1);
  color: var(--t1);
}

.num-item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.num-item--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

#nav-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1;
}

.nui-name {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-200);
  white-space: nowrap;
}

.nui-clock {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t3);
  white-space: nowrap;
}

/* ── Help pages ────────────────────────────────────────────────────────── */
.help-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}

.help-sidebar-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 16px;
}

.help-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--t2);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.help-nav a:hover,
.help-nav a.active {
  background: rgba(201, 169, 97, 0.08);
  color: var(--t1);
}

.help-article {
  color: var(--t2);
  line-height: 1.7;
  font-size: 16px;
}

.help-article h1,
.help-article h2,
.help-article h3 {
  font-family: var(--serif);
  color: var(--t1);
  margin: 1.5em 0 0.5em;
}

.help-article h1 { font-size: 2rem; }
.help-article h2 { font-size: 1.5rem; }
.help-article a { color: var(--gold-200); }
.help-article code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel-2);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .help-layout { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .nav[data-layout-v4],
  .nav[data-layout-v4] .navtabs a,
  .nav[data-layout-v4] .avatar {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
