@font-face {
  font-family: Whitney;
  src: url("./whitney-book.otf");
}

body {
  font-family: sans-serif, Arial;
  touch-action: manipulation;
}

.hidden {visibility: hidden}

.card {
  display: block;
  margin: auto;
  width: min(80vw, 500px);
  border: 2px solid silver;
  border-radius: 10px;
  box-shadow: 3px 5px 5px rgb(128, 128, 128);
  padding: 10px;
  margin-bottom: 20px;
  background-color: white;
}

.card p {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-all;
}

button {
  font-weight: bold;
}

@keyframes output-anim {
  from {background-color: #c4bc00}
}

.output-anim-class {
  animation-name: output-anim;
  animation-duration: 0.5s;
}

.copy {
  padding: 8px;
  background-color: #adadad;
  color: #313131;
  border-radius: 10px;
  border: 1px solid #eeeeee;
}
.copy:hover {
  border-color: #a1a1a1;
}
.copy:active {
  background-color: #919191;
}

#sample {
  padding: 10px;
  color: black;
  background-color: rgb(128, 128, 128);
  border-radius: 3px;
}

#form {
  display: flex;
  flex-direction: column;
  color: #333333;
  font-size: 0.8em;
}

#form > div {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

#form > div input, #form {
  margin-bottom: 0;
}

#form > div input[type=button] {
  margin-left: 5px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#form label {
  margin-bottom: 2px;
}

#form textarea {
  font-family: sans-serif;
  resize: vertical;
  min-height: 31px;
}

#form input, #form textarea {
  padding: 5px;
  margin-bottom: 15px;
}

#form input:not([type="button"]), #form textarea {
  background-color: #eeeeee;
  border-radius: 5px;
  border: 1px solid #333;
  padding: 7px;
}
#form input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus,
#form textarea:focus {
  outline: 2px solid #008aff;
}

.toggle-off {
  background-color: red;
  width: 25px;
  height: 25px;
}

.toggle-on {
  background-color: green;
  width: 25px;
  height: 25px;
}

#form #generate {
  background-color: lightblue;
  color: rgb(128, 128, 128);
  padding: 10px;
}
#form #generate:active {
  background-color: #8fb3bf;
}

#form #reset {
  background-color: #ffb5af;
  color: rgb(128, 128, 128);
  font-weight: bold;
  padding: 10px;
}
#form #reset:active {
  background-color: #cc918d;
}

#form #color-c {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 10px;
}

#form #color {
  width: 100%;
  height: 30px;
  border-radius: 10px;
  padding: 3px;
  padding-top: 2px;
  padding-bottom: 2px;
  /*border: 3px solid silver;*/
  background: linear-gradient(to top left, #b827fc 0%, #2c90fc 25%, #b8fd33 50%, #fec837 75%, #fd1892 100%);
  
  margin: auto;
}

#generated-url {
  border: 1px solid silver;
  padding: 5px;
  border-radius: 10px;
  background-color: #eeeeee;
}

#form .prefixed-textbox {
  background-color: #eeeeee;
  border: 1px solid #333;
  color: #222222;
  display: flex;
  line-height: 29px;
  height: 29px;
  font-size: 9pt;
  margin-bottom: 15px;
  border-radius: 5px;
  cursor: text;
  padding-left: 7px;
}

#form .prefixed-textbox:has(input:focus) {
  outline: 2px solid #008aff;
}

#form .prefixed-textbox > input {
  flex-grow: 1;
  border: none;
  background-color: transparent;
  padding: 7px;
  margin-bottom: 0;
  border-radius: 5px;
}
#form .prefixed-textbox > input:focus {
  outline: none !important;
}

@keyframes success-anim {
  from {background-color: #55f803}
}
@keyframes failed-anim {
  from {background-color: #d00000
  }
}
.copied-anim-class {
  animation-name: success-anim;
  animation-duration: 1s;
}
.copy-failed-anim-class {
  animation-name: failed-anim;
  animation-duration: 1s;
}


.embed-preview {
  display: flex;
  padding: 25px;
  background-color: #313338;
  border-radius: 10px;
  font-family: Whitney, sans-serif;
}
.embed-preview .embed {
  display: grid;
  margin: auto;
  background-color: #2b2d31;
  border-left: 4px solid;
  border-radius: 4px;
  color: #DBDEE1;
  padding: .5rem 1rem 1rem .75rem;
}
.embed-preview .embed :is(.provider-text, .author-text, .title-text, .description-text) {
  margin-top: 8px;
  padding-top: .125rem;
  padding-bottom: .125rem;
  grid-column: 1/1;
}
.embed-preview .embed .provider-text {
  font-size: 12px;
}
.embed-preview .embed .author-text {
  font-size: 14px;
  font-weight: 600;
}
.embed-preview .embed .title-text a {
  color: #00A8FC;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}
.embed-preview .embed .title-text a:hover {
  text-decoration: underline;
}
.embed-preview .embed .description-text {
  font-size: 14px;
  word-break: break-word;
  font-weight: 400;
}
.embed-preview .embed .image-container {
  margin-top: 16px;
}
.embed-preview .embed .image-container > img {
  border-radius: 4px;
}
.embed-preview .embed .image-container.large-image  {
  max-width: 100%;
  max-height: 100%;
}
.embed-preview .embed .image-container.large-image > img {
  max-width: 100%;
  max-height: 100%;
}
.embed-preview .embed .image-container.small-image  {
  grid-row: 1/8;
  grid-column: 2/2;
  -ms-flex-negative: 0;
  justify-self: end;
  max-width: 80px;
  max-height: 80px;
  margin-left: 16px;
  margin-top: 8px;
}
.embed-preview .embed .image-container.small-image > img {
  max-width: 80px;
  max-height: 80px;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #333333;
    color: #ebebeb;
  }
  
  .card {
    border: none;
    background-color: #222;
    box-shadow: 3px 5px 5px black;
  }
  
  #generated-url {
    background-color: #222;
  }
  
  #form input:not([type="button"]), #form textarea {
    color: #ebebeb;
    background-color: #111;
  }

  #form .prefixed-textbox {
    background-color: #111;
    border-color: #2B2B2B;
    color: #d6d6d6;
  }
  
  #form label {
    color: #d6d6d6;
  }

  #form #generate {
    background-color: #010131;
    color: #ddd;
  }
  #form #generate:active {
    background-color: #01011f;
  }

  #form #reset {
    background-color: #410000;
    color: #ddd;
  }
  #form #reset:active {
    background-color: #360000;
  }

  #sample {
    background-color: #3b3b3b;
    border: 1px solid #5b5b5b;
    color: #d6d6d6;
  }

  .copy {
    background-color: #2c2c2c;
    color: #eeeeee;
    border-color: #252525;
  }
  .copy:hover {
    border-color: #2f2f2f;
  }
  .copy:active {
    background-color: #212121;
  }
}