/* ========================================================
   Zagazaga ERP - Progressive Web App (PWA) Install Popup
   Matches Reatech360 Installation Card Design
   ======================================================== */

#pwa-install-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483647;
  width: calc(100% - 32px);
  max-width: 440px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 12px 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pwaSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideDown {
  0% {
    opacity: 0;
    transform: translate(-50%, -24px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

#pwa-install-banner.pwa-hiding {
  opacity: 0 !important;
  transform: translate(-50%, -20px) scale(0.96) !important;
  pointer-events: none;
}

/* Close / Dismiss (x) button in top-right */
.pwa-close-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
  z-index: 5;
  outline: none;
}

.pwa-close-btn:hover,
.pwa-close-btn:focus {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
  transform: scale(1.08);
}

.pwa-close-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Content Container */
.pwa-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

/* App Icon (Left) */
.pwa-card-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: block;
}

/* Text Details (Middle) */
.pwa-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.pwa-card-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  color: #1e293b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.pwa-card-subtitle {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.35;
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Install Button (Right) */
.pwa-card-btn-wrap {
  flex-shrink: 0;
}

.pwa-install-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff6600;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(0, 112, 186, 0.32);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-action-btn:hover {
  background: #ff6600;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 112, 186, 0.42);
  color: #ffffff !important;
}

.pwa-install-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 112, 186, 0.3);
}

.pwa-install-icon-svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ========================================================
   iOS Safari Guide Modal
   ======================================================== */
.pwa-ios-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2147483647;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: pwaFadeIn 0.25s ease forwards;
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pwa-ios-modal-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  text-align: left;
  animation: pwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.pwa-ios-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.pwa-ios-modal-close {
  background: #f1f5f9;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 16px;
}

.pwa-ios-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.pwa-ios-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #334155;
  line-height: 1.4;
}

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

.pwa-ios-step-icon {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 4px;
}

/* Mobile fine-tuning */
@media (max-width: 480px) {
  #pwa-install-banner {
    top: 12px;
    width: calc(100% - 24px);
    padding: 10px 14px;
  }
  .pwa-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }
  .pwa-card-title {
    font-size: 14px;
  }
  .pwa-card-subtitle {
    font-size: 11.5px;
  }
  .pwa-install-action-btn {
    padding: 7px 13px;
    font-size: 13px;
  }
}

