/* The import editors of the asset configurators (configurators/_image_import
   and _svg_import with their controllers): left the chosen file — a picture
   with its crop frame, an SVG as it is — right what the import makes of it.
   Bootstrap modals in the Briora theme. */
.nv-import-name {
  margin-left: 6px;
  color: var(--bs-secondary-color);
  font-family: var(--bs-font-monospace);
  font-weight: 400;
}

.nv-import-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
}

@media (max-width: 767px) {
  .nv-import-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.nv-import-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.nv-import-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--bs-secondary-color);
  font-size: 12px;
}

.nv-import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* The picture; the frame darkens everything it leaves out. */
.nv-import-source {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg);
  line-height: 0;
  touch-action: none;
  user-select: none;
}

.nv-import-source canvas {
  display: block;
  width: 100%;
  height: auto;
}

.nv-import-frame {
  position: absolute;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 0 9999px rgba(20, 20, 30, 0.5);
  cursor: move;
}

.nv-import-frame i {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  background: #fff;
}

.nv-import-frame [data-corner="nw"] { top: -7px; left: -7px; cursor: nwse-resize; }
.nv-import-frame [data-corner="ne"] { top: -7px; right: -7px; cursor: nesw-resize; }
.nv-import-frame [data-corner="sw"] { bottom: -7px; left: -7px; cursor: nesw-resize; }
.nv-import-frame [data-corner="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }

/* What the display will show, enlarged in whole pixels, on a chequered
   ground so that clear pixels can be told from white ones. */
.nv-import-preview {
  display: grid;
  place-items: center;
  height: 190px;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: conic-gradient(var(--bs-tertiary-bg) 25%, var(--bs-body-bg) 0 50%, var(--bs-tertiary-bg) 0 75%, var(--bs-body-bg) 0) 0 0 / 16px 16px;
}

.nv-import-preview img {
  max-width: calc(100% - 16px);
  max-height: 170px;
  image-rendering: pixelated;
}

.nv-import-preview img:not([src]) {
  visibility: hidden;
}

/* An SVG and what the display draws of it: both on paper, at one size, so
   that the two can be compared. */
.nv-import-drawing {
  height: 230px;
  padding: 8px;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: #fff;
}

.nv-import-drawing img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nv-import-drawing img:not([src]) {
  visibility: hidden;
}

@media (min-width: 768px) {
  .nv-import--svg .nv-import-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.nv-import--svg .nv-import-field {
  grid-template-columns: 6.5em minmax(0, 1fr);
}

.nv-import--svg .nv-import-row {
  flex-wrap: nowrap;
}

.nv-import-field .form-range {
  flex: 1;
  min-width: 0;
}

.nv-import-message:empty {
  display: none;
}

.nv-import-field {
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.nv-import-field .form-control {
  width: 5em;
}

.nv-import-hint {
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: 12px;
}

/* How much of the room the picture takes. */
.nv-import-meter {
  height: 6px;
  overflow: hidden;
  border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg);
}

.nv-import-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--bs-body-color);
}

.nv-import-meter[data-over] i {
  background: var(--bs-danger);
}

.nv-import-message {
  margin: 0;
  padding-left: 8px;
  border-left: 2px solid var(--bs-border-color);
  font-size: 12.5px;
}

.nv-import-message[data-error] {
  border-left-color: var(--bs-danger);
}
