/* PWA Styles for DurianPenang.com */

/* Network status toast notifications */
.network-status-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  align-items: center;
  font-size: 14px;
  max-width: 90%;
  width: auto;
  animation: slideUp 0.3s ease-out forwards;
}

.network-status-toast.online {
  background-color: #E8F5E9;
  border-left: 4px solid #4CAF50;
  color: #2E7D32;
}

.network-status-toast.offline {
  background-color: #FFF3E0;
  border-left: 4px solid #FF9800;
  color: #E65100;
}

.network-toast-content {
  display: flex;
  align-items: center;
}

.network-toast-content svg {
  margin-right: 8px;
  flex-shrink: 0;
}

/* Update toast notification */
.update-toast {
  position: fixed;
  top: 70px;
  right: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  max-width: 300px;
  width: 100%;
  animation: slideIn 0.3s ease-out forwards;
}

.update-toast-content {
  padding: 16px;
}

.update-toast-content p {
  margin: 0 0 12px 0;
  font-weight: 600;
}

.update-actions {
  display: flex;
  gap: 8px;
}

.update-actions button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.2s;
}

#update-button {
  background-color: var(--primary-color);
  color: white;
}

#update-button:hover {
  background-color: var(--primary-hover);
}

#update-dismiss {
  background-color: #E2E8F0;
  color: #4A5568;
}

#update-dismiss:hover {
  background-color: #CBD5E0;
}

/* PWA Install Button */
.pwa-install-button {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pwa-install-button:hover {
  background-color: var(--primary-hover);
}

.pwa-install-button svg {
  margin-right: 6px;
}

/* Hide PWA buttons when installed */
.pwa-install-button.hidden {
  display: none !important;
}

/* Animation keyframes */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* Asset preloader component */
.asset-preloader {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  visibility: hidden;
}

/* Offline indicator in header */
.connection-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
}

.connection-status.online {
  background-color: #E8F5E9;
  color: #2E7D32;
}

.connection-status.offline {
  background-color: #FFF3E0;
  color: #E65100;
}

.connection-status .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.connection-status.online .indicator {
  background-color: #4CAF50;
}

.connection-status.offline .indicator {
  background-color: #FF9800;
}
