.lightbox {
  cursor: pointer;
  border: none;
}

#lightbox-root {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  justify-content: center;
  align-items: center;
  transition: background-color 0.5s ease;
  z-index: 3;
}

#lightbox-root.showed {
  background-color: rgba(0, 0, 0, 0.6);
}

#lightbox-root:not(.showed) #lightbox-container {
  opacity: 0;
}

body:has(#lightbox-root.showed) {
  overflow-y: hidden; /* Block scrolling */
}

#lightbox-root.showed #lightbox-container {
  opacity: 1;
}

#lightbox-container {
  min-width: 200px;
  min-height: 200px;
  background-color: rgba(228, 228, 228);

  transition: opacity 0.3s ease;

  border-radius: 5px;
  border: 3px solid white;
  position: relative;
}

#lightbox-img.showed + #lightbox-close {
  opacity: 1;
}

#lightbox-close {
  position: absolute;
  z-index: 2;
  top: calc(100% + 10px);
  right: 0;

  opacity: 0;
  transition: opacity 0.25s ease;
  
  color: white;
  font-size: 30px;
  cursor: pointer;
}

#lightbox-img {
  z-index: 1;
  position: relative;

  max-height: 90vh;
  max-width: 90vw;

  opacity: 0;
  transition: opacity 0.25s ease;
}

#lightbox-img.showed {
  opacity: 1;
}

#lightbox-loader {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#lightbox-loader-icon {
  font-size: 60px;
  animation: 2s linear 0s infinite rotating;
}

@keyframes rotating {
  from { transform: rotate(0deg) }
  to { transform: rotate(360deg) }
}