/* ==========================================================================
   PINGBOT MARKETING & PROMO POPUPS - FRONTEND STYLES
   ========================================================================== */

:root {
  --pb-theme: #2563EB;
  --pb-accent: #16A34A;
  --pb-dark: #0B1F16;
  --pb-text: #1E293B;
  --pb-muted: #64748B;
  --pb-border: #E2E8F0;
  --pb-bg: #FFFFFF;
}

/* 1. Modal Overlay & Backdrop */
.pingbot-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.pingbot-popup-overlay *,
.pingbot-popup-overlay *::before,
.pingbot-popup-overlay *::after {
  box-sizing: border-box;
}

.pingbot-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pingbot-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 22, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pingbot-popup-dialog {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 530px;
  margin: auto;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pingbot-popup-overlay.is-visible .pingbot-popup-dialog {
  transform: scale(1) translateY(0);
}

/* In-Admin Preview Mode overrides */
.pingbot-popup-overlay.is-preview {
  position: static;
  inset: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  padding: 0;
  background: transparent;
  display: block;
}

.pingbot-popup-overlay.is-preview .pingbot-popup-backdrop {
  display: none;
}

.pingbot-popup-overlay.is-preview .pingbot-popup-dialog {
  transform: none;
  max-width: 100%;
}

/* 2. Base Popup Card Shell */
.pingbot-popup-card {
  position: relative;
  background: #FFFFFF;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* 3. Top Banner (Voucher Card) */
.pingbot-card-top-banner {
  position: relative;
  background: linear-gradient(135deg, var(--pb-theme, #2563EB) 0%, #1D4ED8 100%);
  padding: 1.5rem 1.5rem 1.75rem;
  overflow: hidden;
  color: #FFFFFF;
}

/* Radial Sunburst rays background pattern */
.pingbot-sunburst-bg {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.22) 0%, transparent 65%),
              conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,0.08) 0deg 15deg, transparent 15deg 30deg, rgba(255,255,255,0.08) 30deg 45deg, transparent 45deg 60deg, rgba(255,255,255,0.08) 60deg 75deg, transparent 75deg 90deg, rgba(255,255,255,0.08) 90deg 105deg, transparent 105deg 120deg, rgba(255,255,255,0.08) 120deg 135deg, transparent 135deg 150deg, rgba(255,255,255,0.08) 150deg 165deg, transparent 165deg 180deg, rgba(255,255,255,0.08) 180deg 195deg, transparent 195deg 210deg, rgba(255,255,255,0.08) 210deg 225deg, transparent 225deg 240deg, rgba(255,255,255,0.08) 240deg 255deg, transparent 255deg 270deg, rgba(255,255,255,0.08) 270deg 285deg, transparent 285deg 300deg, rgba(255,255,255,0.08) 300deg 315deg, transparent 315deg 330deg, rgba(255,255,255,0.08) 330deg 345deg, transparent 345deg 360deg);
  opacity: 0.65;
  pointer-events: none;
  animation: pingbotSpinSlow 40s linear infinite;
}

@keyframes pingbotSpinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Header Row: Timer & Close */
.pingbot-banner-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

/* Digital Flip Countdown Display */
.pingbot-countdown-container {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pingbot-timer-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pingbot-digit-box {
  display: flex;
  background: #FFFFFF;
  color: #1E293B;
  border-radius: 0.375rem;
  padding: 0.2rem 0.35rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.06);
}

.pingbot-digit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
  width: 0.85rem;
  text-align: center;
}

.pingbot-timer-label {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.25rem;
}

.pingbot-timer-separator {
  font-size: 1.25rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-top: -0.65rem;
}

/* Close Button */
.pingbot-close-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: #FFFFFF;
  border: none;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
  padding: 0;
}

.pingbot-close-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
  transform: scale(1.08);
}

.pingbot-close-icon {
  width: 1rem;
  height: 1rem;
}

/* 4. Voucher Ticket Element with Cutout Notches */
.pingbot-ticket-voucher {
  position: relative;
  z-index: 5;
  background: #FFFFFF;
  border-radius: 1.125rem;
  display: flex;
  align-items: stretch;
  padding: 1.125rem 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 4px 10px -2px rgba(0, 0, 0, 0.08);
}

