/**
 * Hello Plataforma · Bottom Nav Component
 *
 * Sticky bottom navigation con backdrop blur,
 * safe-area iOS, badges y estados activos.
 */


/* ============================================================
   BOTTOM NAV BASE
   ============================================================ */

.hp-bottom-nav {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--hp-border-purple);
  /* Safe area para iPhones con barra inferior */
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 12px -4px rgba(105, 73, 158, 0.08);
}

.hp-bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 4px;
  padding: 10px 8px 12px;
  max-width: 100%;
}


/* ============================================================
   ITEM
   ============================================================ */

.hp-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--hp-text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--hp-font-base);
  border-radius: 10px;
  transition: background-color var(--hp-duration-fast) var(--hp-ease),
              color var(--hp-duration-normal) var(--hp-ease),
              transform var(--hp-duration-fast) var(--hp-ease);
  min-height: 48px;
}

.hp-bottom-nav-item:hover {
  background-color: rgba(149, 117, 205, 0.06);
  color: var(--hp-purple-deep);
}

.hp-bottom-nav-item:active {
  transform: scale(0.94);
}

.hp-bottom-nav-item:focus-visible {
  outline: 2px solid var(--hp-purple-deep);
  outline-offset: 2px;
}


/* ============================================================
   ICON
   ============================================================ */

.hp-bottom-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hp-bottom-nav-item i {
  font-size: 22px;
  line-height: 1;
  color: inherit;
  transition: color var(--hp-duration-normal) var(--hp-ease);
}


/* ============================================================
   LABEL
   ============================================================ */

.hp-bottom-nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 1.2;
  color: inherit;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ============================================================
   ESTADO ACTIVO
   ============================================================ */

.hp-bottom-nav-item.is-active {
  color: var(--hp-purple-deep);
}

.hp-bottom-nav-item.is-active .hp-bottom-nav-label {
  font-weight: 600;
}

.hp-bottom-nav-item.is-active i {
  color: var(--hp-purple-deep);
  /* Sutil glow para reforzar el activo */
  filter: drop-shadow(0 1px 2px rgba(105, 73, 158, 0.20));
}


/* ============================================================
   BADGE DE NOTIFICACIONES
   ============================================================ */

.hp-bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--hp-gradient-purple-button);
  color: #FFFFFF;
  font-family: var(--hp-font-base);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  border: 1.5px solid var(--hp-bg-primary);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  box-shadow: 0 1px 3px rgba(105, 73, 158, 0.30);
  pointer-events: none;
}


/* ============================================================
   VARIANTES
   ============================================================ */

/* Fan: 4 items, distribución pareja */
.hp-bottom-nav--fan .hp-bottom-nav-inner {
  /* Default flex es suficiente */
}

/* Creator: 5 items, ítems un poco más compactos */
.hp-bottom-nav--creator .hp-bottom-nav-item {
  padding: 6px 2px;
}

.hp-bottom-nav--creator .hp-bottom-nav-label {
  font-size: 9.5px;
}


/* ============================================================
   COMPENSAR ALTURA EN BODY
   Para que el contenido no quede tapado por el nav fijo
   ============================================================ */

body.hp-has-bottom-nav {
  /* No padding necesario porque el nav es sticky desde la parte inferior
     del flujo, no fixed. El contenido se acomoda naturalmente arriba. */
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet y mayor: max-width centrado para no estirarse en pantallas anchas */
@media (min-width: 768px) {
  .hp-bottom-nav-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 16px 14px;
  }

  .hp-bottom-nav-item i {
    font-size: 24px;
  }

  .hp-bottom-nav-label {
    font-size: 11px;
  }
}

/* Desktop: el bottom nav es menos común pero mantenemos consistencia */
@media (min-width: 1024px) {
  .hp-bottom-nav-inner {
    max-width: 960px;
  }
}


/* ============================================================
   DARK MODE FRIENDLY (futuro)
   Reservado para cuando agreguemos modo oscuro
   ============================================================ */

@media (prefers-color-scheme: dark) {
  /* Reservado para v2 con modo oscuro */
}


/* ============================================================
   IMPRESIÓN
   El bottom nav no se imprime
   ============================================================ */

@media print {
  .hp-bottom-nav {
    display: none;
  }
}
