/* Enlarge Image Component Styles */

.enlarge-image-component {
  margin: 1rem 0;
}

/* Fullscreen thumb wrapper */
.fs-thumb {
  position: relative;
  display: block;
  max-width: 600px;
  margin: 1rem auto;
  cursor: zoom-in;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
}

/* Blurry preview image */
.fs-thumb > img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.8) blur(0.2px);
  transform: scale(1.02);
  transition: filter 0.25s ease, transform 0.25s ease;
}

.fs-thumb:hover > img {
  filter: brightness(1) blur(0.1px);
  transform: scale(1.03);
}

/* Magnifying glass icon overlay */
.fs-thumb .fs-icon {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 1rem;
  transition: background 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.fs-thumb:hover .fs-icon {
  background: rgba(0, 0, 0, 0.35);
  transform: scale(1.02);
}

/* Placeholder when no image */
.image-placeholder {
  width: 100%;
  height: 300px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 1rem;
  border-radius: 8px;
}

/* Caption styling */
.enlarge-image-component .text-center {
  color: #333;
  margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fs-thumb {
    max-width: 100%;
    margin: 0.5rem auto;
  }
}

/* Modal styles */
/* Target modals even when moved to body */
.modal[id^="imageModal"],
.enlarge-image-component .modal {
  z-index: 1055 !important;
}

.modal[id^="imageModal"].show,
.enlarge-image-component .modal.show {
  z-index: 1055 !important;
}

.modal[id^="imageModal"] .modal-dialog,
.enlarge-image-component .modal-dialog {
  z-index: 1056 !important;
  position: relative;
}

.modal[id^="imageModal"] .modal-content,
.enlarge-image-component .modal-content {
  position: relative;
  z-index: 1057 !important;
}

.modal[id^="imageModal"] .modal-body,
.enlarge-image-component .modal-body {
  position: relative;
  z-index: 1058 !important;
}

.modal[id^="imageModal"] .modal-body img,
.enlarge-image-component .modal-body img {
  position: relative;
  z-index: 1059 !important;
}

/* Ensure backdrop stays behind modal content - Bootstrap backdrop is appended to body */
body > .modal-backdrop {
  z-index: 1050 !important;
}

body > .modal-backdrop.show {
  z-index: 1050 !important;
}

/* Close button styling */
/* Target modal close button even when modal is moved to body */
.modal[id^="imageModal"] .modal-close-btn,
.enlarge-image-component .modal-close-btn {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 1060 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto !important;
}

.modal[id^="imageModal"] .modal-close-btn:hover,
.enlarge-image-component .modal-close-btn:hover {
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.modal[id^="imageModal"] .modal-close-btn:active,
.enlarge-image-component .modal-close-btn:active {
  transform: translateY(0);
}
