/* ============================================================
   Mobile Bottom Navigation - CampusTrack
   Shown on mobile only (< 768px). Hidden on desktop.
   ============================================================ */

.mobile-bottom-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 45;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
  }

  .admin-content-area {
    padding-bottom: 70px; /* Space for bottom nav */
  }

  /* Hide scrollbar bounce behind bottom nav */
  body {
    overscroll-behavior-y: contain;
  }
}

/* ---- Nav Item ---- */

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border: none;
  background: none;
  text-decoration: none;
}

.mobile-nav-item:active {
  opacity: 0.7;
}

.mobile-nav-item.active {
  color: var(--brand-color, #274186);
}

/* Active indicator bar */
.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: currentColor;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.mobile-nav-item span {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* ---- Badge (notification count) ---- */

.mobile-nav-badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(12px);
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

/* ---- Dark mode support ---- */

@media (prefers-color-scheme: dark) {
  .mobile-bottom-nav {
    background: rgba(30, 30, 30, 0.97);
    border-top-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
  }

  .mobile-nav-item {
    color: #6b7280;
  }

  .mobile-nav-item.active {
    color: #60a5fa;
  }
}

/* ---- Touch gesture: pull-to-refresh indicator ---- */

.ptr-indicator {
  display: none;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.ptr-indicator.visible {
  display: flex;
  transform: translateX(-50%) translateY(16px);
}

.ptr-indicator.loading {
  animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
  100% { transform: translateX(-50%) translateY(16px) rotate(360deg); }
}

.ptr-indicator svg {
  width: 20px;
  height: 20px;
  color: var(--brand-color, #274186);
}
