/* ============================================================
   psyai-nav.css
   Portable "persistent nav pill" component.
   Scoped entirely under .psyai-nav-* — safe to drop into any
   page without colliding with existing styles.
   Derived from psyai-portal/design_guidelines.json
   ============================================================ */

.psyai-nav-root {
  --psyai-bg-surface: rgba(18, 18, 21, 0.65);
  --psyai-border: rgba(255, 255, 255, 0.08);
  --psyai-text-primary: #F8F8F8;
  --psyai-text-secondary: #A0A0AB;
  --psyai-magenta: #FF00FF;
  --psyai-green: #00FFCC;
  --psyai-purple: #8A2BE2;
  --psyai-violet: #4C1D95;
  --psyai-glow: var(--psyai-magenta);

  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.psyai-nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 2rem;
  border-radius: 9999px;
  background: var(--psyai-bg-surface);
  border: 1px solid var(--psyai-border);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2),
              0 8px 32px rgba(0,0,0,0.35),
              0 0 24px -6px var(--psyai-glow);
  transition: box-shadow 300ms ease;
  cursor: default;
  outline: none;
}

.psyai-nav-pill:focus-visible {
  box-shadow: 0 0 0 2px var(--psyai-glow),
              0 8px 32px rgba(0,0,0,0.35);
}

/* Chevrons */
.psyai-nav-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--psyai-text-primary);
  opacity: 0.85;
  transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.psyai-nav-chev svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.psyai-nav-chev:hover {
  opacity: 1;
  transform: scale(1.05);
  filter: drop-shadow(0 0 6px var(--psyai-glow));
}

.psyai-nav-chev:active {
  transform: scale(0.96);
}

/* Center hub */
.psyai-nav-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  min-width: 3.5rem;
}

.psyai-nav-hub-icon-wrap {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease, filter 180ms ease;
}

.psyai-nav-hub:hover .psyai-nav-hub-icon-wrap {
  transform: scale(1.05);
}

.psyai-nav-hub-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5))
          drop-shadow(0 0 10px var(--psyai-glow));
  transition: filter 220ms ease;
}

.psyai-nav-hub-label {
  margin-top: 0.5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--psyai-text-secondary);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap;
}

/* Slide + fade transition on icon/label swap */
.psyai-nav-hub-icon-wrap,
.psyai-nav-hub-label-wrap {
  will-change: transform, opacity;
}

.psyai-nav-swap {
  animation: psyai-nav-swap-in 260ms ease both;
}

.psyai-nav-swap-from-left {
  animation-name: psyai-nav-swap-in-from-left;
}

.psyai-nav-swap-from-right {
  animation-name: psyai-nav-swap-in-from-right;
}

@keyframes psyai-nav-swap-in-from-right {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes psyai-nav-swap-in-from-left {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Reduced motion: no slide/scale, instant swap */
@media (prefers-reduced-motion: reduce) {
  .psyai-nav-swap,
  .psyai-nav-swap-from-left,
  .psyai-nav-swap-from-right {
    animation: none !important;
  }
  .psyai-nav-chev:hover,
  .psyai-nav-hub:hover .psyai-nav-hub-icon-wrap {
    transform: none !important;
  }
}

/* Small screens */
@media (max-width: 420px) {
  .psyai-nav-pill {
    gap: 1.25rem;
    padding: 0.75rem 1.25rem;
  }
  .psyai-nav-hub-icon-wrap {
    width: 3rem;
    height: 3rem;
  }
}
