@keyframes popupFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popupFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes fadeBackgroundIn {
  from { background: rgba(0, 0, 0, 0); }
  to { background: rgba(0, 0, 0, 0.6); }
}

@keyframes fadeBackgroundOut {
  from { background: rgba(0, 0, 0, 0.6); }
  to { background: rgba(0, 0, 0, 0); }
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation-fill-mode: forwards;
}

.popup-overlay:not(.active):not(.closing) {
  display: none;
}

.popup-box {
  background: #fff;
  padding: 2em;
  border-radius: 10px;
  text-align: center;
  max-width: 90%;
  width: 320px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.popup-overlay.active {
  animation: fadeBackgroundIn 0.3s ease forwards;
}
.popup-overlay.active .popup-box {
  animation: popupFadeIn 0.3s ease forwards;
}

.popup-overlay.closing {
  animation: fadeBackgroundOut 0.3s ease forwards;
}
.popup-overlay.closing .popup-box {
  animation: popupFadeOut 0.3s ease forwards;
}

/* Style for buttons */
.popup-box button {
  background-color: #E50418 !important;
  color: #fff !important;
  border: none;
  padding: 0.6em 1.2em;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.popup-box button:hover {
  background-color: #b00312 !important;
}

/* Style for links inside the popup */
.popup-box a {
  color: #E50418 !important;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease;
}

.popup-box a:hover {
  color: #b00312 !important;
  text-decoration: underline;
}
