/* ============================================================
   Shared bottom navigation — the SINGLE source of truth for the
   floating iOS-style island nav. Included by both the mini app
   (/app) and the admin panel (/admin) via /shared/nav.css so the
   two can never drift again.

   Self-contained: falls back to literal values when the host page
   doesn't define --accent / --tg-content-safe-bottom.
   ============================================================ */

.nav-island {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + var(--tg-content-safe-bottom, env(safe-area-inset-bottom, 0px)));
  z-index: 100;
  /* Never let a long-press select or drag the bar around. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px;
  max-width: calc(100vw - 24px);
  border-radius: 26px;
  background: rgba(24, 24, 28, 0.66);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  animation: nav-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes nav-rise {
  from { transform: translate(-50%, 130%); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* Slightly more transparent over the immersive reels page */
body.reels-active .nav-island {
  background: rgba(18, 18, 22, 0.5);
}

/* The single "bubble" that physically slides from cell to cell. Its position
   and width are driven by nav.js (it measures the active button); CSS only
   owns the look and the spring transition. Sits BEHIND the labels. */
.nav-indicator {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(100% - 12px);
  width: 0;
  border-radius: 19px;
  background: linear-gradient(135deg, var(--accent, #e84393), #a855f7);
  box-shadow: 0 4px 16px rgba(232, 67, 147, 0.45);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform, width;
  transition: transform 0.44s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.44s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.35s ease, box-shadow 0.35s ease, opacity 0.2s ease;
}

/* When the bubble lands on the Admin tab it turns red. */
.nav-indicator.admin {
  background: linear-gradient(135deg, #ff2d55, #e0245e);
  box-shadow: 0 4px 18px rgba(255, 45, 85, 0.5);
}

/* Each button is a horizontal pill: icon + label side by side, above the bubble. */
.nav-btn {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  padding: 11px 15px;
  border-radius: 19px;
  transition: color 0.28s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-btn i {
  font-size: 17px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-btn span {
  display: inline;
}

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

/* The active tab's label goes white and its icon pops — the colored background
   is supplied by the sliding .nav-indicator, not the button itself. */
.nav-btn.active {
  color: #fff;
}

.nav-btn.active i {
  transform: scale(1.12);
}

.nav-btn.hidden {
  display: none;
}
