@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC&display=swap');

@font-face {
  font-family: 'Nerd Font';
  src: url("./NF.woff2") format("woff2");
}

* {
  padding: 0;
  margin: 0;
}

body {
  background-color: var(--bg-1);

  box-sizing: border-box;

  --text: #E0E0E0;

  --bg-1: #1F1F1F;
  --bg-2: #2F2F2F;
  --bg-3: #3F3F3F;

  --color-inactive: #5F5F5F;

  --color-light: #F5EFF8;
  --color-main: #5FAFEF;
  --color-dark: #3F8FDF;
  --color-darker: #C39BD3;
  --color-darkest: #AF7AC5;
  --color-x-dark: #9B59B6;

  --color-hover: var(--color-main);
  --color-active: var(--color-dark);

  color: var(--text);
}

body, input, button, select, textarea {
  font-family: 'Noto Sans SC', 'Nerd Font';
}

a.nostyle {
  text-decoration: none;
}

@media (orientation: landscape)
{
  body {
    font-size: 12pt;
  }

  div.main {
    margin: 1em;
  }

  div.box {
    padding: 1em;
  }

  div.group-box-header {
    margin: -1.8em 0 0 0.5em;
  }
}

@media (orientation: portrait)
{
  body {
    font-size: 10pt;
  }

  div.main {
    margin: 0.5em;
  }

  div.box {
    padding: 0.5em;
  }

  div.group-box-header {
    margin: -1.3em 0 0 0.5em;
  }
}

div.top-bar {
  background-color: var(--bg-2);
  padding: 0.5em 1em 0.65em 1em;

  justify-content: space-between;
  display: flex;
  align-items: center;
}

div.header-panel {
  text-align: center;
}

div.box {
  border: 2px solid var(--bg-3);
  border-radius: 0.75em;
  overflow: hidden;
}

div.group-box {
  margin-top: 0.75em;
  display: flex;
  flex-wrap: wrap;
}

div.group-box-header {
  position: absolute;
  font-weight: 900;
  width: max-content;
  padding: 0 0.5em;
  background-color: var(--bg-1);
}

span.header {
  font-size: 1.25em;
}

span.top-bar-header {
  font-size: 2em;
  font-weight: 900;
}

span.header-color {
  color: transparent;
  background: linear-gradient(to right, var(--color-main), var(--color-darkest));
  background-clip: text;
}

span.header-project-name {
  font-size: 2.7em;
  font-weight: 900;

  color: transparent;
  background: linear-gradient(to right, var(--color-main), var(--color-darkest));
  background-clip: text;
}

.centered {
  align-self: center;
}

.grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em;
  align-items: center;
  width: 100%;
}

.grid > * {
  box-sizing: border-box;
}

.dont-align {
  align-self: start;
}

.input-box {
  color: inherit;
  background: none;
  outline: none;
  border: 2px solid var(--color-inactive);
  background-color: var(--bg-2);
  padding: 0.15em 0.375em;
  border-radius: 0.25em;

  width: 100%;

  transition: border-color 0.2s;
}

.width-max-content {
  width: max-content;
}

.input-box:hover, .input-box:focus:not(.no-focus) {
  border-color: var(--color-hover);
}

.input-box:active:not(.no-click) {
  border-color: var(--color-active);
}

.icon-button {
  user-select: none;
  
  transition: color 0.2s;
}

.icon-button:hover {
  color: var(--color-hover);
}

.icon-button:active {
  color: var(--color-active);
}

.input-box.checkbox {
  appearance: none;
  position: relative;

  aspect-ratio: 1;
  width: 2.0875em;
}

.input-box.checkbox::before {
  position: absolute;
  content: "\eab2";
  color: transparent;
  font-size: 14pt;
  left: 2.5px;
  bottom: 1px;
  
  transition: color 0.2s;
}

.input-box.checkbox:checked::before {
  content: "\eab2";
  color: var(--text);
}

.input-box.checkbox {
  appearance: none;
}

textarea.content {
  resize: vertical;
  min-height: 4lh;
}

div.full-width {
  width: 100%;
}

div.vertical-layout {
  display: flex;
  flex-direction: column;
}

div.horizontal-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1em;
}

div.reversed-horizontal-layout {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.5em;
}

div.horizontal-layout.buttons {
  gap: 0.5em;
}

.vertical-split {
  height: 1em;
}

div.message {
  margin: 0 0.1em 0;
  padding: 0.5em;
}

div.message.light {
  background-color: var(--bg-2);
}

div.message > div.message-metadata > * {
  margin-left: 1em;
}

div.message > div.message-content {
  margin: 0.5em;
  white-space: pre-line;
  font-size: unset;
}

div.message > div.message-content > img {
  max-width: 100%;
  display: inline-block;
}

div.window {
  background-color: rgba(0, 0, 0, 0.25);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(4px);
}

div.window-content {
  position: fixed;
  
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  padding: 0.65em;
  background-color: var(--bg-2);
  backdrop-filter: blur(0.5em);
  border-radius: 0.5em;

  width: 24em;

  box-shadow: 0 0 1.35em 0.15em rgba(0, 0, 0, 0.5);
}

div.caption-bar {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.375em;
}

@keyframes window-show {
  0% {
    margin-top: -1em;
    opacity: 0;
  }
  100% {
    margin-top: 0;
    opacity: 1;
  }
}

@keyframes window-hide {
  0% {
    margin-top: 0;
    opacity: 1;
  }
  100% {
    margin-top: 1em;
    opacity: 0;
  }
}

@keyframes window-backdrop-show {
  0% {
    backdrop-filter: none;
    opacity: 0;
  }
  100% {
    backdrop-filter: blur(4px);
    opacity: 1;
  }
}

@keyframes window-backdrop-hide {
  0% {
    backdrop-filter: blur(4px);
    opacity: 1;
  }
  100% {
    backdrop-filter: none;
    opacity: 0;
  }
}

div.toast-container {
  display: flex;
  flex-direction: column;

  pointer-events: none;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  align-items: end;
  gap: 0.25em;

  padding-top: 0.25em;
}

div.toast-container > div.toast {
  background-color: var(--bg-3);
  border: 2px solid var(--color-inactive);
  border-radius: 0.5em 0 0 0.5em;
  pointer-events: none;
  transform: translateX(100%);
  box-shadow: 0 0 0.5em 0 rgba(0, 0, 0, 0.5);
}

div.toast-container > div.toast > div.content {
  padding: 0.3em 0.3em 0.3em 0.6em;
}

div.toast-container > div.toast > div.progress-bar {
  height: 0.2em;
  background-color: var(--color-active);
  border-radius: 0.1em;
  margin-left: auto;
}

@keyframes toast-progress-bar-finishing {
  0% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}

@keyframes toast-in {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: none;
  }
}

@keyframes toast-out {
  0% {
    transform: none;
  }
  100% {
    transform: translateX(100%);
  }
}

/* #region User HTML Content Elements */
center {
  all: inherit;

  display: block;
  text-align: center;
}
right {
  all: inherit;

  display: block;
  text-align: right;
}

small {
  font-size: 0.8em;
}

large {
  font-size: 1.4em;
}
/* #endregion */

span.loading {
  text-align: center;
  color: var(--color-inactive);
  font-size: 1.25em;

  animation: loading-animation 1s infinite ease-in-out;
  height: 24pt;
}

@keyframes loading-animation {
  0% {
    font-size: 1.25em;
  }
  50% {
    font-size: 1.5em;
  }
  100% {
    font-size: 1.25em;
  }
}

.debug {
  color: var(--color-inactive);
  display: none;
}