/* css/nexus-nav.css - Nexus Alpha 6.8 shell, fixed mobile menu + bottom nav */

:root{
  --nx-header-h: 64px;
  --nx-footer-h: 98px;
  --nx-app-vh: 100dvh;
  --nx-shell-top: var(--nx-header-h);
  --nx-shell-bottom: var(--nx-footer-h);
}

html, body {
  background: #000;
  color: #f5f5f5;
  min-height: 100%;
  overflow-x: hidden;
}

.nx-topbar {
  box-sizing: border-box;
  padding: env(safe-area-inset-top) 14px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #000;
  background-image: none;
  border-bottom: 2px solid #0c3c14;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  overflow: visible;
}

/* Reserve space so content never scrolls under the fixed header */
body.nx-app-shell {
  padding-top: var(--nx-shell-top, var(--nx-header-h, calc(52px + env(safe-area-inset-top))));
  padding-bottom: var(--nx-shell-bottom, var(--nx-footer-h, calc(98px + env(safe-area-inset-bottom))));
}

.nx-topbar-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.nx-topbar-main{
  min-height: 44px;
}
.nx-topbar-left{
  flex: 1 1 auto;
}
.nx-topbar-tools,
.nx-topbar-ticker{
  width:100%;
}
.nx-topbar-radio{
  width:100%;
  padding: 6px 12px 0;
}
.nx-topbar-radio-inline{
  flex: 0 0 140px;
}
.nx-radio-mini{
  width:100%;
  height:32px;
  border-radius:12px;
  overflow:hidden;
  background:#050a07;
  position: relative;
}
.nx-radio-mini iframe{
  width:100%;
  height:32px;
  border:0;
  display:block;
}
.nx-radio-play{
  position:absolute;
  inset:0;
  background:rgba(2,6,12,0.7);
  color:#eafff0;
  border:0;
  font-size:0.9rem;
  letter-spacing:0.04em;
  cursor:pointer;
}
.nx-radio-mini.is-playing .nx-radio-play{
  display:none;
}

.nx-topbar .nexus-message-bar{
  margin: 6px 12px 0;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid #1dd15d !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.nx-topbar .nexus-message-bar[data-nx-type]{
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid #1dd15d !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Page title block (below sticky header, matches Nexus card gradients) */
.nx-page-header {
  margin: 8px 12px 10px;
}

.nx-page-header-outer {
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(72,255,155,0.55), rgba(12,60,20,0.85));
  box-shadow: 0 10px 24px rgba(0,0,0,0.55);
}

.nx-page-header-inner {
  border-radius: 14px;
  padding: 12px 12px 10px;
  background: linear-gradient(180deg, rgba(7,12,18,0.95), rgba(1,3,10,0.92));
  border: 1px solid rgba(72,255,155,0.18);
}

.nx-page-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.nx-page-subtitle {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #b7f6d3;
  opacity: 0.92;
}

/* Ticker/message bar (single-line) */
.nexus-message-bar{
  margin: 6px 12px 12px;
  padding: 8px 12px;
  border-radius: 0;
  background: rgba(7,12,18,0.92);
  border: 0 !important;
  border-bottom: 2px solid #1dd15d !important;
  overflow: hidden;
  width: calc(100% - 24px);
  box-sizing: border-box;
  min-height: 34px;
  position: relative;
}
.nexus-message-bar-text{
  display: inline-flex;
  align-items: center;
  gap: 18px;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
  overflow: visible;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.nexus-message-bar-text.nx-marquee{
  position: absolute;
  left: 0;
  top: 50%;
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  transform: translate3d(var(--nx-ticker-start, 100vw),-50%,0);
}
.nx-ticker-item,
.nx-ticker-separator{
  flex: 0 0 auto;
}
.nx-ticker-separator{
  color: rgba(72,255,155,0.82);
  text-shadow: 0 0 8px rgba(72,255,155,0.45);
}
.nexus-message-bar:hover .nexus-message-bar-text.nx-marquee,
.nexus-message-bar:focus-within .nexus-message-bar-text.nx-marquee{
  will-change: transform;
}
.nexus-message-bar[data-nx-type="blocker"]{
  border-color: rgba(239,68,68,0.5);
  background: rgba(63,14,14,0.8);
}
.nexus-message-bar[data-nx-type="action"]{
  border-color: rgba(245,158,11,0.45);
}
.nexus-message-bar[data-nx-type="system"]{
  border-color: rgba(59,130,246,0.45);
}
.nexus-message-bar[data-nx-type="win"]{
  border-color: rgba(16,185,129,0.5);
}
.nexus-message-bar-text a{
  color: #93c5fd;
  text-decoration: underline;
}

@media (max-width: 420px) {
  .nx-page-header {
    margin: 6px 10px 8px;
  }
  .nx-page-header-inner {
    padding: 10px 10px 8px;
  }
  .nx-page-title {
    font-size: 0.95rem;
  }
  .nx-page-subtitle {
    font-size: 0.72rem;
  }
}

.nx-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nx-hamburger {
  border: none;
  background: transparent;
  color: #f6f6f6;
  font-size: 22px;
  cursor: pointer;
}

.nx-brand {
  font-size: 1rem;
  font-weight: 600;
  color: #48ff9b;
}

.nx-brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

/* Slide-out mobile menu, hidden by default */
.nx-mobile-menu {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(86vw, 280px);
  background:
    linear-gradient(180deg, rgba(7, 12, 18, 0.98), rgba(4, 8, 14, 0.98));
  box-shadow: 4px 0 20px rgba(0,0,0,0.7);
  transform: translateX(-100%);
  transition: transform 0.15s ease-out;
  z-index: 12030;
  padding-top: 60px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom) + var(--nx-fixed-footer-h) + var(--nx-bottom-nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nx-mobile-menu.open {
  transform: translateX(0);
}

.nx-mobile-menu-search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  background: rgba(5, 6, 15, 0.96);
  border-bottom: 1px solid #113321;
}

.nx-mobile-menu-search input {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(72,255,155,0.45);
  background: rgba(4, 12, 9, 0.95);
  color: #e9fff1;
  padding: 0 10px;
  font-size: 0.88rem;
}

.nx-mobile-menu-search input::placeholder {
  color: rgba(189, 255, 214, 0.65);
}

.nx-mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 10px 10px 4px;
}

