/* Overlay covers the entire screen */
#custom-lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 20px;
}

/* Container holding the elements */
#lightbox-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Wrapper - Handled completely by jQuery animations */
#lightbox-content-wrapper {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
  overflow: hidden;
  box-sizing: border-box;
  padding:  5px;
}

/* Image scales relative to the container sizes */
#lightbox-image {
  width: 100%;
  height: auto;
  height: 100vh;
  display: block;
}

/* Caption Area */
#lightbox-caption {
  background: #ffffff;
  color: #000000;
  padding: 15px;
  font-family: sans-serif;
  font-size: 16px;
  text-align: center;
  border-top: 1px solid #eee;
}

/* Navigation Buttons (Layered on top of image) */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-70%);
  background: transparent; /* No background */
  color: #FFF;
  border: none;
  font-size: 32px; /* Made slightly larger for better visibility without a background */
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  opacity: 0; /* Hidden by default */
  background:  #333;
  transition: opacity 0.9s ease; /* Smooth adjustable fade duration */
  padding:  10px;

}

#lightbox-close {
  position: absolute;
  top: -55px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 35px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

/* Hover States */
#lightbox-container:hover .lightbox-nav,
#lightbox-container:hover #lightbox-close {
  opacity: 1;
}

#lightbox-prev { left: 30px; }
#lightbox-next { right: 30px; }

/* --- Loading Container & Spinner Styles --- */
#lightbox-loader-container {
  display: none; /* Hidden by default */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10002; /* Sits completely on top of everything */
}

.lightbox-loader-text {
  color: black;
  font-family: sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 15px; /* Spacing between text and the spinning circle */
  display: block;
}

#lightbox-loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  border-top-color: #000; /* White spinning segment */
  display: inline-block;
  animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
  to { transform: rotate(360deg); }
}