/* Semicircular Cutout Notches */
.pingbot-ticket-notch {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  background: var(--pb-theme, #2563EB);
  border-radius: 50%;
  z-index: 6;
}

.pingbot-ticket-notch.notch-left {
  left: -0.625rem;
}

.pingbot-ticket-notch.notch-right {
  right: -0.625rem;
}

/* Voucher Left Information */
.pingbot-ticket-left {
  flex: 1;
  padding-right: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pingbot-ticket-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #D97706;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.pingbot-sparkle-icon {
  font-size: 0.75rem;
  color: #F59E0B;
}

.pingbot-ticket-discount {
  font-size: 1.85rem;
  font-weight: 900;
  color: #1D4ED8;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.pingbot-ticket-subtext {
  font-size: 0.6875rem;
  color: #64748B;
  font-weight: 500;
}

/* Perforated divider line */
.pingbot-ticket-perforation {
  width: 1px;
  border-left: 2px dashed #E2E8F0;
  margin: 0 0.5rem;
}

/* Voucher Right Gift Box Illustration */
.pingbot-ticket-right {
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-left: 0.5rem;
}

.pingbot-giftbox-wrapper {
  position: relative;
  width: 85px;
  height: 85px;
}

.pingbot-giftbox-graphic {
  position: relative;
  width: 100%;
  height: 100%;
}

.pingbot-bow-svg {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 32px;
  z-index: 3;
}

.pingbot-giftbox-lid {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 14px;
  background: #3B82F6;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  z-index: 2;
}

.pingbot-giftbox-base {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 44px;
  background: #93C5FD;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.pingbot-giftbox-ribbon-v {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 100%;
  background: #FFFFFF;
}

/* Badge pinned onto gift box */
.pingbot-giftbox-badge {
  position: absolute;
  bottom: 8px;
  right: -2px;
  z-index: 4;
  background: #1E3A8A;
  color: #FFFFFF;
  border-radius: 9999px;
  padding: 0.35rem 0.45rem;
  box-shadow: 0 4px 8px rgba(30, 58, 138, 0.4);
  border: 2px dashed #93C5FD;
  transform: rotate(-10deg);
}

.pingbot-badge-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.pingbot-badge-percent {
  font-size: 0.75rem;
  font-weight: 900;
}

.pingbot-badge-sub {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #93C5FD;
}

/* 5. Card Bottom Content & CTA Section */
.pingbot-card-bottom-content {
  padding: 1.5rem 1.75rem 1.75rem;
  background: #FFFFFF;
}

.pingbot-content-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.pingbot-content-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #475569;
  margin: 0 0 1.25rem;
}

.pingbot-content-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Coupon Copy Pill */
.pingbot-coupon-copy-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  padding: 0.45rem 0.75rem;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pingbot-coupon-copy-wrapper:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.pingbot-coupon-label {
  font-size: 0.625rem;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.05em;
}

.pingbot-coupon-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #0F172A;
}

.pingbot-copy-action-btn {
  background: none;
  border: none;
  padding: 0;
  color: #64748B;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.pingbot-copy-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.pingbot-copy-feedback {
  position: absolute;
  top: -1.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.pingbot-copy-feedback.is-shown {
  opacity: 1;
  visibility: visible;
}

/* Main CTA Button */
.pingbot-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #1E3A8A;
  color: #FFFFFF !important;
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: 0.625rem;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
}

.pingbot-cta-btn:hover {
  background: #1D4ED8;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.35);
}

/* ==========================================================================
   TEMPLATE 2: INTERACTIVE SCRATCH CARD
   ========================================================================== */
.pingbot-scratch-card {
  padding: 1.75rem;
  background: #FFFFFF;
}

.pingbot-scratch-header {
  text-align: center;
  position: relative;
  margin-bottom: 1.25rem;
}

.pingbot-scratch-header .pingbot-close-btn {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
}

.pingbot-scratch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #DCFCE7;
  color: #087A3D;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.pingbot-pulse-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: #16A34A;
  animation: pingbotPulse 1.5s infinite;
}

@keyframes pingbotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.pingbot-scratch-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0B1F16;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}

.pingbot-scratch-sub {
  font-size: 0.75rem;
  color: #607368;
  margin: 0;
  line-height: 1.4;
}

