/* Main application container */
.imajs-app {
  font-family: Arial, sans-serif;
  display: flex;
  flex-wrap: wrap;         /* Allow flex items to wrap */
  justify-content: flex-start;
  gap: 20px;
  width: 100%;             /* Ensure it takes full width */
  max-width: 800px;        /* Max width of the application */
  margin: auto;            /* Center the app */
  box-sizing: border-box;  /* Ensure padding and borders don't affect width calculation */
}

/* Layout for individual module containers */
.imajs-upload-container,
.imajs-gallery-container,
.imajs-viewer-container,
.imajs-toolbox-container {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Upload container */
.imajs-upload {
  border: 2px dashed rgba(255, 79, 40, 0.4);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 10px;
  width: 100%;
  transition: border 0.2s ease-in-out, background 0.2s ease-in-out;
  border-radius: 16px;
  background: rgba(255, 79, 40, 0.04);
  color: var(--text-gray, #4a4a4a);
}

.imajs-upload:hover,
.imajs-upload.imajs-upload-hover {
  border-color: var(--brand-orange, #ff4f28);
  background: rgba(255, 79, 40, 0.08);
}

/* Gallery container to handle thumbnail layout */
/* Gallery container to handle thumbnail layout */
.imajs-gallery-container {
  display: flex;
  flex-wrap: wrap;               /* Allow thumbnails to wrap */
  justify-content: flex-start;   /* Align items to the left */
  gap: 10px;                     /* Space between thumbnails */
  width: 100%;                   /* Ensure gallery takes full width */
  padding: 10px;
  box-sizing: border-box;        /* Ensures padding doesn't affect layout */
  flex-grow: 1;                  /* Ensure it takes available space */
  min-width: 0;                  /* Prevent gallery container from being too small */
  align-items: flex-start;       /* Align items to the top */
  flex-direction: row;
	position:relative;
	overflow:visible !important;
}

/* Thumbnail container */
.imajs-thumbnail {
  width: 100px;                  /* Fixed width for thumbnails */
  height: 100px;                 /* Fixed height for thumbnails */
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease-in-out;
  flex-shrink: 0;                /* Prevent shrinking when wrapping */
  display: inline-flex;          /* Ensures thumbnails are treated as inline */
  align-items: center;           /* Ensure the image is aligned inside */
  justify-content: center;       /* Centers the content (image) inside */
}

/* Hover effect */
.imajs-thumbnail:hover {
  transform: scale(1.05);        /* Slight zoom effect on hover */
}

/* Delete icon button */
.imajs-delete-icon {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  background-color: red;
  color: white;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease-in-out;
}

.imajs-delete-icon:hover {
  background-color: darkred;
}

/* Proper '×' symbol */
.imajs-delete-icon::before {
  content: "\00D7";  /* Unicode for × symbol */
}




/* Viewer container */
.imajs-viewer-container {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1 / 1;
  background: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  border-radius: 10px;
  margin: 0 auto;
}

/* Preview frame inside viewer */
.imajs-preview-container {
  overflow: hidden;
  outline: 1px solid black;
  position:relative;
	cursor:grab;
	-webkit-user-select: none; /* Chrome, Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE 10+ */
  user-select: none; 
}
.imajs-preview-container:active {
	cursor:grabbing;
}

.imajs-preview-container canvas {
    position: absolute;
    /* top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); */
}

/* Toolbox (buttons and controls) */
.imajs-toolbox-container {
  display: flex;
    gap: 10px;
    justify-content: space-evenly;
    margin-top: 10px;
    flex-direction: row;
    flex-wrap: wrap;
}
.imajs-zoom-slider {
  width:100%;
  accent-color: var(--brand-orange, #ff4f28);
  height: 6px;
}
.imajs-zoom-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
}
.imajs-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-orange, #ff4f28);
  border: none;
  box-shadow: 0 2px 6px rgba(255, 79, 40, 0.35);
  margin-top: -6px;
}
.imajs-zoom-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
}
.imajs-zoom-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-orange, #ff4f28);
  border: none;
  box-shadow: 0 2px 6px rgba(255, 79, 40, 0.35);
}
.imajs-zoom-slider-label {
  width:100%;
	margin-right:.5rem;
	min-width:300px;
	max-width:450px;
}


/* Toolbox buttons */
.imajs-toolbox-container button {
  padding: 10px 20px;
  border: none;
  background-color: var(--brand-orange, #ff4f28);
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
	display:inline;
	margin-right:.5rem;
  box-shadow: 0 4px 12px rgba(255, 79, 40, 0.25);
  font-weight: 600;
}



.imajs-toolbox button:hover,
.imajs-toolbox-container button:hover {
  background-color: #e04521;
  box-shadow: 0 6px 16px rgba(255, 79, 40, 0.35);
}

.imajs-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: imajs-spin 0.8s linear infinite;
}

@keyframes imajs-spin {
  from {
      transform: rotate(0deg);
  }
  to {
      transform: rotate(360deg);
  }
}