/* WP Firefly Popup - Frontend Styles */

/* ── Overlay ─────────────────────────────────── */
.wpfp-popup-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999999;
  display: none;           /* hidden by default, JS sets to flex */
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.wpfp-popup-overlay.wpfp-visible {
  display: flex !important;
  opacity: 1;
  visibility: visible;
}

/* ── Container ────────────────────────────────── */
.wpfp-popup-container {
  position: relative;
  flex-shrink: 0;          /* don't squish the popup */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* ── The inner popup scales on mobile via wrapper ── */
.wpfp-popup-container .custom-popup {
  overflow: hidden;
  transform-origin: top left;
}

/* ── Close button ─────────────────────────────── */
.wpfp-popup-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff;
  border: none;
  font-size: 18px; line-height: 1;
  cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.wpfp-popup-close:hover {
  background: #e74c3c;
}

/* ── Element resets ───────────────────────────── */
.custom-popup input,
.custom-popup textarea,
.custom-popup select,
.custom-popup button { box-sizing: border-box; }
.custom-popup .popup-textbox,
.custom-popup .popup-text {
  display: inline-block; white-space: pre-wrap;
  word-wrap: break-word; overflow: hidden;
}
.custom-popup .popup-icon {
  display: inline-flex; align-items: center; justify-content: center;
}
.custom-popup .popup-custom-button {
  cursor: pointer; text-decoration: none;
}

/* ── Entrance animations ──────────────────────── */
@keyframes wpfpFadeIn      { from { opacity: 0; }                                to { opacity: 1; } }
@keyframes wpfpSlideIn     { from { opacity: 0; transform: translateY(-50px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes wpfpZoomIn      { from { opacity: 0; transform: scale(0.7); }         to { opacity: 1; transform: scale(1); } }
@keyframes wpfpSlideInUp   { from { opacity: 0; transform: translateY(100px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes wpfpSlideInLeft { from { opacity: 0; transform: translateX(-100%); }  to { opacity: 1; transform: translateX(0); } }
@keyframes wpfpSlideInRight{ from { opacity: 0; transform: translateX(100%); }   to { opacity: 1; transform: translateX(0); } }

/* ── Exit animations ──────────────────────────── */
@keyframes wpfpFadeOut       { from { opacity: 1; }                                to { opacity: 0; } }
@keyframes wpfpSlideOut      { from { opacity: 1; transform: translateY(0); }     to { opacity: 0; transform: translateY(-50px); } }
@keyframes wpfpZoomOut       { from { opacity: 1; transform: scale(1); }          to { opacity: 0; transform: scale(0.7); } }
@keyframes wpfpSlideOutDown  { from { opacity: 1; transform: translateY(0); }     to { opacity: 0; transform: translateY(100%); } }
@keyframes wpfpSlideOutLeft  { from { opacity: 1; transform: translateX(0); }     to { opacity: 0; transform: translateX(-100%); } }
@keyframes wpfpSlideOutRight { from { opacity: 1; transform: translateX(0); }     to { opacity: 0; transform: translateX(100%); } }

.wpfp-popup-container.wpfp-fadeIn       { animation: wpfpFadeIn      0.4s ease forwards; }
.wpfp-popup-container.wpfp-slideIn      { animation: wpfpSlideIn     0.4s ease forwards; }
.wpfp-popup-container.wpfp-zoomIn       { animation: wpfpZoomIn      0.4s ease forwards; }
.wpfp-popup-container.wpfp-slideInUp    { animation: wpfpSlideInUp   0.4s ease forwards; }
.wpfp-popup-container.wpfp-slideInLeft  { animation: wpfpSlideInLeft  0.4s ease forwards; }
.wpfp-popup-container.wpfp-slideInRight { animation: wpfpSlideInRight 0.4s ease forwards; }
.wpfp-popup-container.wpfp-fadeOut       { animation: wpfpFadeOut      0.3s ease forwards; }
.wpfp-popup-container.wpfp-slideOut      { animation: wpfpSlideOut     0.3s ease forwards; }
.wpfp-popup-container.wpfp-zoomOut       { animation: wpfpZoomOut      0.3s ease forwards; }
.wpfp-popup-container.wpfp-slideOutDown  { animation: wpfpSlideOutDown  0.3s ease forwards; }
.wpfp-popup-container.wpfp-slideOutLeft  { animation: wpfpSlideOutLeft  0.3s ease forwards; }
.wpfp-popup-container.wpfp-slideOutRight { animation: wpfpSlideOutRight 0.3s ease forwards; }

/* ── Position variants ────────────────────────── */

/* No overlay (slide-ins, bars, floating boxes) */
.wpfp-popup-overlay.wpfp-no-overlay {
  background: none !important;
  pointer-events: none;
}
.wpfp-no-overlay .wpfp-popup-container {
  pointer-events: auto;
}

/* Fullscreen */
.wpfp-pos-fullscreen .wpfp-popup-container {
  width: 100vw !important; max-width: 100vw !important;
  height: 100vh !important; max-height: 100vh !important;
  border-radius: 0;
}
.wpfp-pos-fullscreen .custom-popup {
  width: 100% !important; height: 100% !important;
}

/* Top/Bottom bars */
.wpfp-pos-top-bar    { align-items: flex-start !important; justify-content: center !important; }
.wpfp-pos-bottom-bar { align-items: flex-end !important;   justify-content: center !important; }
.wpfp-pos-top-bar .wpfp-popup-container,
.wpfp-pos-bottom-bar .wpfp-popup-container {
  width: 100% !important; max-width: 100% !important;
  border-radius: 0; margin: 0;
}

/* Corner positions */
.wpfp-pos-top-left     { align-items: flex-start !important; justify-content: flex-start !important; padding: 20px; }
.wpfp-pos-top-right    { align-items: flex-start !important; justify-content: flex-end !important;   padding: 20px; }
.wpfp-pos-bottom-left  { align-items: flex-end !important;   justify-content: flex-start !important; padding: 20px; }
.wpfp-pos-bottom-right { align-items: flex-end !important;   justify-content: flex-end !important;   padding: 20px; }

/* Slide-ins (no overlay) */
.wpfp-pos-slide-bottom { align-items: flex-end !important;   justify-content: center !important;     padding: 20px; }
.wpfp-pos-slide-left   { align-items: center !important;     justify-content: flex-start !important; padding: 0; }
.wpfp-pos-slide-right  { align-items: center !important;     justify-content: flex-end !important;   padding: 0; }

/* Slide-in / floating containers */
.wpfp-pos-slide-bottom .wpfp-popup-container,
.wpfp-pos-slide-left .wpfp-popup-container,
.wpfp-pos-slide-right .wpfp-popup-container,
.wpfp-pos-top-left .wpfp-popup-container,
.wpfp-pos-top-right .wpfp-popup-container,
.wpfp-pos-bottom-left .wpfp-popup-container,
.wpfp-pos-bottom-right .wpfp-popup-container {
  border-radius: 12px;
  margin: 0;
}

/* ── Transparent background popups ─────────────── */
.wpfp-popup-container.wpfp-transparent-bg {
  background: transparent;
  box-shadow: none;
}
