/*** Fonts ***/
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  src: local("IBM Plex Sans"), local("IBMPlexSans"), url('../fonts/IBMPlexSans-Regular.tff') format('tff'), url("../fonts/IBMPlexSans-Regular.woff") format("woff");
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300;
  src: local("IBM Plex Sans Light"), local("IBMPlexSans-Light"), url("../fonts/IBMPlexSans-Light.tff") format("tff"), url("../fonts/IBMPlexSans-Light.woff") format("woff");
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 200;
  src: local("IBM Plex Sans ExtraLight"), local("IBMPlexSans-ExtraLight"), url("../fonts/IBMPlexSans-ExtraLight.tff") format("tff"), url("../fonts/IBMPlexSans-ExtraLight.woff") format("woff");
}

/*** Resets ***/
* { box-sizing: border-box; }

html { font-size: 62.5%; }

a {
  text-decoration: none;
  color: inherit;
}

img { 
  max-width: 100%; 
  max-height: 70vh;
}

#upload-btn:hover { opacity: .9; }

main { padding-top: 80px; }

#progress-bar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 100%;
}

#progress-bar .progress {
  width: 0;
  height: 3px;
  background-color: var(--black);
}

.container {
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
}

.text-center { text-align: center; }

.text-right { text-align: right; }

#toast {
  display: none;
  position: fixed;
  z-index: 200;
  top: 75px;
  right: 25px;
  padding: 10px 20px;
  border: 1px solid var(--silicon);
  background: #f8f9fa;
  font-size: 1.4rem;
  color: var(--black);
}

#toast.on {
  display: block;
  max-width: 500px;
  -webkit-animation: slideinright 0.5s, slideoutright 0.5s 2.5s;
  animation: slideinright 0.5s, slideoutright 0.5s 2.5s;
}

#toast.error { border: 1px solid var(--hal-red); }

#toast.error p { color: var(--hal-red); }

.no-select {
  /* iOS Safari */
  -webkit-touch-callout: none;
  /* Safari */
  -webkit-user-select: none;
  /* Konqueror HTML */
  -khtml-user-select: none;
  /* Firefox */
  -moz-user-select: none;
  /* Internet Explorer/Edge */
  -ms-user-select: none;
  /* Non-prefixed version, currently supported by Chrome and Opera */
  user-select: none;
}

/* Browse page */
#bp main { padding-bottom: 70px; }
#bp main h1 { 
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: 4.5rem;
  color: var(--black);
}
#bp main #file-list { 
  padding: 0;
  list-style: none;
}
#bp main #file-list li a {
  position: relative;
  padding: 5px 0;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--ava);
}
#bp main #file-list li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 98%;
  height: 2px;
  border-bottom: 1px dotted var(--silicon);
}
#bp main #file-list li a:hover {
  color: var(--black);
}
#bp main #file-list li a:hover::after {
  border-bottom: 1px dotted var(--black);
}

/* Error page */
.ep {
  display: flex;
  height: 100%;
  padding: 0 !important;
}
.ep .container {
  display: table;
  height: 100%;
}
.ep .container .error-info {
  display: table-cell;
  margin: 0 auto;
  vertical-align: middle;
  text-align: center;
}
.ep .container h1 {
  margin: 0;
  font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Roboto,Arial,sans-serif;
  font-size: 40px;
  font-weight: 600;
} 
.ep .container h2 {
  font-size: 35px !important;
  font-weight: 200 !important;
  color: var(--silicon);
}
.ep .container p {
  margin-top: 50px;
  font-size: 18px;
  font-weight: 300;
}
.ep .container p a {
  position: relative;
  color: var(--ava);
}
.ep .container p a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 98%;
  height: 2px;
  border-bottom: 1px dotted var(--silicon);
}
.ep .container p a:hover {
  color: var(--black);
}
.ep .container p a:hover::after {
  border-bottom: 1px dotted var(--black);
}

/* Results page */
#processing {
  flex-direction: column;
}
#processing p { 
  padding-top: 50px;
  font-size: 1.2em; 
  text-align: center;
}

#result main { padding-top: 80px; }
#result main .error-info { display: none; }
#result main #output { display: none; }

#result main .image {
  display: block;
  position: relative;
  width: 100%;
  text-align: center;
}
#result main .image img { z-index: 1; }
#result main .image canvas {
  position: absolute;
  /*z-index: 10;*/
  max-width: 100%;
  max-height: 70vh;
}
#result main .image #editable-canvas { 
  display: none;
  /*z-index: 15;*/
}

#result main .labels {
  display: block;
  width: 100%;
  padding: 25px 0;
}
#result main .labels .info-container {
  display: flex;
  flex-direction: row;
  position: relative;
  padding-bottom: 20px;
}
#result main .labels h2 {
  flex-grow: 1;
  margin: 0;
  font-weight: 400;
  font-size: 1.5rem;
}
#result main .labels .dropdown h3 {
  margin: 0;
  padding: 1rem 1rem 0 0;
  font-weight: 400;
  font-size: 1.3rem;
}
#result main .labels .dropdown {
  display: flex;
  flex-direction: row;
  position: absolute;
  top: 0;
  right: 0;
  flex-grow: 2;
  text-align: right;
}
#original i {
  margin-right: 7px!important;
}
#result main .labels .action {
  margin: 0 5px 10px 0;
  border: 1px solid var(--black) !important;
}
#result main .action i {
  padding: 0;
  margin: 0;
}
#result main .labels .vertical-divider {
  display: inline-block;
  height: 24px;
  margin: 9px 0 0 10px;
  padding-right: 15px;
  border-left: 1px solid var(--silicon);
  vertical-align: middle;
}
#result main .labels .label,#save {
  display: inline-block;
  margin: 0 10px 10px 0;
  height: 42px;
  padding: 9px 1rem;
  border: 1px solid var(--silicon);
  background-color: var(--white);
  text-align: center;
  cursor: pointer;
  vertical-align: top;
}

