:root {
  /* trinckle colors */
  --petrol-blue: #0084a4;
  --petrol-dark-blue: #002738;
  --grey-light: #e3e3e3;
  --grey-middle: #c5c5c6;
  --grey-dark: #3c3c3b;
  /* app settings */
  --col-accent: var(--petrol-blue);
  --color-dark: var(--petrol-dark-blue);

  --vp-2d-scale: 1;

  --vp-shift: 114px;
}


@font-face {
  font-family: 'My Arial';
  src: url('../assets/fonts/Arial.ttf');
}


* {
  box-sizing: border-box;
}

body {
  position: relative;
  display: flex;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

as-text-button {
  margin: .5em 0;
}

as-step-selector,
as-header,
#as-footer {
  z-index: 2;
}

as-viewport {
  background: white;
}

select {
  width: fit-content;
}

#as-footer {
  position: relative;
  background: white;
}

.viewport.capture-thumb {
  width: 54px !important;
  height: 54px !important;
}

/* High resolution for top view captures */
.viewport.capture-top {
  width: 2880px !important;
  height: 2880px !important;
}

#vp-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

#vp {
  /* width: 100%; */
  height: 100%;
  left: var(--vp-shift);
  width: calc(100% - var(--vp-shift));
}

#vp-2d {
  position: absolute;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: white;
  user-select: none;    
  -moz-user-select: none;
  -webkit-user-select: none;
  /* Shift a bit to the right */
  /* padding-left: var(--vp-shift); */
  margin-top: 2em;
}

#vp-2d::after {
  position: absolute;
  content: ' ';
  top: 0;
  left: 0;
  width: var(--vp-shift);
  height: 100%;
  background: inherit;
}

#board-2d {
  position: absolute;
  width: 500px;
  height: 500px;
  background: var(--grey-middle);
  outline: 1px solid black;
  /* border-radius: 30px; */
  display: flex;
}

#seam-2d {
  position: absolute;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  /* outline: 0.5px dashed var(--grey-dark); */
  outline: 1px solid var(--col-accent);
}


.import-thumb {
  position: relative;
  width: 54px;
  height: 54px;
  object-fit: contain;
  /* outline: 0.5px solid var(--grey-light); */
  outline: 0.5px solid #666;
  border-radius: 0.5rem;
  margin-right: 0.75em;
  /* background: var(--text-btn-bg-col); */
}

.list-item-wrapper {
  position: relative;
  width: 100%;
  height: fit-content;
  display: flex;
  flex-direction: column;
  margin: 0.5em 0;
  padding: 0.5em;

  & .list-info {
    width: 100%;
    
    & span {
      word-break: keep-all;
    }
  }
}

.import-btn-wrapper {
  display: flex;
  /* align-items: center; */
  height: fit-content;
  /* padding: 0.5em; */

  & > img, as-hovercard-wrapper img {
    margin: 2px;
    width: 25px;
    height: 25px;
  }

  & input[type="color"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  & > div {
    margin: 8px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 0.5px solid black;
  }
}


/* Main wp rect align per group */
.rects-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  pointer-events: none;
}

.wp-rect-container {
  position: relative;
  pointer-events: all;
  width: 100%;
  height: 100%;
  outline: 0;
  pointer-events: none;
}

.wp-rect-container:hover {
  outline: 0.5px solid var(--col-accent);
}

