/* LoteRifas PWA styles — install banner, update toast, iOS guide modal */

/* ========== Update toast (new SW available) ========== */
.pwa-update-toast {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  z-index: 10001;
  background: #fff;
  color: #111827;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 14px 16px;
  animation: pwa-slide-up 0.25s ease-out;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.pwa-update-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pwa-update-content > div:first-child {
  flex: 1;
  min-width: 0;
}
.pwa-update-content strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
.pwa-update-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.pwa-update-btn {
  background: #1e40af;
  color: #fff;
  border: 0;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 40px;
  min-width: 88px;
}
.pwa-update-btn:active { background: #1e3a8a; }

/* ========== Android install banner ========== */
.pwa-install-banner {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  z-index: 10001;
  background: #fff;
  color: #111827;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: pwa-slide-up 0.25s ease-out;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.pwa-banner-logo {
  width: 44px; height: 44px;
  background: #1e40af;
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}
.pwa-banner-text strong {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}
.pwa-banner-text span {
  color: #6b7280;
  font-size: 12px;
}
.pwa-banner-install {
  background: #1e40af;
  color: #fff;
  border: 0;
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 40px;
}
.pwa-banner-install:active { background: #1e3a8a; }
.pwa-banner-close {
  background: transparent;
  border: 0;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 40px;
  min-width: 40px;
}

/* ========== iOS install guide modal ========== */
.pwa-ios-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
}
.pwa-ios-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  animation: pwa-fade-in 0.2s ease-out;
}
.pwa-ios-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  color: #111827;
  border-radius: 18px 18px 0 0;
  padding: 20px 22px calc(30px + env(safe-area-inset-bottom, 0px)) 22px;
  animation: pwa-slide-up 0.25s ease-out;
  max-height: 85vh;
  overflow-y: auto;
}
.pwa-ios-sheet h3 {
  margin: 0 0 16px 0;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}
.pwa-ios-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  color: #9ca3af;
  font-size: 26px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  min-height: 40px;
  min-width: 40px;
}
.pwa-ios-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pwa-ios-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  line-height: 1.4;
}
.pwa-ios-steps li:last-child { border-bottom: 0; }
.pwa-ios-steps .step-num {
  width: 26px; height: 26px;
  background: #1e40af;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
/* iOS share icon (square with up arrow) */
.pwa-share-icon {
  display: inline-flex;
  width: 22px;
  height: 28px;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin: 0 2px;
  vertical-align: middle;
}
.pwa-share-icon::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 3px; right: 3px; top: 8px;
  border: 2px solid #1e40af;
  border-radius: 4px;
  border-top: 0;
}
.pwa-share-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 14px;
  background: #1e40af;
  transform: translateX(-50%);
  border-radius: 1px;
  box-shadow:
    -5px 3px 0 -3px #1e40af,
     5px 3px 0 -3px #1e40af;
}

/* ========== Accessibility ========== */
.pwa-update-btn:focus-visible,
.pwa-banner-install:focus-visible,
.pwa-banner-close:focus-visible,
.pwa-ios-close:focus-visible {
  outline: 2px solid #1e40af;
  outline-offset: 2px;
}

/* ========== Animations ========== */
@keyframes pwa-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes pwa-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
