/* ================= WP PWA Suite — Frontend ================= */

/* ---------- Install / Subscribe buttons (shortcodes) ---------- */
.wps-install-btn,
.wps-subscribe-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 0; cursor: pointer; text-decoration: none;
  padding: 14px 28px; border-radius: 999px;
  font: 600 15px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 10px 25px -8px rgba(99, 102, 241, .55);
  transition: transform .2s ease, box-shadow .2s ease;
}
.wps-install-btn:hover, .wps-subscribe-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -8px rgba(99, 102, 241, .65);
}
.wps-subscribe-btn { background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 10px 25px -8px rgba(239,68,68,.5); }
.wps-install-btn:disabled, .wps-subscribe-btn:disabled { opacity: .7; cursor: default; transform: none; }

/* ---------- QR code ---------- */
.wps-qr-wrap {
  display: inline-block; text-align: center;
  padding: 20px; border-radius: 20px;
  background: #fff; box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .25);
}
.wps-qr-wrap img { display: block; margin: 0 auto; border-radius: 12px; }
.wps-qr-text { margin: 12px 0 0; font: 500 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #475569; }

/* ---------- Popup backdrop ---------- */
.wps-modal-backdrop {
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s ease;
}
.wps-modal-backdrop.show { opacity: 1; }
@media (min-width: 480px) { .wps-modal-backdrop { align-items: center; } }

/* ---------- Modal ---------- */
.wps-modal {
  position: relative; width: 100%; max-width: 384px;
  padding: 34px 28px 28px; border-radius: 24px; text-align: center;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, .45);
  transform: translateY(28px) scale(.96);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.15);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.wps-modal-backdrop.show .wps-modal { transform: none; }

.wps-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(148, 163, 184, .15); color: #64748b;
  font-size: 18px; line-height: 1; cursor: pointer; transition: background .2s;
}
.wps-modal-close:hover { background: rgba(148, 163, 184, .3); }

.wps-modal-icon {
  position: relative; width: 76px; height: 76px; margin: 0 auto 18px;
  border-radius: 22px; overflow: visible;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 14px 30px -10px rgba(99, 102, 241, .6);
  display: flex; align-items: center; justify-content: center;
}
.wps-modal-icon img { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; }
.wps-pulse {
  position: absolute; inset: -6px; border-radius: 26px;
  border: 2px solid rgba(139, 92, 246, .55);
  animation: wpsPulse 2s ease-out infinite;
}
@keyframes wpsPulse {
  0%   { transform: scale(.9); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.wps-modal h3 { margin: 0 0 8px; font-size: 21px; font-weight: 800; color: #0f172a; letter-spacing: -.02em; }
.wps-modal p  { margin: 0 0 22px; font-size: 14px; line-height: 1.6; color: #64748b; }

.wps-modal-actions { display: grid; gap: 10px; }
.wps-btn {
  border: 0; cursor: pointer; padding: 15px 20px; border-radius: 14px;
  font: 600 15px/1 inherit; font-family: inherit; transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
}
.wps-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 12px 22px -10px rgba(99, 102, 241, .7);
}
.wps-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 26px -10px rgba(99, 102, 241, .8); }
.wps-btn-ghost { background: transparent; color: #64748b; }
.wps-btn-ghost:hover { background: rgba(148, 163, 184, .12); }

/* loading spinner inside allow button */
.wps-btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.wps-btn.loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  border-radius: 50%; animation: wpsSpin .7s linear infinite;
}
@keyframes wpsSpin { to { transform: rotate(360deg); } }

/* success state */
.wps-modal.wps-success { padding: 40px 28px; }
.wps-success-check svg { width: 72px; height: 72px; margin: 0 auto 14px; display: block; }
.wps-success-check circle { stroke: #22c55e; stroke-width: 3; stroke-dasharray: 166; stroke-dashoffset: 166; animation: wpsStroke .6s ease forwards; }
.wps-success-check path   { stroke: #22c55e; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: wpsStroke .4s .5s ease forwards; }
@keyframes wpsStroke { to { stroke-dashoffset: 0; } }

/* ---------- Floating bell ---------- */
.wps-bell {
  position: fixed; right: 18px; bottom: 18px; z-index: 999998;
  width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 14px 30px -8px rgba(99, 102, 241, .65);
  animation: wpsBellBounce 3.5s ease-in-out infinite;
}
.wps-bell svg { width: 24px; height: 24px; }
@keyframes wpsBellBounce {
  0%, 84%, 100% { transform: translateY(0); }
  88% { transform: translateY(-7px); }
  92% { transform: translateY(0); }
  95% { transform: translateY(-4px); }
}

/* ---------- Toast ---------- */
.wps-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1000000;
  transform: translateX(-50%) translateY(20px);
  padding: 13px 22px; border-radius: 999px; max-width: 90vw;
  font: 500 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #fff; background: #0f172a; box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .6);
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.wps-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.wps-toast-success { background: #059669; }
.wps-toast-error   { background: #dc2626; }

@media (prefers-reduced-motion: reduce) {
  .wps-pulse, .wps-bell { animation: none; }
  .wps-modal, .wps-modal-backdrop, .wps-toast { transition: none; }
}