/* ==========================================
   RESOLVIT PWA UI & INSTALL EXPERIENCE STYLES
   ========================================== */

/* 1. Install Banner / Floating Toast Container */
#pwa-install-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  max-width: 420px;
  width: calc(100% - 48px);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.15);
  padding: 16px 18px;
  color: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#pwa-install-banner.pwa-banner-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Banner Header & Content */
.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.pwa-banner-text {
  flex: 1;
  min-width: 0;
}

.pwa-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 2px 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pwa-banner-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-transform: uppercase;
}

.pwa-banner-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Close/Dismiss Button */
.pwa-banner-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
  flex-shrink: 0;
}

.pwa-banner-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

/* Banner Action Controls */
.pwa-banner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pwa-btn-dismiss {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.pwa-btn-install {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  border: none;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pwa-btn-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

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

/* 2. Floating Navbar / Header Install Pill Button (Optional Header Action) */
.pwa-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-nav-pill:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(59, 130, 246, 0.35) 100%);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

/* 3. Connection Toast Notification */
#pwa-network-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  z-index: 999999;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#pwa-network-toast.toast-online {
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

#pwa-network-toast.toast-offline {
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

#pwa-network-toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 4. iOS Safari Add to Home Screen Instructions Drawer */
#pwa-ios-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#pwa-ios-modal.ios-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.pwa-ios-card {
  width: 100%;
  max-width: 480px;
  background: #0f172a;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 20px 32px;
  color: #f8fafc;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#pwa-ios-modal.ios-modal-visible .pwa-ios-card {
  transform: translateY(0);
}

.pwa-ios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pwa-ios-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.pwa-ios-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  #pwa-install-banner {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: calc(100% - 32px);
    max-width: 100%;
  }

  .pwa-banner-desc {
    white-space: normal;
  }
}
