/* ==============================================================================
   IMPERIAL APEX UNIVERSITY - MOBILE WEB APP & PWA STYLES
   Optimized for touch ergonomics & mobile viewport responsiveness
   ============================================================================== */

/* Bottom Navigation Bar for Mobile Logged-in Users */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.725rem;
  font-weight: 600;
  text-decoration: none;
  min-width: 58px;
  min-height: 48px; /* Touch target >= 48px */
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.mobile-nav-link .mobile-nav-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.mobile-nav-link.active {
  color: var(--secondary);
}

.mobile-nav-link.active .mobile-nav-icon {
  transform: translateY(-1px);
}

/* Mobile Sidebar Drawer Toggle Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-size: 1.25rem;
  color: var(--primary);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* Mobile Overlay when drawer opens */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 95;
}

.sidebar-backdrop.active {
  display: block;
}

/* Media Queries for Tablet & Mobile Screen Sizes */
@media (max-width: 992px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.2);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    padding-bottom: calc(var(--bottom-nav-height) + 1rem);
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

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

  .app-topbar {
    padding: 0 1rem;
    height: 60px;
  }

  .app-body {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .card {
    padding: 1.15rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Touch targets ergonomics */
  .btn, .form-control, .form-select {
    min-height: 44px;
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .topbar-badge {
    display: none;
  }

  .hide-on-mobile {
    display: none !important;
  }
}
