/* css/image-overlay.css */
/* Image Overlay Styles */
.clickable-image {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clickable-image:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-overlay.active {
  opacity: 1;
  visibility: visible;
}

.overlay-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.overlay-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 5px;
}

/* FIXED: Close button positioned relative to viewport, not overlay-content */
.close-overlay {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #5BC1AC;
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
  z-index: 10000; /* Higher than overlay z-index */
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.close-overlay:hover {
  background: #4aa892;
  transform: scale(1.1);
}

.image-counter {
  position: absolute;
  bottom: -40px;
  left: 0;
  color: white;
  font-size: 16px;
  background: rgba(0,0,0,0.7);
  padding: 5px 10px;
  border-radius: 4px;
}

.nav-button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(91, 193, 172, 0.7);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
  z-index: 10000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-button:hover {
  background: #5BC1AC;
  transform: translateY(-50%) scale(1.1);
}

.prev-button {
  left: 20px;
}

.next-button {
  right: 20px;
}

@media (max-width: 768px) {
  .nav-button {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .prev-button {
    left: 10px;
  }

  .next-button {
    right: 10px;
  }

  .close-overlay {
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: 15px;
    right: 15px;
  }
}
