/* =========================================== */
/* MOBILE BOTTOM NAVIGATION BAR */
/* Instagram/Twitter-style bottom nav for mobile */
/* =========================================== */

/* ===== BOTTOM NAV CONTAINER ===== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
  z-index: 1040;
  display: none;
  padding: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

/* Show only on mobile */
@media (max-width: 991.98px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  
  /* Add padding to body to prevent content being hidden behind nav */
  body {
    padding-bottom: 64px;
  }
}

/* Hide on scroll down, show on scroll up */
.mobile-bottom-nav.hidden {
  transform: translateY(100%);
}

/* ===== DARK MODE ===== */
[data-bs-theme="dark"] .mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.95);
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.3);
}

/* ===== NAV ITEMS ===== */
.mobile-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 8px 4px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-width: 60px;
}

/* Icon container */
.mobile-bottom-nav-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-bottom-nav-icon i {
  font-size: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Label */
.mobile-bottom-nav-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ACTIVE STATE ===== */
.mobile-bottom-nav-item.active {
  color: var(--brand-primary);
}

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

.mobile-bottom-nav-item.active .mobile-bottom-nav-label {
  opacity: 1;
  font-weight: 700;
}

/* Active indicator dot */
.mobile-bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: activeIndicatorPulse 2s ease-in-out infinite;
}

@keyframes activeIndicatorPulse {
  0%, 100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateX(-50%) scale(1.3);
  }
}

/* ===== HOVER STATE (for devices that support it) ===== */
@media (hover: hover) {
  .mobile-bottom-nav-item:hover {
    color: var(--brand-primary);
  }
  
  .mobile-bottom-nav-item:hover .mobile-bottom-nav-icon {
    transform: scale(1.15);
  }
  
  .mobile-bottom-nav-item:hover .mobile-bottom-nav-label {
    opacity: 1;
  }
}

/* ===== ACTIVE/TAP STATE ===== */
.mobile-bottom-nav-item:active {
  transform: scale(0.95);
}

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

/* ===== RIPPLE EFFECT ===== */
.mobile-bottom-nav-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s ease;
}

.mobile-bottom-nav-item:active::after {
  transform: translate(-50%, -50%) scale(2);
  opacity: 1;
  transition: all 0s;
}

/* ===== BADGE/NOTIFICATION DOT ===== */
.mobile-bottom-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 20px);
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  animation: badgePulse 2s ease-in-out infinite;
}

[data-bs-theme="dark"] .mobile-bottom-nav-badge {
  border-color: rgba(15, 23, 42, 0.95);
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* ===== CENTER ACTION BUTTON (OPTIONAL) ===== */
.mobile-bottom-nav-item.center-action {
  position: relative;
}

.mobile-bottom-nav-item.center-action .mobile-bottom-nav-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-accent-reverse);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  margin-bottom: 0;
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-bottom-nav-item.center-action .mobile-bottom-nav-icon i {
  color: white;
  font-size: 24px;
}

.mobile-bottom-nav-item.center-action:active .mobile-bottom-nav-icon {
  transform: translateX(-50%) scale(0.9);
}

.mobile-bottom-nav-item.center-action .mobile-bottom-nav-label {
  margin-top: 28px;
}

/* ===== SAFE AREA INSETS (iPhone notch/home indicator) ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(64px + env(safe-area-inset-bottom));
  }
  
  @media (max-width: 991.98px) {
    body {
      padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }
  }
}

/* ===== ACCESSIBILITY ===== */
.mobile-bottom-nav-item:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
  background: rgba(99, 102, 241, 0.05);
}

/* ===== LANDSCAPE MODE ===== */
@media (max-width: 991.98px) and (orientation: landscape) {
  .mobile-bottom-nav {
    height: 56px;
  }
  
  body {
    padding-bottom: 56px;
  }
  
  .mobile-bottom-nav-item {
    padding: 6px 4px;
  }
  
  .mobile-bottom-nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
  }
  
  .mobile-bottom-nav-icon i {
    font-size: 20px;
  }
  
  .mobile-bottom-nav-label {
    font-size: 0.55rem;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.mobile-bottom-nav,
.mobile-bottom-nav-item,
.mobile-bottom-nav-icon {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav,
  .mobile-bottom-nav-item,
  .mobile-bottom-nav-icon,
  .mobile-bottom-nav-label {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== HIDE ORIGINAL BACK TO TOP BUTTON ON MOBILE ===== */
@media (max-width: 991.98px) {
  .back-to-top {
    bottom: calc(64px + 1rem) !important;
  }
  
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .back-to-top {
      bottom: calc(64px + env(safe-area-inset-bottom) + 1rem) !important;
    }
  }
}

