/* ========================================
   MOBILE NAVBAR IMPROVEMENTS
   ======================================== */

/* Make navbar more compact on mobile and hide collapse menu */
@media (max-width: 991px) {

  /* Hide the collapsible menu on mobile - use bottom nav instead */
  .navbar-collapse {
    display: none !important;
  }

  .navbar {
    padding: 0.5rem 1rem !important;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }

  .navbar-brand img {
    height: 32px !important;
  }

  /* Hide toggler button - not needed with bottom nav */
  .navbar-toggler {
    display: none !important;
  }
}

/* ========================================
   BOTTOM NAVIGATION BAR (MOBILE ONLY)
   ======================================== */

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 991px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(199, 154, 114, 0.15);
    z-index: 1000;
    padding: 8px 12px;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(199, 154, 114, 0.1);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 6px 2px;
    transition: all 0.3s ease;
    position: relative;
  }

  /* Make dropdown containers take equal space */
  .mobile-bottom-nav .dropdown {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
  }

  .mobile-nav-item span {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
  }

  .mobile-nav-item.active {
    color: var(--primary-rose-gold);
  }

  .mobile-nav-item.active i {
    transform: scale(1.1);
  }

  .mobile-nav-item:hover {
    color: var(--primary-rose-gold);
    text-decoration: none;
  }

  /* Profile image in bottom nav */
  .mobile-nav-item .nav-profile-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
  }

  .mobile-nav-item.active .nav-profile-img {
    border-color: var(--primary-rose-gold);
  }

  /* Badge for notifications */
  .mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(50%);
    background: var(--primary-rose-gold);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
  }

  /* Install App Button Styling */
  #mobile-install-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white !important;
    border-radius: 12px;
    margin: 0 4px;
    animation: pulse 2s ease-in-out infinite;
  }

  #mobile-install-btn i {
    color: white;
  }

  #mobile-install-btn span {
    color: white;
  }

  #mobile-install-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    transform: translateY(-2px);
  }

  @keyframes pulse {

    0%,
    100% {
      box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }

    50% {
      box-shadow: 0 0 0 8px rgba(0, 123, 255, 0);
    }
  }

  /* Add padding to main content to prevent overlap with bottom nav */
  main.container-fluid {
    padding-bottom: 80px !important;
  }

  /* Special case for messages page - no bottom padding */
  body.messages-page main.container-fluid {
    padding-bottom: 0 !important;
  }
}

/* ========================================
   MOBILE PROFILE DROPDOWN
   ======================================== */

.mobile-profile-menu {
  display: none;
  position: fixed;
  top: 50px;
  right: 15px;
  background: var(--white);
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(199, 154, 114, 0.2);
  padding: 10px;
  z-index: 999;
  min-width: 200px;
  animation: slideDownFade 0.3s ease;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-profile-menu.show {
  display: block;
}

.mobile-profile-menu a {
  display: block;
  padding: 12px 15px;
  color: var(--text-body);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.mobile-profile-menu a:hover {
  background: var(--beige-light);
  color: var(--primary-rose-gold);
}

.mobile-profile-menu a i {
  margin-left: 8px;
  width: 20px;
  text-align: center;
}

.mobile-profile-menu hr {
  margin: 8px 0;
  border-color: rgba(199, 154, 114, 0.1);
}

/* Overlay for mobile menu */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 998;
}

.mobile-menu-overlay.show {
  display: block;
}

/* ========================================
   DESKTOP - Keep original navbar
   ======================================== */

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none !important;
  }

  .mobile-profile-menu {
    display: none !important;
  }

  .mobile-menu-overlay {
    display: none !important;
  }
}