/**
 * Aura Store - PWA Styling
 * Palette: #253337, #5C6C73, #9DB5C0, #C2E0E3, #E0FCFC
 */

/* Installation button state control */
.pwa-install-btn {
  display: none !important;
}

body.can-install-pwa .pwa-install-btn {
  display: inline-flex !important;
}

body.is-standalone .pwa-install-btn,
body.is-standalone #pwaInstallBanner,
body.is-standalone #pwaIosModal {
  display: none !important;
}

/* Floating Offline/Online Toast */
#pwaNetworkToast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #253337;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#pwaNetworkToast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#pwaNetworkToast.offline {
  background: #CF1322;
}

#pwaNetworkToast.online {
  background: #237804;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FFFFFF;
}

/* PWA Android / Chrome Install Banner */
#pwaInstallBanner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(37, 51, 55, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(224, 252, 252, 0.2);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  z-index: 9998;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: #FFFFFF;
}

#pwaInstallBanner.visible {
  transform: translateY(0);
}

.pwa-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #253337;
  border: 1px solid rgba(194, 224, 227, 0.3);
}

.pwa-banner-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.pwa-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-desc {
  font-size: 12px;
  color: #C2E0E3;
  margin: 0;
  line-height: 1.3;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-btn-install {
  background: #E0FCFC;
  color: #253337;
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pwa-btn-install:hover {
  background: #FFFFFF;
  transform: scale(1.03);
}

.pwa-btn-close {
  background: transparent;
  border: none;
  color: #9DB5C0;
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.pwa-btn-close:hover {
  color: #FFFFFF;
}

/* iOS Safari Custom Instructions Modal */
#pwaIosModal {
  position: fixed;
  inset: 0;
  background: rgba(18, 26, 28, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 0;
}

#pwaIosModal.show {
  opacity: 1;
  visibility: visible;
}

.pwa-ios-sheet {
  background: #FFFFFF;
  width: 100%;
  max-width: 500px;
  border-radius: 24px 24px 0 0;
  padding: 24px 22px 36px 22px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: #253337;
  position: relative;
}

#pwaIosModal.show .pwa-ios-sheet {
  transform: translateY(0);
}

.pwa-ios-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #EFEFEF;
}

.pwa-ios-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #253337;
  padding: 4px;
}

.pwa-ios-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pwa-ios-title-wrap h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #253337;
}

.pwa-ios-title-wrap p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #5C6C73;
}

.pwa-ios-close {
  margin-left: auto;
  background: #F2F4F5;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  color: #5C6C73;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F7FAFA;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #E0FCFC;
}

.pwa-ios-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #253337;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.pwa-ios-step-text {
  font-size: 13px;
  line-height: 1.4;
  color: #253337;
}

.pwa-ios-step-icon {
  display: inline-flex;
  vertical-align: middle;
  padding: 2px 6px;
  background: #EFEFEF;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  color: #007AFF;
}

.pwa-ios-btn-confirm {
  width: 100%;
  background: #253337;
  color: #FFFFFF;
  border: none;
  padding: 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.pwa-ios-btn-confirm:hover {
  background: #1b2528;
}

/* Standalone adjustments */
@media all and (display-mode: standalone) {
  /* Hide unnecessary web browser UI triggers in standalone */
  .pwa-hide-in-app {
    display: none !important;
  }
}
