/* PWA Custom Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 120%);
  width: 90%;
  max-width: 480px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  padding: 24px;
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.pwa-install-banner.show {
  transform: translate(-50%, 0);
}

.pwa-banner-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pwa-app-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  object-fit: cover;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.pwa-app-info {
  flex: 1;
}

.pwa-app-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.pwa-app-subtitle {
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  color: #a0a0a0;
  margin: 0;
}

.pwa-banner-desc {
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  color: #d0d0d0;
  line-height: 1.45;
  margin: 0;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.pwa-btn {
  flex: 1;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 44px; /* Touch target */
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-btn-install {
  background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
  color: #000000;
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.pwa-btn-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 140, 0, 0.3);
}

.pwa-btn-install:active {
  transform: translateY(0);
}

.pwa-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pwa-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Light Mode support */
body.light-mode .pwa-install-banner {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(40, 167, 69, 0.2);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

body.light-mode .pwa-app-title {
  color: #333333;
}

body.light-mode .pwa-app-subtitle {
  color: #666666;
}

body.light-mode .pwa-banner-desc {
  color: #555555;
}

body.light-mode .pwa-app-icon {
  border: 1px solid rgba(40, 167, 69, 0.3);
}

body.light-mode .pwa-btn-install {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

body.light-mode .pwa-btn-install:hover {
  box-shadow: 0 6px 18px rgba(40, 167, 69, 0.3);
}

body.light-mode .pwa-btn-cancel {
  background: rgba(0, 0, 0, 0.05);
  color: #333333;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .pwa-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* PWA Offline Status Toast */
.pwa-status-toast {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 0, 0, 0.3);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 50px;
  font-family: "Poppins", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(150px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.pwa-status-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.pwa-status-toast.online {
  border-color: rgba(40, 167, 69, 0.5);
}

.pwa-status-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff3b30; /* red for offline */
}

.pwa-status-toast.online .pwa-status-icon {
  background-color: #28a745; /* green for online */
}

/* Light mode for offline toast */
body.light-mode .pwa-status-toast {
  background: rgba(255, 255, 255, 0.98);
  color: #333333;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* --- MOBILE BOTTOM NAVIGATION STYLES --- */
.mobile-bottom-nav {
  display: none;
}

.mobile-only-toggle {
  display: none !important;
}

@media (max-width: 991px) {
  /* Body padding bottom to ensure content isn't covered by bottom dock */
  body {
    padding-bottom: 96px !important;
  }

  /* Show floating bottom navigation bar */
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 66px;
    background: rgba(18, 18, 18, 0.88); /* Premium dark glassmorphism */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  /* Light Mode styles for bottom navigation */
  body.light-mode .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  }
  
  .mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #b8b8b8; /* Lighter color for better readability/contrast */
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Poppins", sans-serif;
    font-size: 12px; /* Increased from 10px */
    font-weight: 600;
    gap: 3px;
  }
  
  .mobile-bottom-nav-item i {
    font-size: 20px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.25s ease;
  }
  
  /* Active state transitions */
  .mobile-bottom-nav-item.active {
    color: #FFD700; /* Gold brand accent */
    font-weight: 700; /* Bolder text on active */
  }
  
  .mobile-bottom-nav-item.active i {
    animation: tabBounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }
  
  @keyframes tabBounce {
    0% {
      transform: translateY(0) scale(1);
    }
    50% {
      transform: translateY(-7px) scale(1.2);
    }
    100% {
      transform: translateY(-4px) scale(1.1);
    }
  }
  
  body.light-mode .mobile-bottom-nav-item.active {
    color: #28a745; /* Green brand accent for light mode */
  }

  /* Hide default hamburger menu button and collapse area on mobile */
  .navbar-toggler {
    display: none !important;
  }
  
  .navbar-collapse {
    display: none !important;
  }
  
  /* Show mobile theme toggle next to brand */
  .mobile-only-toggle {
    display: flex !important;
    background: transparent;
    border: 1.5px solid #FFD700;
    color: #FFD700;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: 4px;
    transition: all 0.3s ease;
  }
  
  body.light-mode .mobile-only-toggle {
    border-color: #28a745;
    color: #28a745;
  }

  /* Shift installation banner up to rest above bottom nav */
  .pwa-install-banner {
    bottom: 96px;
    border-radius: 20px;
    width: calc(100% - 32px);
    left: 50%;
    transform: translate(-50%, 150%);
    border: 1px solid rgba(255, 215, 0, 0.2);
  }
  
  .pwa-install-banner.show {
    transform: translate(-50%, 0);
  }
  
  body.light-mode .pwa-install-banner {
    border: 1px solid rgba(40, 167, 69, 0.2);
  }

  /* Shift offline toast above bottom nav */
  .pwa-status-toast {
    bottom: 96px;
    left: 16px;
    right: 16px;
  }
}

@media (max-width: 576px) {
  .mobile-bottom-nav {
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 60px;
  }
  
  .mobile-bottom-nav-item i {
    font-size: 18px;
  }
  
  .mobile-bottom-nav-item {
    font-size: 11px; /* Increased from 9px */
  }
  
  body {
    padding-bottom: 84px !important;
  }
  
  .pwa-install-banner {
    bottom: 84px;
    width: calc(100% - 24px);
  }
  
  .pwa-status-toast {
    bottom: 84px;
  }
}
