/* ==========================================================================
   APP-LIKE MOBILE BOTTOM NAVIGATION BAR (Mobile Responsive & Optimized)
   ========================================================================== */

/* Hidden by default on desktop / tablet */
.mobile-app-bar {
  display: none;
}

@media (max-width: 768px) {
  /* Prevent content cut-off by reserving space for bottom bar */
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-app-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 52px;
    gap: 3px;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item i {
    font-size: 1.1rem;
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .mobile-nav-item.active,
  .mobile-nav-item:active {
    color: #ffffff;
  }

  .mobile-nav-item.active i {
    color: #e85d04;
    transform: translateY(-2px);
  }

  /* Highlight Emergency Call button in center */
  .mobile-nav-item.mobile-nav-emergency {
    color: #ffffff;
  }

  .mobile-nav-item.mobile-nav-emergency .emergency-icon-pill {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e85d04 0%, #ff3838 100%);
    box-shadow: 0 4px 14px rgba(232, 93, 4, 0.5), 0 0 0 3px rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    color: #ffffff;
    font-size: 1.15rem;
    animation: emergencyPulse 2.5s infinite;
  }

  @keyframes emergencyPulse {
    0%, 100% {
      transform: scale(1);
      box-shadow: 0 4px 14px rgba(232, 93, 4, 0.5), 0 0 0 3px rgba(15, 23, 42, 0.9);
    }
    50% {
      transform: scale(1.06);
      box-shadow: 0 6px 20px rgba(232, 93, 4, 0.8), 0 0 0 4px rgba(232, 93, 4, 0.3);
    }
  }

  .mobile-nav-item.mobile-nav-emergency span {
    font-size: 0.62rem;
    color: #fdba74;
    font-weight: 700;
  }
}
