/* =====================================================
   BOTTOM NAVIGATION — estilo app nativo
   visível < 768px, oculta em tablet+ (rail substitui)
   ===================================================== */

.bottomnav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(10, 15, 28, 0.92);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-top: 1px solid var(--color-border-subtle);
  z-index: var(--z-bottomnav);
}

/* Linha neon sutil no topo */
.bottomnav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 229, 255, 0.30) 30%,
    rgba(0, 229, 255, 0.30) 70%,
    transparent 100%
  );
}

/* ── Link ── */
.bottomnav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  min-height: var(--bottomnav-height);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.25s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Pílula neon de fundo do ícone (estilo app nativo) */
.bottomnav-link::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 44px;
  height: 32px;
  border-radius: 16px;
  background: rgba(0, 229, 255, 0.12);
  box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.20);
  border: 1px solid rgba(0, 229, 255, 0.18);
  opacity: 0;
  transform: translateX(-50%) scale(0.85);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.bottomnav-link.active::before,
.bottomnav-link[aria-current="page"]::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Ícone ── */
.bottomnav-link svg,
.bottomnav-link i[data-lucide] svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: filter 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottomnav-link.active,
.bottomnav-link[aria-current="page"] {
  color: var(--color-neon);
}

.bottomnav-link.active svg,
.bottomnav-link[aria-current="page"] svg {
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.65));
  transform: translateY(-2px) scale(1.05);
}

/* ── Label ── */
.bottomnav-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  position: relative;
  z-index: 1;
  transition: opacity 0.2s ease;
}

/* ── Feedback tátil ── */
.bottomnav-link:active {
  transform: scale(0.95);
}

.bottomnav-link:focus-visible {
  outline: 2px solid var(--color-neon);
  outline-offset: -4px;
  border-radius: 12px;
}

/* =====================================================
   TABLET+ (≥ 768px) — esconde bottomnav (rail substitui)
   ===================================================== */
@media (min-width: 768px) {
  .bottomnav {
    display: none;
  }
}

/* =====================================================
   ESTADOS — esconder em no-sidebar e onboarding-mode
   ===================================================== */
#app-layout.no-sidebar ~ #bottomnav,
#app-layout.onboarding-mode ~ #bottomnav {
  display: none !important;
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  .bottomnav-link,
  .bottomnav-link svg,
  .bottomnav-link::before {
    transition: none;
  }
  .bottomnav-link.active svg,
  .bottomnav-link[aria-current="page"] svg {
    transform: none;
  }
}
