/* ========================================
   Add to Home Screen — Prompt Sheet
   ======================================== */

/* Backdrop overlay */
.a2hs-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: a2hs-fade-in 0.3s ease-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

@keyframes a2hs-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Bottom sheet card */
.a2hs-sheet {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 12px 28px 32px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  animation: a2hs-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@keyframes a2hs-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Drag handle */
.a2hs-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d1d5db;
  margin: 0 auto 24px;
}

/* App icon */
.a2hs-sheet-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  object-fit: cover;
  background: #f3f4f6;
  margin: 0 auto 20px;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Title */
.a2hs-sheet-title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin: 0 0 10px;
  line-height: 1.3;
}

/* Description */
.a2hs-sheet-desc {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 28px;
  line-height: 1.5;
  padding: 0 8px;
}

/* Install button — big CTA */
.a2hs-sheet-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background 0.15s;
}

.a2hs-sheet-btn:active {
  background: #333;
}

/* Dismiss link */
.a2hs-sheet-dismiss {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 4px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.a2hs-sheet-dismiss:active {
  color: #6b7280;
}

/* ========================================
   Guide Overlay (iOS / Android steps)
   ======================================== */

.a2hs-guide-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: a2hs-fade-in 0.2s ease-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.a2hs-guide {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 12px 24px 36px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: a2hs-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.a2hs-guide-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d1d5db;
  margin: 0 auto 20px;
}

.a2hs-guide-close {
  background: none;
  border: none;
  font-size: 26px;
  color: #9ca3af;
  cursor: pointer;
  float: right;
  line-height: 1;
  padding: 0 4px;
}

.a2hs-guide-content h3 {
  margin: 0 0 24px 0;
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.a2hs-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.a2hs-guide-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.a2hs-guide-step-text {
  font-size: 16px;
  color: #374151;
  line-height: 1.5;
  padding-top: 5px;
}

.a2hs-guide-step-text strong {
  color: #111;
}

.a2hs-guide-icon {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
}

/* ========================================
   Inline system icons (per-platform)
   ======================================== */

.a2hs-icon {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  color: #111;
  margin: 0 2px;
  flex-shrink: 0;
}

/* ========================================
   Visual mockups (iOS share sheet, Chrome Android menu)
   ======================================== */

.a2hs-mockup {
  max-width: 280px;
  margin: 0 auto 24px;
  padding: 14px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* iOS share sheet mockup */
.a2hs-mockup-ios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.a2hs-mockup-ios-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.a2hs-mockup-ios-appicon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
}

.a2hs-mockup-ios-app span {
  font-size: 9px;
  color: #6b7280;
  text-align: center;
}

.a2hs-mockup-ios-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.a2hs-mockup-ios-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: #374151;
}

.a2hs-mockup-ios-rowlabel { flex: 1; text-align: left; }
.a2hs-mockup-ios-rowicon {
  font-size: 16px;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
}

/* Chrome Android menu mockup (dropdown list only — no browser header) */
.a2hs-mockup-android-dropdown {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.a2hs-mockup-android-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.a2hs-mockup-android-row:last-child { border-bottom: none; }

.a2hs-mockup-android-rowicon {
  color: #2563eb;
  display: inline-flex;
  align-items: center;
}

/* Highlighted (target) row — pulse animation to draw the eye */
.a2hs-mockup-highlight {
  background: #eff6ff;
  border: 1px solid #60a5fa !important;
  color: #1e40af !important;
  animation: a2hs-pulse 2s ease-in-out infinite;
  position: relative;
}

.a2hs-mockup-highlight strong { color: #1e3a8a; }

@keyframes a2hs-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18);
  }
}

/* ==========================================================================
   Native-fidelity mockups — iOS "Add to Home Screen" & Android install dialog
   Real business logo (appIconUrl) + initial fallback. Target button glows.
   ========================================================================== */

