/*
 * Public-facing CSS for My Popup Plugin
 */

.my-popup-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: none; /* <-- ADD THIS LINE */
}

.my-popup-wrapper.is-visible {
  opacity: 1;
  visibility: visible;
  display: flex; /* <-- CHANGE FROM 'none' TO 'flex' */
}

.my-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.my-popup-content-box {
  position: relative;
  background: #fff;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  z-index: 2;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.my-popup-close-btn {
  position: absolute;
  top: 5px;
  right: 5px;

  /* --- THE CRITICAL FIX IS HERE --- */
  z-index: 10; /* This lifts the button above the content */

  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #333;
  font-size: 30px;
  font-weight: normal;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.my-popup-close-btn:hover {
  background-color: #f1f1f1;
  color: #000;
  /* We remove the 'opacity' change in favor of a cleaner background color change */
}

/* This allows Elementor styles to apply correctly within the popup */
.my-popup-inner-content {
  /* You might add some specific container styles here if needed */
}

/* === POPUP ANIMATIONS === */

/* Default Fade In (already handled by opacity transition) */

/* Slide In From Top */
@keyframes slideInTop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.slide-in-top.is-visible .my-popup-content-box {
    animation: slideInTop 0.5s ease-out forwards;
}

/* Zoom In */
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.zoom-in.is-visible .my-popup-content-box {
    animation: zoomIn 0.3s ease-out forwards;
}

/* Bounce In */
@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}
.bounce-in.is-visible .my-popup-content-box {
    animation: bounceIn 0.6s ease-out forwards;
  }
