@font-face {
  font-family: InterVariable;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/Inter-4.0/InterVariable.woff2") format("woff2");
}

body {
  opacity: 0; /* Set to 1 when the contents are loaded. */
  font-family: InterVariable, sans-serif;
  font-size: 1rem;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
}

a {
  color: #0000ff;
}

h1 {
  color: #333;
  margin-top: 30px;
  margin-bottom: 40px;
  font-weight: normal;
}

label {
  display: block;
  margin-bottom: 10px;
  text-align: start;
  width: 30vw;
}

input {
  width: 30vw;
  min-width: 30vw;
  padding: 8px;
  box-sizing: border-box;
  border: none;
  border: solid 1.5px #aaa;
  border-radius: 6px;
  font-size: 0.95rem;
}

input:focus {
  outline: 1px solid #0000ff;
}

input::placeholder {
  opacity: 0.7;
  color: #5c5c5c;
}

code {
  font-family: monospace;
  background-color: #f4f4f4;
  padding: 0.2em;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #133eff;
  font-weight: bold;
}

.container {
  max-width: 40%;
  margin: 50px auto;
  text-align: center;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0 0 0 / 10%);
  border-radius: 8px;
  padding: 2em;
}

.button-container {
  display: flex;
  justify-content: center;
  margin: 15px 0 30px;
}

#add-url,
#save {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-radius 0.5s ease,
    background 0.3s ease;
}

#add-url {
  padding: 5px 10px;
  margin-top: 10px;
  font-size: 0.9rem;
  background: none;
  border: 0.15rem solid #e15e49;
  color: #e15e49;
  white-space: nowrap;
}

#add-url:hover {
  background: #e15e49;
  color: white;
  border-radius: 12px;
}

#add-url.disabled-button {
  opacity: 0.6;
  cursor: default;
}

#add-url.disabled-button:hover {
  background: none;
  color: #e15e49;
}

#save {
  margin: 0 auto 15px;
  padding: 15px 25px;
  font-size: 1rem;
  border: none;
  background: #e15e49;
  color: #fff;
}

#save:hover {
  background: #a84636;
  border-radius: 12px;
}

#custom-bang-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.back-container {
  font-size: 0.9rem;
  text-align: left;
}

.input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.error-input-border {
  border: 1px solid #f00;
}

.checkbox-container {
  display: flex;
  width: 30vw;
  margin-bottom: 10px;
}

.base-url-wrapper {
  margin-bottom: 10px;
}

.base-url {
  display: none;
  width: 100%;
  min-width: 100%;
}

#urls-container,
#draggable-container {
  width: 100%;
}

.bang-option-label {
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  width: auto;
  min-width: auto;
  margin-right: 10px;
}

.checkbox-container label {
  margin: 0;
}

.error-message {
  display: block;
  margin-top: 4px;
  text-align: start;
  width: 30vw;
  color: red;
  font-size: 0.87rem;
}

.tooltip {
  position: relative;
  display: inline-block;
  text-align: center;
  margin-left: 0.5em;
  top: 1px;
  cursor: pointer;
}

.tooltip-label-wrapper {
  width: 100%;
  text-align: start;
}

.tooltip-label {
  max-width: fit-content;
}

.tooltip-text {
  visibility: hidden;
  position: absolute;
  z-index: 1;
  color: white;
  font-size: small;
  background-color: #525252;
  border-radius: 5px;
  padding: 10px 15px;
  margin: 25px 0 0;
  line-height: 2em;
}

.tooltip-text.show {
  visibility: visible;
}

.target-url-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 5px;
}

.target-url-wrapper {
  margin-bottom: 10px;
}

.target-url {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.target-url-container.dragging .url {
  opacity: 0.5;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0 0 0 / 20%);
}

.url-options-container {
  display: none;
  padding-left: 1vw;
  width: 29vw;
  opacity: 0;
}

.url-options-container.expanded {
  display: block;
  margin-bottom: 15px;
  opacity: 1;
  animation: fade 0.2s;
}

@keyframes fade {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.action-container {
  display: none;
  width: 10vw;
}

.action-container.left {
  justify-content: end;
  margin-right: 8px;
}

.action-container.right {
  margin-left: 8px;
}

.action-container > button {
  padding: 0;
}

.target-url:hover > .action-container {
  display: flex;
  gap: 8px;
}

.target-url:hover ~ .error-message {
  margin-left: calc(10vw + 8px);
}

.move-up-button,
.move-down-button {
  display: none;
}

.reorder-button,
.move-up-button,
.move-down-button,
.expand-button,
.delete-button {
  border: none;
  background: none;
  padding: 0 8px;
  margin: 2px;
  color: #494949;
  user-select: none;
}

.reorder-button {
  cursor: move;
}

.move-up-button > svg {
  transform: rotate(180deg);
}

.expand-button > svg {
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.expand-button.expanded > svg {
  transform: rotate(0);
}

.move-up-button,
.move-down-button,
.expand-button,
.delete-button {
  cursor: pointer;
}

#add-url svg {
  margin-left: -2px;
  margin-right: 4px;
}

#save svg {
  margin-right: 8px;
}

.reorder-button:hover {
  color: #7814ae;
}

.delete-button:hover {
  color: #c01010;
}

.label-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: start;
  align-items: center;
  width: 30vw;
}

.label-wrapper label {
  display: inline-block;
  width: auto;
}

@media screen and (width < 1000px) {
  html {
    background-color: white;
  }

  input,
  label,
  .label-wrapper,
  .url-options-container,
  .checkbox-container,
  .error-message {
    width: 65vw;
  }

  input {
    min-width: 65vw;
  }

  .container {
    max-width: 100%;
    margin: 0;
    padding: 0 0 50px;
    box-shadow: none;
  }

  .form {
    width: 90%;
  }

  .back-container {
    padding: 20px;
  }

  .target-url ~ .error-message {
    margin-left: calc(10vw + 8px);
  }

  .tooltip-text {
    width: 110%;
  }
}

@media not (hover: none) {
  .label-wrapper:has(.tooltip:hover) .tooltip-text {
    visibility: visible;
  }
}

/* Touchscreen devices. */
@media (hover: none) {
  .action-container {
    display: flex;
    gap: 8px;
  }

  .move-up-button,
  .move-down-button {
    display: block;
  }

  .reorder-button {
    display: none;
  }

  #add-url {
    padding: 5px 10px;
    margin-top: 10px;
    font-size: 0.9rem;
    background: none;
    border: 0.15rem solid #e15e49;
    color: #e15e49;
    white-space: nowrap;
  }

  #add-url:hover {
    background: none;
    color: #e15e49;
    border-radius: 8px;
  }
}
