/* image uploader  */

.imupl-files-list {
  width: 100%;
  min-height: 200px;
  border: 1px solid grey;
  border-radius: 10px;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap; 
  justify-content: space-between;
  overflow: hidden; /* Added to handle overflow from rotations */
  padding: 5%;
}

.imupl-file-item {
  width: 31%;
  height: 150px;
  background-color: #F5F5F5;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  background-image: url('https://carmarket.lk/assets/img_upload/loading.gif');
  margin-top: 0;
  margin-bottom: 15px;
  border-radius: 10px;
  border: 2px solid #e6e6e6;
  overflow: hidden;
  position: relative;
  cursor: move;
  transition: transform 0.1s ease;
}


@media (max-width: 480px) {
  .imupl-file-item {
    width: 46%;
   
  }
}


.imupl-file-item:nth-child(1) {
  border: 2px solid blue;
}

.imupl-file-item:nth-child(1)::before {
  content: "MAIN";
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  border-top-left-radius: 10px;
  background: blue;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 6px;
}



.imupl-file-item .imupl-button-remove, 
.imupl-file-item .imupl-button-edit, 
.imupl-file-item .imupl-button-rotate-cw, 
.imupl-file-item .imupl-button-rotate-ccw {
  display: block;
  position: absolute;
  background: #e6e6e6;
  font-size: 18px;
  padding: 3px 6px;
  cursor: pointer;
}

.imupl-file-item.loading .imupl-button-remove, 
.imupl-file-item.loading .imupl-button-edit, 
.imupl-file-item.loading .imupl-button-rotate-cw, 
.imupl-file-item.loading .imupl-button-rotate-ccw {
  display: none;
}

.imupl-file-item .imupl-button-remove {
  left: 0;
  top: 0;
  border-bottom-right-radius: 10px;
  padding-right: 10px;
}

.imupl-file-item .imupl-button-edit {
  right: 0;
  top: 0;
  border-bottom-left-radius: 10px;
  padding-left: 10px;
}

.imupl-file-item .imupl-button-rotate-cw {
  bottom: 0;
  left: 30px;
  border-top-right-radius: 10px;
  padding-left: 10px;
}

.imupl-file-item .imupl-button-rotate-ccw {
  bottom: 0;
  left: 0;
  padding-left: 10px;
  
}



.imupl-fileinput {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: fixed;
  left: -10px;
}

.imupl-dragdrop-hover {
  z-index: 9999;
  position: fixed;
  top: 25px;
  left: 25px;
  right: 25px;
  bottom: 25px;
  border: 5px rgba(0, 150, 0, 0.5) dashed;
  border-radius: 25px;
  background: rgba(0, 150, 0, 0.1);
  display: none;
  pointer-events: none;
}

.imupl-dragdrop-hover.active {
  display: initial;
}


.imupl-edit-overlay {
  display: flex !important; /* Ensure it's displayed as a flex container */
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  background:rgba(0,0,0,0.5);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1055; /* Adjust z-index to be higher than Bootstrap modals */
  transition: opacity 0.9s ease-in-out;
}

.imupl-edit-overlay.active {
  opacity: 1 !important; /* Override any Bootstrap opacity settings */
  pointer-events: auto;
}

.imupl-edit-overlay .thumbnail {
  transform: translateY(-100%);
  transition: transform 0.9s ease-in-out;
  background-color: rgb(255, 255, 255); /* Ensure background visibility */
  padding: 20px; /* Space around content */
  border-radius: 5px;
  max-width: 90%;
  max-height: 90%;
 
  overflow: hidden; 
}


.imupl-edit-overlay.active .thumbnail {
  transform: translateY(0) !important; /* Override Bootstrap's translate */
}

.imupl-crop-wrapper {
  position: relative;
  margin-bottom: 15px;
  max-width: 100%;
  max-height: 100%;
}

.imupl-cropper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid rgba(0, 0, 0, 0.5);
  cursor: move; /* Indicate draggable area */
}

.imupl-cropper-start,
.imupl-cropper-end {
  position: absolute;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
}

.imupl-cropper-start {
  top: -10px;
  left: -10px;
  border-top: 4px solid black;
  border-left: 4px solid black;
  z-index: 1060; /* Ensure cropper controls are on top */
}

.imupl-cropper-end {
  bottom: -10px;
  right: -10px;
  border-bottom: 4px solid black;
  border-right: 4px solid black;
  z-index: 1060;
}

.imupl-button-edit-save {
  float: right;
  margin-top: 10px;
}

