/* pwa-style.css — CosmicMatches PWA install prompt
   Dark-mode-first, mobile-optimised bottom-sheet modals              */

/* ── overlay backdrop ─────────────────────────────────────────────── */
.cm-pwa-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  background: rgba(4, 6, 20, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
  pointer-events: none;
}

.cm-pwa-overlay.cm-pwa-visible {
  background: rgba(4, 6, 20, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}

/* ── bottom sheet card ────────────────────────────────────────────── */
.cm-pwa-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 12px 16px;
  padding: 28px 24px 32px;
  border-radius: 24px 24px 20px 20px;
  background: linear-gradient(
    160deg,
    #0f1535 0%,
    #12103a 60%,
    #0d0f28 100%
  );
  border: 1px solid rgba(192, 132, 252, 0.18);
  box-shadow:
    0 -4px 40px rgba(192, 132, 252, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  overflow: hidden;
  transform: translateY(110%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.cm-pwa-overlay.cm-pwa-visible .cm-pwa-sheet {
  transform: translateY(0);
}

/* ── ambient glow ─────────────────────────────────────────────────── */
.cm-pwa-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 120px;
  background: radial-gradient(ellipse, rgba(192, 132, 252, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

/* ── close button ─────────────────────────────────────────────────── */
.cm-pwa-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.cm-pwa-close:hover,
.cm-pwa-close:focus-visible {
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.85);
  outline: none;
}

.cm-pwa-close svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* ── cosmos icon ──────────────────────────────────────────────────── */
.cm-pwa-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(244, 114, 182, 0.1));
  border: 1px solid rgba(192, 132, 252, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cm-pwa-cosmos-icon {
  width: 36px;
  height: 36px;
}

/* ── typography ───────────────────────────────────────────────────── */
.cm-pwa-eyebrow {
  margin: 0 0 6px;
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #c084fc, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cm-pwa-heading {
  margin: 0 0 10px;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: clamp(20px, 5vw, 24px);
  font-weight: 500;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
}

.cm-pwa-body {
  margin: 0 0 22px;
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.cm-pwa-body strong {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

/* ── inline share icon (iOS) ──────────────────────────────────────── */
.cm-pwa-share-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
  stroke: #c084fc;
}

/* ── install button (Android) ─────────────────────────────────────── */
.cm-pwa-install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #fff;
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.cm-pwa-install-btn:hover,
.cm-pwa-install-btn:focus-visible {
  opacity: 0.92;
  box-shadow: 0 6px 28px rgba(168, 85, 247, 0.55);
  outline: none;
}

.cm-pwa-install-btn:active {
  transform: scale(0.97);
}

.cm-pwa-install-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── "maybe later" link ───────────────────────────────────────────── */
.cm-pwa-maybe-later {
  display: block;
  margin: 12px auto 0;
  padding: 6px 12px;
  border: none;
  background: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.cm-pwa-maybe-later:hover,
.cm-pwa-maybe-later:focus-visible {
  color: rgba(255, 255, 255, 0.6);
  outline: none;
}

/* ── animated chevron pointing to share bar (iOS) ────────────────── */
.cm-pwa-chevron {
  margin: 0 auto;
  width: 32px;
  animation: cm-bounce 1.5s ease-in-out infinite;
}

.cm-pwa-chevron svg {
  width: 100%;
  height: auto;
}

@keyframes cm-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* ── reduced-motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cm-pwa-overlay,
  .cm-pwa-sheet,
  .cm-pwa-install-btn,
  .cm-pwa-close {
    transition: none;
  }
  .cm-pwa-chevron {
    animation: none;
  }
}

/* ── landscape safeguard: cap height on short viewports ──────────── */
@media (max-height: 500px) {
  .cm-pwa-sheet {
    padding: 16px 20px 20px;
    border-radius: 16px 16px 12px 12px;
  }
  .cm-pwa-heading {
    font-size: 17px;
    margin-bottom: 6px;
  }
  .cm-pwa-icon-wrap {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
  }
  .cm-pwa-cosmos-icon {
    width: 28px;
    height: 28px;
  }
}