.rect {
  position: relative;
  display: block;
  cursor: pointer;
  /* pointer-events: all; */
  opacity: 1;
  background: repeating-linear-gradient(
    -45deg,
    rgb(80, 80, 80) 0px,
    rgb(80, 80, 80) 4px,
    var(--grey-dark) 4px,
    var(--grey-dark) 8px
    );

  & .wp-rect-png, .wp-rect-png.overlay {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  & .wp-rect-png {
    opacity: 0;
  }
  & .wp-rect-png.overlay {
    opacity: 0.5;
  }
}

.group.dragged .rect {
  cursor: grabbing;
}

.wp-rect-finger-cuts {
  position: absolute;
  outline: 1px solid var(--col-accent);
  background: rgb(100, 100, 100);
}

.group {
  position: absolute;
  width: fit-content;
  max-width: 100%;
  height: max-content;
  display: flex;
  flex-direction: column;
  outline: calc(1px / var(--vp-2d-scale)) dashed #9c9c9c;
  outline-offset: calc(0.5px / var(--vp-2d-scale) * -1);
}

.group:hover {
  outline: calc(1px / var(--vp-2d-scale)) dashed var(--col-accent);
  cursor: pointer;
}

.group.selected {
  z-index: 2;
  outline: calc(1px / var(--vp-2d-scale)) solid var(--col-accent);
  cursor: grab;
}

.group.dragged {
  cursor: grabbing !important;
}

.group-label {
  width: max-content;
  font-family: 'My Arial';
  color: var(--col-accent);
  outline: 0 !important;
  pointer-events: all;
  cursor: text !important;
  background: none;
}
.group-label::selection {
  background: var(--col-accent);
  color: white;
}



.dimension {
  position: absolute;
  z-index: 10;
  display: flex;
  background: black;
  pointer-events: all;
  transition: inherit;
}
.dimension.horizontal {
  top: -40px;
  left: 4px;
  justify-content: center;
  align-items: center;
  width: calc(100% - 2 * 4px);
  height: 0.25px;
}
.dimension.vertical {
  top: 4px;
  left: -40px;
  justify-content: center;
  align-items: center;
  height: calc(100% - 2 * 4px);
  width: 0.25px;
}
.dimension.horizontal::before,
.dimension.horizontal::after,
.dimension.vertical::before,
.dimension.vertical::after {
  position: absolute;
  background: black;
  content: ' ';
}
.dimension.horizontal::before,
.dimension.horizontal::after {
  width: 12px;
  height: 6px;
}

.dimension.vertical::before,
.dimension.vertical::after {
  width: 6px;
  height: 12px;
}
.dimension.horizontal::before {
  left: -4px;
  top: -3px;
  clip-path: shape(from 0% calc(50% + 0.25px), line to 100% 0.5px, line to 100% 100%, close);
}
.dimension.horizontal::after {
  left: calc(100% - 12px + 4px);
  top: -3px;
  clip-path: shape(from 100% calc(50% + 0.25px), line to 0% 0.5px, line to 0% 100%, close);
}
.dimension.vertical::before {
  top: -4px;
  left: -3px;
  clip-path: shape(from calc(50% + 0.25px) 0%, line to 100% 100%, line to 0.5px 100%, close);
}
.dimension.vertical::after {
  left: -3px;
  top: calc(100% - 12px + 4px);
  clip-path: shape(from 100% 0%, line to calc(50% + 0.25px) 100%, line to 0.5px 0%, close);
}
.dimension > input {
  position: relative;
  z-index: 10;
  max-width: 3.25em;
  height: 2em;
  padding: 5px;
  margin: 0.5em;
  border: none;
  text-align: center;
  font-size: 14px;
  border-radius: 8px;
  background: black;
  color: white;
  transform: scale(0.75);
  outline-color: var(--col-accent) !important;
}

/* #vp-2.active .dimension > input {
  transform: scale(calc(1 / var(--view-scale)));
} */

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


.dimension > input:hover,
.dimension > input:focus {
  background:var(--col-accent);
}
.dimension > input:focus {
  background:var(--col-accent);
}

#board-seam-xy {
  top: 0;
  left: calc(100% + 40px);
  height: 20px;

  & .inverted-arrows-div {
    position: absolute;
    /* left: -90px; */
    top: -0.5px;
    height: calc(100% + 0.5px);
    min-width: 12px;
    border: solid black;
    border-width: 0.5px 0 0.5px 0;
  }

  & > input {
    left: 35px;
  }
}

#board-seam-xy::before {
  top: -11.5px;
  left: -3px;
  clip-path: shape(from 0% 0%, line to calc(50% + 0.25px) 100%, line to 100% 0%, close);
}

#board-seam-xy::after {
  top: calc(100% - 0.5px);
  left: -3px;
  clip-path: shape(from calc(50% + 0.25px) 0%, line to 100% 100%, line to 0% 100%, close);
}

#cosy-wrapper {
  position: absolute;
  bottom: 20px;
}