/* Shared app icon — real logo, falls back to business initial */
.a2hs-mockup-appicon {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.09);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.a2hs-mockup-appicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.a2hs-mockup-appicon-letter {
  display: none;
  font-size: 25px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.a2hs-mockup-appicon-fallback {
  background: linear-gradient(160deg, #0a84ff 0%, #0040dd 100%);
}

.a2hs-mockup-appicon-fallback .a2hs-mockup-appicon-letter {
  display: block;
}

/* Mockup shells lose the generic grey card — the stage owns the visuals */
.a2hs-mockup-addsheet,
.a2hs-mockup-install {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  max-width: 320px;
}

/* Stage — the little scene each native screen floats on */
.a2hs-stage {
  border-radius: 18px;
  padding: 20px 18px;
  overflow: hidden;
}

.a2hs-stage-ios {
  background: linear-gradient(168deg, #e9edf4 0%, #d9e0ec 100%);
}

.a2hs-stage-android {
  /* dimmed scrim, like a real dialog over page content */
  background: linear-gradient(168deg, rgba(32, 33, 36, 0.82) 0%, rgba(32, 33, 36, 0.6) 100%);
}

/* Glow spotlight on the button the user must tap */
.a2hs-target {
  --a2hs-glow: 0, 122, 255;
  animation: a2hs-glow 2.2s ease-in-out infinite;
}

@keyframes a2hs-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--a2hs-glow), 0), 0 0 0 0 rgba(var(--a2hs-glow), 0);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(var(--a2hs-glow), 0.2), 0 0 18px 3px rgba(var(--a2hs-glow), 0.38);
  }
}

/* ---------- iOS sheet ---------- */
.a2hs-ios-sheet {
  background: #f2f2f7;
  border-radius: 13px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 22px 44px -18px rgba(15, 23, 42, 0.5), 0 2px 8px rgba(15, 23, 42, 0.1);
}

.a2hs-ios-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  padding: 11px 12px;
  background: rgba(249, 249, 251, 0.95);
  box-shadow: inset 0 -0.5px 0 rgba(60, 60, 67, 0.29);
  font-size: 12px;
  letter-spacing: -0.01em;
}

.a2hs-ios-cancel {
  color: #007aff;
  flex-shrink: 0;
}

.a2hs-ios-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a2hs-ios-add {
  color: #007aff;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9px;
  flex-shrink: 0;
}

.a2hs-ios-form {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px 13px 20px;
  padding: 11px 13px;
  background: #fff;
  border-radius: 11px;
}

.a2hs-ios-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.a2hs-ios-name {
  display: flex;
  align-items: center;
  font-size: 14.5px;
  color: #000;
  letter-spacing: -0.01em;
  padding-bottom: 7px;
  margin-bottom: 5px;
  box-shadow: inset 0 -0.5px 0 rgba(60, 60, 67, 0.29);
  white-space: nowrap;
  overflow: hidden;
}

.a2hs-ios-caret {
  flex: 0 0 1.5px;
  width: 1.5px;
  height: 15px;
  margin-left: 2px;
  background: #3478f6;
  animation: a2hs-caret 1.1s steps(2, start) infinite;
}

@keyframes a2hs-caret {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.a2hs-ios-url {
  font-size: 12.5px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Android (Material 3) dialog ---------- */
.a2hs-md-dialog {
  background: #fff;
  border-radius: 22px;
  padding: 19px 20px 13px;
  text-align: left;
  font-family: 'Google Sans', Roboto, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 26px 52px -18px rgba(0, 0, 0, 0.55), 0 3px 10px rgba(0, 0, 0, 0.14);
}

.a2hs-md-title {
  font-size: 14.5px;
  font-weight: 500;
  color: #1f1f1f;
  margin-bottom: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a2hs-md-row {
  display: flex;
  align-items: center;
  gap: 13px;
}

.a2hs-mockup-appicon-md {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
}

.a2hs-mockup-appicon-md .a2hs-mockup-appicon-letter {
  font-size: 19px;
}

.a2hs-md-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.a2hs-md-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f1f1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a2hs-md-url {
  font-size: 12px;
  color: #5f6368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a2hs-md-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 17px;
}

.a2hs-md-cancel {
  color: #0b57d0;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
}

.a2hs-md-install {
  --a2hs-glow: 138, 180, 248;
  background: #0b57d0;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 19px;
  border-radius: 999px;
}

/* Accessibility — keep the spotlight visible, stop the motion */
@media (prefers-reduced-motion: reduce) {
  .a2hs-target,
  .a2hs-ios-caret {
    animation: none;
  }
  .a2hs-target {
    box-shadow: 0 0 0 4px rgba(var(--a2hs-glow), 0.28);
  }
}

/* Fallback note (small hint at the bottom of platform-specific guides) */
.a2hs-guide-note {
  font-size: 12.5px;
  color: #6b7280;
  text-align: center;
  padding: 10px 14px 4px;
  line-height: 1.4;
  font-style: italic;
}
