.popover {
  max-width: 160px !important; /* keeps it small */
}

.popover img {
  width: 120px;
  height: auto;
  border-radius: 6px;
  display: block;
}

.img-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  border-radius: 999px;
  padding: 4px;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.img-modal img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 10px;
}

.close-btn {
  position: absolute;
  top: 15px; right: 20px;
  color: white;
  font-size: 32px;
  cursor: pointer;
}

.modal-header .btn-close {
  filter: invert(0) !important;  /* black icon */
  background-color: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.4);
}

#imageModal .btn-close {
    background-color: rgba(255,255,255,0.85);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.4);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    filter: invert(0); /* black X */
}

.update-btn {
  display: none;
  margin-top: 15px;
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border-radius: 6px;
  text-decoration: none;
}

.preview-hover {
  transition: transform 0.2s ease-in-out;
}

.preview-hover:hover {
  transform: scale(3.0);
  z-index: 10;
  position: relative;
}

@media (max-width: 768px) {
  .preview-hover:hover {
    transform: none !important;
  }
}

/* Boxed close button — always visible */
.image-close-btn {
  background-color: rgba(255,255,255,0.85);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: 0 2px 6px rgba(0,0,0,0.45);
  z-index: 9999 !important;
}

/* Thumbnail strip */
.image-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  margin-right: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform .15s;
  border: 2px solid transparent;
}

.image-thumb:hover {
  transform: scale(1.05);
}

/* Highlight current thumbnail */
.image-thumb.active {
  border: 2px solid #fff;
}

/* Add button */
.image-thumb-add {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px dashed #aaa;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  cursor: pointer;
}
.image-thumb-add:hover {
  background: rgba(255,255,255,0.25);
}

.modal-close-circle.btn-close-white {
  filter: invert(1);
}
