/**
 * Django Image Uploader Widget - An image uploader widget for django.
 * @version v0.1.0
 * @author Eduardo Oliveira (EduardoJM) <eduardo_y05@outlook.com>.
 * @link https://github.com/inventare/django-image-uploader-widget
 * 
 * Licensed under the MIT License (https://github.com/inventare/django-image-uploader-widget/blob/main/LICENSE).
 */

body {
  --iuw-background: #FFF;
  --iuw-border-color: #CCC;
  --iuw-color: #333;
  --iuw-placeholder-text-color: #AAA;
  --iuw-placeholder-destak-color: #417690;
  --iuw-dropzone-background: rgba(255, 255, 255, 0.8);
  --iuw-image-preview-border: #BFBFBF;
  --iuw-image-preview-shadow: rgba(0, 0, 0, 0.3);
  --iuw-add-image-background: #EFEFEF;
  --iuw-add-image-color: #AAA;
}
@keyframes arrow-flashing {
  from {
    opacity: 0;
    transform: scale(0) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.iuw-root, .iuw-root * {
  box-sizing: border-box;
}

.iuw-root {
  /* base widget */
  /* behaviour */
  user-select: none;
  /* sizing */
  min-width: 300px;
  height: 200px;
  /* shape */
  border-radius: 5px;
  padding: 5px;
  /* styles */
  background-color: var(--iuw-background);
  border: 3px dashed var(--iuw-border-color);
  color: var(--iuw-color);
  /* positioning */
  position: relative;
  /* overflowing */
  overflow-y: hidden;
  overflow-x: auto;
  /* childs */
  display: flex;
  flex-direction: row;
  align-items: stretch;
  /* empty label */
  /* drop label */
  /* image preview */
}
.iuw-root input[type=file],
.iuw-root input[type=checkbox] {
  display: none;
}
.iuw-root .iuw-empty {
  /* positioning */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  z-index: 50;
  /* display */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* text */
  text-align: center;
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: var(--iuw-placeholder-text-color);
  /* behaviour */
  cursor: pointer;
  /* animations */
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease;
  /* childs */
}
.iuw-root .iuw-empty > svg {
  width: 50px;
  height: 50px;
  margin-bottom: 30px;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
}
.iuw-root .iuw-empty:hover > svg {
  width: 80px;
  height: 80px;
  margin-bottom: 10px;
}
.iuw-root .iuw-empty > span {
  text-align: center;
}
.iuw-root .iuw-empty > span span {
  color: var(--iuw-placeholder-destak-color);
}
.iuw-root:not(.non-empty) .iuw-empty {
  height: 100%;
  opacity: 1;
}
.iuw-root.drop-zone .iuw-empty {
  height: 0;
  opacity: 0;
}
.iuw-root .iuw-drop-label {
  /* positioning */
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  /* style */
  background: var(--iuw-dropzone-background);
  /* display */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* text */
  text-align: center;
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: var(--iuw-placeholder-text-color);
  /* behaviour */
  cursor: grabbing;
  /* animations */
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease;
  /* childs */
}
.iuw-root .iuw-drop-label > svg {
  width: 90px;
  height: 90px;
  margin-bottom: 20px;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
}
.iuw-root .iuw-drop-label > svg path:last-child {
  transform-origin: 50% 100%;
  animation: arrow-flashing 1.1s;
  animation-timing-function: ease-in;
  animation-fill-mode: both;
  animation-iteration-count: infinite;
  animation-delay: 0.3s;
}
.iuw-root .iuw-drop-label > span {
  text-align: center;
}
.iuw-root .iuw-drop-label > span span {
  color: var(--iuw-placeholder-destak-color);
}
.iuw-root.drop-zone .iuw-drop-label {
  height: 100%;
  opacity: 1;
}
.iuw-root .iuw-image-preview {
  /* style */
  border: 1px solid var(--iuw-image-preview-border);
  box-shadow: 0 0 4px 0 var(--iuw-image-preview-shadow);
  /* shape */
  width: 160px;
  margin: 0 5px;
  border-radius: 5px;
  overflow: hidden;
  /* behaviour */
  cursor: pointer;
  /* positioning */
  position: relative;
  /* childs */
}
.iuw-root .iuw-image-preview img {
  /* sizing */
  width: 100%;
  height: 100%;
  /* display mode */
  object-fit: cover;
  object-position: center;
}
.iuw-root .iuw-image-preview .iuw-delete-icon {
  /* shape */
  width: 32px;
  height: 32px;
  border-radius: 0 5px 0 0;
  /* styles */
  border: 1px solid #BFBFBF;
  border-top: none;
  border-right: none;
  background-color: #F5F5F5;
  opacity: 0.6;
  /* positioning */
  position: absolute;
  right: 0;
  top: 0;
  z-index: 45;
  /* display */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* animations */
  transition: opacity 0.3s ease;
  /* icon */
}
.iuw-root .iuw-image-preview .iuw-delete-icon svg {
  width: 16px;
  height: auto;
  transform: none;
  transition: transform 0.3s ease;
}
.iuw-root .iuw-image-preview:hover .iuw-delete-icon {
  opacity: 1;
}
.iuw-root .iuw-image-preview:hover .iuw-delete-icon svg {
  transform: scale(1.3);
}

.iuw-inline-root, .iuw-inline-root * {
  box-sizing: border-box;
}

.iuw-inline-root {
  /* base widget */
  /* behaviour */
  user-select: none;
  /* sizing */
  min-width: 300px;
  height: 200px;
  /* shape */
  border-radius: 5px;
  padding: 5px;
  /* styles */
  background-color: var(--iuw-background);
  border: 3px dashed var(--iuw-border-color);
  color: var(--iuw-color);
  /* positioning */
  position: relative;
  /* overflowing */
  overflow-y: hidden;
  overflow-x: auto;
  /* childs */
  display: flex;
  flex-direction: row;
  align-items: stretch;
  /* empty label */
  /* drop label */
  /* image preview */
  /* images carousel */
  /* add button */
}
.iuw-inline-root input[type=file],
.iuw-inline-root input[type=checkbox] {
  display: none;
}
.iuw-inline-root .iuw-empty {
  /* positioning */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  z-index: 50;
  /* display */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* text */
  text-align: center;
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: var(--iuw-placeholder-text-color);
  /* behaviour */
  cursor: pointer;
  /* animations */
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease;
  /* childs */
}
.iuw-inline-root .iuw-empty > svg {
  width: 50px;
  height: 50px;
  margin-bottom: 30px;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
}
.iuw-inline-root .iuw-empty:hover > svg {
  width: 80px;
  height: 80px;
  margin-bottom: 10px;
}
.iuw-inline-root .iuw-empty > span {
  text-align: center;
}
.iuw-inline-root .iuw-empty > span span {
  color: var(--iuw-placeholder-destak-color);
}
.iuw-inline-root:not(.non-empty) .iuw-empty {
  height: 100%;
  opacity: 1;
}
.iuw-inline-root.drop-zone .iuw-empty {
  height: 0;
  opacity: 0;
}
.iuw-inline-root .iuw-drop-label {
  /* positioning */
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  /* style */
  background: var(--iuw-dropzone-background);
  /* display */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* text */
  text-align: center;
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: var(--iuw-placeholder-text-color);
  /* behaviour */
  cursor: grabbing;
  /* animations */
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease;
  /* childs */
}
.iuw-inline-root .iuw-drop-label > svg {
  width: 90px;
  height: 90px;
  margin-bottom: 20px;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
}
.iuw-inline-root .iuw-drop-label > svg path:last-child {
  transform-origin: 50% 100%;
  animation: arrow-flashing 1.1s;
  animation-timing-function: ease-in;
  animation-fill-mode: both;
  animation-iteration-count: infinite;
  animation-delay: 0.3s;
}
.iuw-inline-root .iuw-drop-label > span {
  text-align: center;
}
.iuw-inline-root .iuw-drop-label > span span {
  color: var(--iuw-placeholder-destak-color);
}
.iuw-inline-root.drop-zone .iuw-drop-label {
  height: 100%;
  opacity: 1;
}
.iuw-inline-root .inline-related {
  /* style */
  border: 1px solid var(--iuw-image-preview-border);
  box-shadow: 0 0 4px 0 var(--iuw-image-preview-shadow);
  /* shape */
  width: 160px;
  margin: 0 5px;
  border-radius: 5px;
  overflow: hidden;
  /* behaviour */
  cursor: pointer;
  /* positioning */
  position: relative;
  /* childs */
}
.iuw-inline-root .inline-related img {
  /* sizing */
  width: 100%;
  height: 100%;
  /* display mode */
  object-fit: cover;
  object-position: center;
}
.iuw-inline-root .inline-related .iuw-delete-icon {
  /* shape */
  width: 32px;
  height: 32px;
  border-radius: 0 5px 0 0;
  /* styles */
  border: 1px solid #BFBFBF;
  border-top: none;
  border-right: none;
  background-color: #F5F5F5;
  opacity: 0.6;
  /* positioning */
  position: absolute;
  right: 0;
  top: 0;
  z-index: 45;
  /* display */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* animations */
  transition: opacity 0.3s ease;
  /* icon */
}
.iuw-inline-root .inline-related .iuw-delete-icon svg {
  width: 16px;
  height: auto;
  transform: none;
  transition: transform 0.3s ease;
}
.iuw-inline-root .inline-related:hover .iuw-delete-icon {
  opacity: 1;
}
.iuw-inline-root .inline-related:hover .iuw-delete-icon svg {
  transform: scale(1.3);
}
.iuw-inline-root .inline-related.empty-form {
  display: none;
}
.iuw-inline-root .inline-related.deleted {
  display: none;
}
.iuw-inline-root > div {
  height: 100%;
  width: auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.iuw-inline-root .iuw-add-image-btn {
  /* shape */
  border-radius: 5px;
  padding: 15px;
  width: 160px;
  max-width: 160px;
  /* styles */
  border: 1px solid var(--iuw-image-preview-border);
  box-shadow: 0 0 4px 0 var(--iuw-image-preview-shadow);
  background: var(--iuw-add-image-background);
  color: var(--iuw-add-image-color);
  /* display */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  display: none;
  /* behaviour */
  cursor: pointer;
}
.iuw-inline-root .iuw-add-image-btn svg {
  fill: var(--iuw-add-image-color);
  margin-bottom: 30px;
  width: 60px;
  height: auto;
  transition: margin 0.3s ease, width 0.3s ease, height 0.3s ease;
}
.iuw-inline-root .iuw-add-image-btn:hover svg {
  margin-bottom: 10px;
  width: 80px;
  height: auto;
}
.iuw-inline-root .iuw-add-image-btn > span {
  font-weight: bold;
  text-align: center;
  font-size: 1rem;
}
.iuw-inline-root.non-empty .iuw-add-image-btn:not(.visible-by-number) {
  display: none;
}
.iuw-inline-root.non-empty .iuw-add-image-btn.visible-by-number {
  display: flex;
}
.iuw-inline-root:not(.non-empty) .iuw-add-image-btn {
  display: none;
}