.nx-mobile-menu li {
  border-bottom: 0;
  margin-bottom: 8px;
}

.nx-mobile-menu a {
  display: block;
  padding: 10px 12px;
  color: #171f19;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(0,0,0,0.28);
  border-bottom: 0;
  background: linear-gradient(180deg,#4f8f6a 0%,#2f6f4b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 3px 8px rgba(0,0,0,0.35);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.nx-mobile-menu a:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.nx-mobile-menu a:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.nx-mobile-menu a.nx-menu-active,
.nx-mobile-menu a[aria-current="page"] {
  background: linear-gradient(180deg,#6aa884 0%,#3f7f5a 100%);
  color: #06120b;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.6),
    0 6px 14px rgba(0,0,0,0.42),
    0 2px 0 rgba(0,0,0,0.28);
  transform: translateY(-1px);
}
.nx-mobile-menu .nx-menu-label {
  padding: 6px 2px 2px;
  font-size: 0.66rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 800;
  color: #baf8d4;
  background: transparent;
  border-bottom: 0;
  margin: 2px 0 0;
}

/* Green menu scrollbar */
.nx-mobile-menu {
  scrollbar-width: thin;
  scrollbar-color: #1dd15d #06130c;
}

.nx-mobile-menu::-webkit-scrollbar {
  width: 10px;
}

.nx-mobile-menu::-webkit-scrollbar-track {
  background: #06130c;
}

.nx-mobile-menu::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2af070, #0ea34d);
  border-radius: 8px;
  border: 2px solid #06130c;
}

/* Bottom nav */
.nx-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  background: #05060f;
  border-top: 1px solid #0c3c14;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 900;
}

.nx-bottom-item {
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  color: #c7fedd;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding-top: 4px;
}

/* Floating AI button */
.nx-ai-fab {
  position: fixed;
  right: 14px;
  bottom: 70px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #02030a;
  box-shadow: 0 0 18px rgba(0,255,120,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 910;
}

.nx-ai-fab img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

/* Dark theme form controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
  background-color: #111111;
  color: #f5f5f5;
  border: 1px solid #333333;
}

/* Hide bottom nav on large screens */
@media (min-width: 960px) {
  .nx-bottom-nav {
    display: none;
  }
}


/* === PATCH: Ensure Nexus AI FAB sits ABOVE bottom nav + fixed footer and never hides on desktop === */
:root{
  --nx-fixed-footer-h: 44px;
  --nx-bottom-nav-h: 60px;
  --nx-ai-fab-gap: 16px;
}

/* Primary AI floating button used by includes/footer-ai-fab.inc.php */
.nx-ai-fab{
  position: fixed !important;
  right: 16px !important;
  bottom: calc(var(--nx-ai-fab-gap) + env(safe-area-inset-bottom) + var(--nx-fixed-footer-h) + var(--nx-bottom-nav-h)) !important;
  z-index: 12050 !important;
  display: flex !important;
  pointer-events: auto !important;
}

/* Tiny phones */
@media (max-width: 400px){
  .nx-ai-fab{
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom) + var(--nx-fixed-footer-h) + var(--nx-bottom-nav-h)) !important;
  }
}

/* Never hide the AI FAB or bottom nav just because the screen is wide */
@media (min-width: 960px){
  .nx-ai-fab{ display: flex !important; }
}