/* Scratch Stage Arena */
.pingbot-scratch-stage {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.1), 0 4px 15px rgba(0,0,0,0.06);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* Underlying Secret Prize */
.pingbot-scratch-secret-content {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 2px dashed #16A34A;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.pingbot-secret-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pingbot-secret-tag {
  font-size: 0.625rem;
  font-weight: 800;
  color: #087A3D;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.pingbot-secret-discount {
  font-size: 1.75rem;
  font-weight: 900;
  color: #16A34A;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.pingbot-secret-code-box {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #FFFFFF;
  border: 1px solid #16A34A;
  padding: 0.25rem 0.65rem;
  border-radius: 0.5rem;
  margin-bottom: 0.35rem;
  box-shadow: 0 2px 5px rgba(22, 163, 74, 0.15);
}

.pingbot-secret-code-label {
  font-size: 0.5625rem;
  font-weight: 800;
  color: #607368;
}

.pingbot-secret-code-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 900;
  color: #0B1F16;
  letter-spacing: 0.05em;
}

.pingbot-secret-hint {
  font-size: 0.65rem;
  color: #607368;
  margin: 0;
}

/* HTML5 Canvas Overlay (Foil) */
.pingbot-scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 10;
  transition: opacity 0.5s ease;
}

.pingbot-scratch-canvas.is-revealed {
  opacity: 0;
  pointer-events: none;
}

/* Scratch Footer */
.pingbot-scratch-footer {
  margin-top: 1.25rem;
}

.pingbot-scratch-progress-wrap {
  text-align: center;
  margin-bottom: 0.85rem;
}

.pingbot-scratch-status-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #16A34A;
}

.pingbot-scratch-actions {
  display: flex;
  gap: 0.75rem;
}

.pingbot-copy-code-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F172A;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pingbot-copy-code-btn:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.pingbot-scratch-claim-btn {
  flex: 1.2;
  background: #16A34A !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25) !important;
}

.pingbot-scratch-claim-btn:hover {
  background: #15803D !important;
}

/* ==========================================================================
   TEMPLATE 3: FLASH SALE CARD
   ========================================================================== */
.pingbot-flash-card {
  background: #FFFFFF;
}

.pingbot-flash-header {
  position: relative;
  background: #0B1F16;
  color: #FFFFFF;
  padding: 1.5rem;
  text-align: center;
}

.pingbot-flash-header .pingbot-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.pingbot-flash-header .pingbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.pingbot-flash-pill {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  font-size: 0.6875rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}

.pingbot-flash-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 0.75rem;
}

.pingbot-flash-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #22C55E;
  background: rgba(34, 197, 94, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.pingbot-flash-timer-digit {
  font-weight: 900;
}

.pingbot-flash-body {
  padding: 1.5rem;
}

.pingbot-flash-discount-banner {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
  margin-bottom: 1rem;
}

.pingbot-flash-big-text {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  color: #16A34A;
}

.pingbot-flash-sub {
  font-size: 0.6875rem;
  color: #607368;
}

.pingbot-flash-desc {
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.pingbot-flash-urgency-bar {
  margin-bottom: 1.25rem;
}

.pingbot-urgency-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #DC2626;
  margin-bottom: 0.35rem;
}

.pingbot-urgency-track {
  height: 8px;
  background: #FEE2E2;
  border-radius: 9999px;
  overflow: hidden;
}

.pingbot-urgency-fill {
  height: 100%;
  background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.pingbot-flash-cta {
  width: 100%;
  background: #16A34A !important;
  padding: 0.75rem 1rem !important;
}

.pingbot-flash-cta:hover {
  background: #15803D !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 520px) {
  .pingbot-card-top-banner {
    padding: 1.125rem 1rem 1.25rem;
  }

  .pingbot-ticket-voucher {
    padding: 0.875rem;
  }

  .pingbot-ticket-discount {
    font-size: 1.45rem;
  }

  .pingbot-ticket-right {
    width: 90px;
  }

  .pingbot-content-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .pingbot-coupon-copy-wrapper {
    justify-content: center;
  }

  .pingbot-cta-btn {
    width: 100%;
  }

  .pingbot-scratch-actions {
    flex-direction: column;
  }
}
