#image-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: black;
}

.fade-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;  /* preserve aspect ratio */
  background-color: black;
  transition: opacity 1s ease-in-out;
  opacity: 0;
  pointer-events: none;
}

#imgA {
  z-index: 1;
}

#imgB {
  z-index: 2;
}



#controls {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  z-index: 100;
}

#controls button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

#controls button:hover {
  background: rgba(255, 255, 255, 0.4);
}

#fadeSliderGroup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: white;
  font-size: 1rem;
}

#fadeSpeedSlider {
  -webkit-appearance: none;
  width: 150px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

#fadeSpeedSlider:hover {
  background: rgba(255, 255, 255, 0.4);
}

#fadeSpeedSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 0 2px black;
  transition: background 0.3s ease;
}

#fadeSpeedSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 0 2px black;
}
#pauseImg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 99; /* must be higher than imgA and img B */
  background-color: rgb(0, 0, 0); /* fallback if image fails */

  opacity: 0;
  pointer-events: none;
  transition: none !important;
  
}


/* Hide these during pause */
/* Hide visually but retain layout */
body.paused #pauseImg {
  opacity: 1;
  pointer-events: auto;
}
/* Hide other controls during pause */
body.paused #prevBtn,
body.paused #nextBtn,
body.paused #fadeSliderGroup {
  visibility: hidden;

}
body.paused #pauseBtn {
  visibility: visible !important;
}

body.paused #pauseBtnWrapper {
  display: block !important;
}

#pauseOverlayText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: bold;
  color: white; 
  text-shadow:
    0 0 10px rgba(255, 0, 0, 0.8),
    0 0 20px rgba(255, 0, 0, 0.6),
    0 0 30px rgba(255, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
  z-index: 101;
}

body.paused #pauseOverlayText {
  opacity: 1;
}