/* ==========================================================================
   POPUP MODAL - MODERN GLASSMORPHISM STYLE
   ========================================================================== */

:root {
  --popup-z-index: 9999;
}

/* Overlay Gelap dengan Glassmorphism Blur */
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65); /* Modern Slate Dark Tone */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: calc(var(--popup-z-index) - 1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Container Popup Box */
#popup-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  z-index: var(--popup-z-index);
  max-width: 90%;
  max-height: 85vh;
  padding: 0;
  background: transparent;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
              opacity 0.3s ease, 
              visibility 0.3s ease;
  will-change: transform, opacity;
}

#popup-box.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* Frame & Elemen Gambar */
#popup-box img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
  cursor: pointer;
  border: 3px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#popup-box img:hover {
  transform: scale(1.01);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Responsive Optimization */
@media (max-width: 576px) {
  #popup-box {
    max-width: 95%;
  }
  #popup-box img {
    max-height: 70vh;
  }
}