:root {
  --foreground-danger: red;
  --background-danger: #ffabab;

  --foreground-white: #e1e1e1;
  --foreground-gray: #999;
  --background-black: #191919;

  --foreground-interactive: rgb(157 133 255);
  --background-interactive: rgb(78, 61, 115);

  --border-thickness: 1px;
}

body {
  font-family: sans-serif;

  background: var(--background-black);
  color: var(--foreground-white);

  padding: 4px;
}

button.button,
button.button-danger,
input.input {
  height: 40px;
  box-sizing: border-box;
  padding: 8px;

  border-radius: 4px;
  border: 1px solid var(--foreground-interactive);
  color: var(--foreground-interactive);
  background: var(--background-interactive);
}

button.button:disabled {
  color: var(--foreground-gray);
  border-color: var(--foreground-gray);
  background: #e3e3e3;
}

button.button-danger {
  border: 1px solid var(--foreground-danger);
  color: var(--foreground-danger);
  background: var(--background-danger);
}

button.round {
  width: 30px;
  height: 30px;
  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  font-size: 26px;
  font-weight: bold;
}

button.button-icon,
button.button-icon-danger {
  border: none;
  margin: 0;
  padding: 8px;
  color: var(--foreground-interactive);
  background-color: transparent;
}

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

button.button-icon:disabled,
button.button-icon-danger:disabled {
  color: var(--foreground-gray);
}

ul {
  list-style: none;
  margin-block-start: 0;
  margin-block-end: 0;
  padding-inline-start: 0;
}

/* tabs */
.tab {
  flex: 1;
  height: 6vh;
  border: none;
  border-bottom: 2px solid var(--background-black);

  color: var(--foreground-interactive);
  background: var(--background-black);
}

.tab-active {
  color: var(--foreground-white);
  border-bottom: 2px solid var(--foreground-white);
}



/* gap, padding & margin */
.gap-2 { gap: 4px; }
.gap-4 { gap: 8px; }
.gap-8 { gap: 16px; }

.p-2 { padding: 4px; }
.p-4 { padding: 8px; }
.p-8 { padding: 16px; }

.px-2 { padding-left: 4px; padding-right: 4px; }
.px-4 { padding-left: 8px; padding-right: 8px; }
.px-8 { padding-left: 16px; padding-right: 16px; }

.py-2 { padding-top: 4px; padding-bottom: 4px; }
.py-4 { padding-top: 8px; padding-bottom: 8px; }
.py-8 { padding-top: 16px; padding-bottom: 16px; }

.m-2 { margin: 4px; }
.m-4 { margin: 8px; }
.m-8 { margin: 16px; }

.mb-2 { margin-bottom: 4px; }
.mb-4 { margin-bottom: 8px; }
.mb-8 { margin-bottom: 16px; }

.ml-2 { margin-left: 4px; }
.ml-4 { margin-left: 8px; }
.ml-8 { margin-left: 16px; }

.mr-2 { margin-right: 4px; }
.mr-4 { margin-right: 8px; }
.mr-8 { margin-right: 16px; }

.mt-2 { margin-top: 4px; }
.mt-4 { margin-top: 8px; }
.mt-8 { margin-top: 16px; }

/* sizing */
.w100 { width: 100%; }
.min-w0 { min-width: 0; }

/* flexbox */
.row {
  display: flex;
  flex-direction: row;
}

.column {
  display: flex;
  flex-direction: column;
}

.items-center {
  display: flex;
  align-items: center;
}

.items-baseline {
  display: flex;
  align-items: baseline;
}

.justify-center {
  display: flex;
  justify-content: center;
}

.justify-between {
  display: flex;
  justify-content: space-between;
}

.flex1 {
  flex: 1;
}

/* text */
.text-bold {
  font-weight: bold;
}

.text-ellipsis {
  text-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-lowlight {
  color: var(--foreground-gray);
}

.text-interactive {
  color: var(--foreground-interactive);
}

.text-danger {
  color: var(--foreground-danger);
}

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

/* background */
.bg-danger {
  background-color: var(--background-danger);
}

/* border */
.border {
  border: var(--border-thickness) solid var(--foreground-white);
  border-radius: 4px;
}

.border-danger {
  border: var(--border-thickness) solid var(--foreground-danger);
  border-radius: 4px;
}

.border-interactive {
  border: var(--border-thickness) solid var(--foreground-interactive);
  border-radius: 4px;
}


/* positioning */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }


/* misc */
.hidden { visibility: hidden; }
.overflow-hidden { overflow: hidden; }
.pointer-events-none { pointer-events: none; }



/*
 * Spinner, stolen directly from https://loading.io/css/
 */
.lds-ellipsis {
  color: var(--foreground-white);
  box-sizing: border-box;
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-ellipsis div {
  box-sizing: border-box;
  position: absolute;
  top: 33.33333px;
  width: 13.33333px;
  height: 13.33333px;
  border-radius: 50%;
  background: currentColor;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
  left: 8px;
  animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
  left: 8px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
  left: 32px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
  left: 56px;
  animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
@keyframes lds-ellipsis3 {
  0% { transform: scale(1); }
  100% { transform: scale(0); }
}
@keyframes lds-ellipsis2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(24px, 0); }
}

/*
 * Rotation
 */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotating {
  display: inline-block;
  animation: rotate 2s linear infinite;
}
