/* --------------------------------------------------------
AI Poetry

author: Raphael Arar
email: me@rarar.com
website: http://rarar.com
credits: Stack Overflow, CodePen, Reddit, many others
----------------------------------------------------------*/
body {
  background-color: #0960a5;
  font-size: 1.8em;
  line-height: 1.25em;
  font-family: "Ubuntu Mono", monospace;
}

main {

  color: #F0C0D8;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 100px;
}

.prompt {
  color: #f6ff00;
}

.share {
  display: inline-block;
  color: white;
  text-decoration: none;
  padding: .5em;
  border: 1px solid white;
  border-radius: 4px;
  margin: .5em 1em .5em 0;
}


.share:hover {
  color: #0960a5;
  background: white;
}

.share:active {
  opacity: 0.5;
}

span  {
  margin: 0 1em 0 0 !important;
}

div {
  display: block;
  width: 0px;
  margin: 1em 0;
  color: #F0C0D8;
  overflow: hidden;
  white-space: nowrap;
}

div.noWriteText {
  width: 100%;
}

div.cursor {
  width: auto;
  display: inline;
  margin: 0;
  position: relative;
}

.cursor i {
    position: absolute;
    width: 14px;
    height: 2em;
    background-color: #ffffff;
    left: 0px;
    top: 10%;
    animation: blink 1s step-end infinite;
}

.cursor input:focus + i {
    /* display: none; */
}

.writetext {
  animation-name: writeText;
  animation-duration: 1000ms;
  animation-fill-mode: forwards;
}

input {
  border-top-style: hidden;
  border-right-style: hidden;
  border-left-style: hidden;
  border-bottom: hidden;
  background-color: #0960a5;
  padding: 0.25em 0;
  color: #fff;
  width: 40%;
  font-family: inherit !important;
  font-size: inherit !important;
}

input:disabled {
  color: #fff !important;
}

input:focus {
  outline: none;
}

.response .prompt {
  visibility: hidden;
  width: 80%;
}

.output {
  white-space: pre-wrap;
  width: 100%;
  font-size: inherit !important;
  background-image: linear-gradient(to left, #F0C0D8 50%, #16e67c);
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
  transition: none;
  display: block;
  margin-top: 16px !important;
}

.no-outline:focus {
  outline: none;
}

.delay1 {
  animation-delay: 2000ms;
}
.delay2 {
  animation-delay: 3000ms;
}
.delay3 {
  animation-delay: 4000ms;
}

.loading {
  position: relative;
}

.loadingText {
  margin-left: 0.5em !important;
  position: relative;
}

.blinkingCursor::after {
  content: "";
  position: absolute;
  top: 1px;
  right: -28px;
  /* Remove display: inline-block if not required to be on the same line as text etc */
  display: inline-block;
  background-color: #ffffff;
  vertical-align: top;
  width: 14px;
  height: 2em;
  animation: blink 1s step-end infinite;
}



input::before {
  content: "";
  position: absolute;
  top: 1px;
  right: -20px;
  /* Remove display: inline-block if not required to be on the same line as text etc */
  display: inline-block;
  background-color: #20C20E;
  vertical-align: top;
  width: 14px;
  /* Set height to the line height of .text */
  height: 2em;
  /*
  Animation paramaters:
  blink = animation-name,
  1s = animation-duration,
  step-end = animation-timing-function,
  infinite = animation-iteration-count
  */
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0% { opacity: 1.0; }
  50% { opacity: 0.0; }
  100% { opacity: 1.0; }
}

@keyframes writeText {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}


@media all and (max-width: 1690px) {
  body, .output {
    font-size: 1.6em;
  }
}
@media all and (max-width: 1280px) {
  body, .output{
    font-size: 1.4em;
  }
}
@media all and (max-width: 980px) {
  body, .output {
    font-size: 1.2em;
  }
}
@media all and (max-width: 736px) {
  body, .output {
    font-size: 1.1em;
  }
}
@media all and (max-width: 480px) {
  body, .output {
    font-size: 1.1em;
  }

  div {
    white-space: normal;
    animation: none !important;
    width: 100%;
  }

  main {
    margin-top: 10%;
    width: 85%;
  }

  input {
    width: 100%;
    padding: .25em 0;
  }

  .output {
    margin-top: 0px !important;
  }

  span {
    display: block;
  }

  .loadingText {
    margin-left: 0 !important;
    width: max-content;
  }

  .loading {
    height: 20px;
  }

  .blinkingCursor::after {
    right: -20px;
  }

  .loading::after {
    top: 0px;
    left: 0;
    right: auto;
  }
}