#result main .labels .active {
  cursor: pointer;
  border: 1px solid var(--black);
  background-color: var(--silicon);
  color: var(--black);
}
#result main .edit-mode {
  display: block;
  width: 100%;
  padding: 0 0 25px 0;
}
#result main .edit-mode .edit-object {
  display: inline-block;
  vertical-align: top;
  margin: 0 2rem 1.5rem 0;
  border: 1px solid var(--silicon);
  background-color: var(--white);
  text-align: center;
}
#result main .edit-mode .edit-object .editable {
  display: block;
  background-color: var(--silicon);
  color: var(--white);
}
#result main .edit-mode .edit-object .editable input {
  background-color: var(--silicon);
  color: var(--white);
  padding: 1rem 0 1rem 1rem; 
}
#result main .edit-mode .edit-object .editable i {
  padding: 0;
  font-size: 2rem;
}
#result main .edit-mode .edit-object .editable i.delete-text {
  margin-right: 1rem;
}
#result main .edit-mode .edit-object input {
  border: 0px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
}
#result main .edit-mode .edit-object input:focus {
  outline: none;
}
#result main .edit-mode .edit-object i:hover {
  cursor: pointer;
}
#result main .edit-mode .edit-object input::placeholder {
  font-size: 1.3rem;
}

/* Media queries */
@media only screen and (max-width: 1355px) {
  /* Landing  page */
  #upload-container {
    padding: 0;
    border: none;
  }
  #upload-container p { display: none; }
}

@media only screen and (max-width: 768px) {
  #toast {
    top: unset;
    right: 15vw;
    bottom: 100px;
    left: 15vw;
    margin: 0 auto;
    text-align: center;
  }

  #toast.on {
    -webkit-animation: slideup 0.5s, slidedown 0.5s 2.5s;
    animation: slideup 0.5s, slidedown 0.5s 2.5s;
    transition-timing-function: ease-in-out;
  }

  /* Landing  page */
  #lp main .container {
    display: block;
    align-items: unset;
    flex-direction: unset;
    padding-top: 70px;
  }
  #lp main img {
    max-height: 50vh;
  }
  #lp main .col {
    display: block;
    flex: unset;
    width: 100%;
    padding: 20px 0;
  }
  #lp main .col h1 { 
    line-height: 1.1;
    text-align: center; 
  }
  #lp main .col p { text-align: center; }
  #lp main .lp-art { width: 60%; }

  #upload-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
  }
  #upload-container button {
    width: 80%;
    margin: 0 0 25px 0;
  }

  /* Results page */

  #result main { 
    padding: 75px 0 100px 0;
  }
  #result main .container { width: 100%; }
  #result main .labels { padding: 25px 20px; }
}

@media only screen and (max-width: 375px) {
  .container { width: 90%; }
  /* Landing  page */
  #lp main .container { padding-top: 50px; }
  #lp main .col { padding: 10px 0px; }
  #lp main h1 { font-size: 3em; }
  #lp main p { font-size: 1.4em; }
}

@media only screen and (max-width: 320px) {
  .container {
    width: 100%;
    padding: 0 20px;
  }
  /* Landing  page */
  #lp main h1 { font-size: 2.5em; }
  #lp main p { font-size: 1em; }
  #lp main .lp-art { width: 70%; }

  /* Results page */
  #result main .container { padding: 0; }
}

/*** Animations ***/
@-webkit-keyframes sk-rotateplane {
  0% {
    -webkit-transform: perspective(120px)
  }

  50% {
    -webkit-transform: perspective(120px) rotateY(180deg)
  }

  100% {
    -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg)
  }
}

@keyframes sk-rotateplane {
  0% {
    transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg)
  }

  50% {
    transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg)
  }

  100% {
    transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
  }
}

@-webkit-keyframes slideup {
  from {
    bottom: 0;
    opacity: 0;
  }

  to {
    bottom: 75px;
    opacity: 1;
  }
}

@keyframes slideup {
  from {
    bottom: 0;
    opacity: 0;
  }

  to {
    bottom: 75px;
    opacity: 1;
  }
}

@-webkit-keyframes slidedown {
  from {
    bottom: 75px;
    opacity: 1;
  }

  to {
    bottom: 0;
    opacity: 0;
  }
}

@keyframes slidedown {
  from {
    bottom: 75px;
    opacity: 1;
  }

  to {
    bottom: 0;
    opacity: 0;
  }
}

@-webkit-keyframes slideinright {
  from {
    right: 0;
    opacity: 0;
  }

  to {
    right: 25px;
    opacity: 1;
  }
}

@keyframes slideinright {
  from {
    right: 0;
    opacity: 0;
  }

  to {
    right: 25px;
    opacity: 1;
  }
}

@-webkit-keyframes slideoutright {
  from {
    right: 25px;
    opacity: 1;
  }

  to {
    right: 0;
    opacity: 0;
  }
}

@keyframes slideoutright {
  from {
    right: 25px;
    opacity: 1;
  }

  to {
    right: 0;
    opacity: 0;
  }
}
