/**
 * Enhanced Mobile Navigation
 * Bottom navigation bar for improved mobile UX
 */

/* Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(3, 3, 8, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0 max(0.5rem, env(safe-area-inset-bottom));
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-bottom-nav.visible {
  display: flex;
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  min-width: 60px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.bottom-nav-item:active::before {
  width: 100%;
  height: 100%;
}

.bottom-nav-item-icon {
  font-size: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.bottom-nav-item:active .bottom-nav-item-icon {
  transform: scale(0.9);
}

.bottom-nav-item.active {
  color: rgba(59, 130, 246, 1);
}

.bottom-nav-item.active .bottom-nav-item-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.bottom-nav-indicator {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: rgba(59, 130, 246, 1);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bottom-nav-item.active .bottom-nav-indicator {
  opacity: 1;
}

/* Install Button */
#installButton {
  display: none;
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 1rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
  cursor: pointer;
  z-index: 999;
  backdrop-filter: blur(10px);
  animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#installButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.4);
}

#installButton:active {
  transform: translateY(0);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }

  /* Add padding to body for bottom nav */
  body.has-bottom-nav {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  /* Hide desktop nav items */
  .header-nav {
    display: none !important;
  }
}

/* Safe area support for iPhone notch */
@supports (padding: max(0px)) {
  .mobile-bottom-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .mobile-bottom-nav {
    background: rgba(3, 3, 8, 0.98);
    border-top-color: rgba(255, 255, 255, 0.15);
  }
}

/* Landscape mode optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .mobile-bottom-nav {
    padding: 0.25rem 0 max(0.25rem, env(safe-area-inset-bottom));
  }

  .bottom-nav-item {
    padding: 0.25rem 0.5rem;
  }

  .bottom-nav-item-icon {
    font-size: 1.25rem;
  }
}
