#gif_popup_wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#gif_popup_wrapper.active {
  opacity: 1;
  visibility: visible;
}

body.popup-open {
  overflow: hidden;
}

#gif_popup_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

#gif_popup_container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
}

#gif_popup_close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
}

#gif_popup_close img {
  width: 100%;
  height: 100%;
  display: block;
}

#gif_popup_close:hover {
  transform: scale(1.1);
}

#gif_popup_close:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#gif_popup_link {
  display: block;
}

#gif_popup_image {
  max-width: 90vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: block;
}

@media (max-width: 768px) {
  #gif_popup_close {
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
  }
}
