/* Built by APEXfaucet - APEX Ecosystem on X1 */
/* Mobile Bottom Navigation Bar — companion CSS (also injected by JS as fallback) */

/* Hide on desktop */
@media (min-width: 769px) {
  .apex-bnav,
  .apex-bnav-drawer-overlay,
  .apex-bnav-drawer,
  .apex-bnav-spacer {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   Bottom Navigation Bar
   ══════════════════════════════════════════════════════════════════════════ */
.apex-bnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(6, 6, 12, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(168, 85, 247, 0.15);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

.apex-bnav.hidden {
  transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
}

/* Spacer — prevents page content from being hidden behind fixed bar */
.apex-bnav-spacer {
  display: block;
  height: 64px;
  flex-shrink: 0;
}

/* ── Nav Items ───────────────────────────────────────────────────────── */
.apex-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 48px;
  min-height: 48px;
  padding: 6px 2px 4px;
  color: #6b6b80;
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.apex-bnav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 3px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.apex-bnav-item:active svg {
  transform: scale(0.88);
}

/* Active state */
.apex-bnav-item.active {
  color: var(--apex-accent, #a855f7);
}

.apex-bnav-item.active::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--apex-accent, #a855f7);
  box-shadow: 0 0 8px var(--apex-accent-glow, rgba(168, 85, 247, 0.5));
}

.apex-bnav-item.active svg {
  filter: drop-shadow(0 0 6px var(--apex-accent-glow, rgba(168, 85, 247, 0.4)));
}

/* Hover for non-touch */
@media (hover: hover) {
  .apex-bnav-item:hover {
    color: var(--apex-secondary-light, #c084fc);
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   Drawer Overlay
   ══════════════════════════════════════════════════════════════════════════ */
.apex-bnav-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.apex-bnav-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ══════════════════════════════════════════════════════════════════════════
   Drawer (Half-Sheet)
   ══════════════════════════════════════════════════════════════════════════ */
.apex-bnav-drawer {
  position: fixed;
  bottom: 64px;
  left: 0;
  right: 0;
  z-index: 9999;
  max-height: 55vh;
  background: rgba(10, 8, 18, 0.96);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-top: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5),
              0 0 1px rgba(168, 85, 247, 0.15);
  padding: 12px 16px 20px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.apex-bnav-drawer.open {
  transform: translateY(0);
}

/* Drag handle */
.apex-bnav-drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 auto 16px;
}

/* Title */
.apex-bnav-drawer-title {
  font-size: 13px;
  font-weight: 600;
  color: #555568;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding: 0 4px;
}

/* Links */
.apex-bnav-drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 12px;
  color: #c8c8d8;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.apex-bnav-drawer-link:active {
  background: rgba(168, 85, 247, 0.12);
}

@media (hover: hover) {
  .apex-bnav-drawer-link:hover {
    background: rgba(168, 85, 247, 0.1);
  }
}

.apex-bnav-drawer-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   Light Mode
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme='light'] .apex-bnav {
  background: rgba(255, 255, 255, 0.95);
  border-top-color: rgba(168, 85, 247, 0.12);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .apex-bnav-item {
  color: #9ca3af;
}

[data-theme='light'] .apex-bnav-item.active {
  color: var(--apex-accent, #7c3aed);
}

[data-theme='light'] .apex-bnav-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-top-color: rgba(168, 85, 247, 0.1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
}

[data-theme='light'] .apex-bnav-drawer-link {
  color: #374151;
}

[data-theme='light'] .apex-bnav-drawer-handle {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme='light'] .apex-bnav-drawer-title {
  color: #9ca3af;
}

/* ══════════════════════════════════════════════════════════════════════════
   Reduced Motion
   ══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .apex-bnav,
  .apex-bnav-drawer,
  .apex-bnav-drawer-overlay,
  .apex-bnav-item svg {
    transition-duration: 0.01ms !important;
  }
}
