:root {
  /* region usu styles */
  --primary1-base: #004f9f;
  --color-usu-dark-blue-base: #0a1341;
  --primary3-base: #0294be;
  --color-cold-neutrals-6: #e6e6e6;
  --actionbar-border: 1px solid var(--color-cold-neutrals-6);
  /* endregion usu styles */

  --header-background: #214964;

  --clickable: var(--primary1-base);
  --clickableHeader: rgb(31, 37, 112);
  --clickableHover: var(--color-usu-dark-blue-base);
  --active: var(--primary3-base);
  --textColor: #303030;
  --textInverseColor: #ffffff;
  --backgroundColor: #f8f8f8;

  --fontSize: 12px;

  --fontSizeHeader: calc(var(--fontSize) * 1.5);

  --btnBorderRadius: 3px;

  --titleColor: var(--primary1-base);
}

*, *:after, *:before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  color: var(--textColor);
  font-family: "Open sans", sans-serif;
}

body {
  height: 100vh;
  overflow: hidden;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background-color: var(--backgroundColor);
  gap: 12px;
}

h1, h2, h3 {
  color: var(--titleColor);
}

a, a:visited {
  text-decoration: none;
  color: var(--clickable);
  font-weight: bold;
}

a:hover {
  color: var(--clickableHover);
}


label {
  font-size: 0.8em;
}

input {
  font-size: 1.0em;
  padding: 8px 16px;
  border-radius: var(--btnBorderRadius);
  border: none;

  background-color: #f2f6fa;
  box-shadow: inset 0 0 0 1px #6695c5;
  outline: none;

  &:focus {
    box-shadow: inset 0 0 0 2px var(--active);
  }
}

button {
  background-color: var(--clickable);
  color: var(--textInverseColor);
  padding: 12px 16px;
  border: none;
  border-radius: var(--btnBorderRadius);
  white-space: nowrap;
  transition: color 300ms, background-color 300ms;

  &:hover {
    background-color: var(--clickableHover);
  }
}

/* hide Checkbox */
.toggle {
  display: flex;
  gap: 4px;
  align-items: center;

  input[type=checkbox] {
    appearance: none;
    width: 40px;
    height: 20px;
    background: #ccc;
    border-radius: 20px;
    position: relative;
    outline: none;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.3s;
  }

  /* circle in switch */

  input[type=checkbox]::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
  }

  input[type=checkbox]:checked {
    background: var(--primary1-base);
  }

  input[type=checkbox]:checked::before {
    transform: translateX(20px);
  }
}


#appBar {
  background-color: var(--header-background);
  color: var(--textInverseColor);
  user-select: none;
  height: 56px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding-left: 100px;
  padding-right: 20px;
  overflow-x: auto;
  white-space: nowrap;

  transition: padding-left 0.5s;

  #mainLogo {
    position: fixed;
    transition: all 1s;
    background-color: white;
    top: 10px;
    left: 10px;
    width: 80px;
    padding: 4px;
    border: 6px solid var(--header-background);
  }

  #titleWrapper {
    flex: 1;

    h1 {
      color: var(--textInverseColor);
    }
  }

  #userWrapper {
  }

  #logoutBtn {
    visibility: visible;
    display: inline-block;
    font-family: monospace;
    font-size: x-large;
    padding: 6px;
    border-radius: 10px;
    border: 2px solid white;
    cursor: default;

    &:hover {
      background-color: var(--clickableHover);
    }
  }


  &.login {
    padding-left: 20px;
    transition: padding-left 0.5s 0.5s;

    #mainLogo {
      top: 76px;
      left: 20px;
      width: 240px;
      padding: 20px;
      border-width: 20px;
    }

    #logoutBtn {
      visibility: hidden;
    }
  }
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: auto;

  &.show {
    display: flex;
  }
}

.dlg {
  background-color: rgb(255, 255, 255);
  padding: 20px 40px;
  border-radius: 8px;
  box-shadow: rgba(0, 0, 0, 0.3) 0 2px 10px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: stretch;

  h3 {
    margin-bottom: 20px;
  }

  input {
    width: 100%;
    margin-bottom: 20px;
  }

  .buttons {
    text-align: right;
    margin-top: 10px;
  }
}

#actionBar {
  padding-left: 100px;
  padding-right: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  user-select: none;
  overflow-x: auto;
  white-space: nowrap;

  .actionItem {
    padding: 0.2em 1em 0.5em 1em;
    cursor: pointer;
    font-weight: bold;
    color: var(--clickable);
    border-bottom: 2px solid transparent;

    transition: border-bottom-color 1s, font-weight 1s;

    &:hover {
      color: var(--clickableHover);
    }

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

#contentWrapper {
  border-top: 1px solid rgb(128, 128, 128);
  padding: 10px 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: auto;

  .json-container {
    font-family: monospace;
    background-color: transparent;

    .json-string {
      color: var(--primary1-base);
    }

    .json-number {
      color: var(--primary3-base);
    }
  }
}

.spacer {
  min-width: 10px;
  min-height: 10px;
  flex: 1;
}

.hidden {
  display: none !important;
}

#eventSender {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;

  #sendWrapper {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;

    > div {
      flex: 1;
      min-width: 200px;
      position: relative;
    }

    textarea {
      width: 100%;
      height: calc(100vh - 200px);
      min-height: 100px;
    }

    #prettify {
      position: absolute;
      right: 24px;
      bottom: 70px;
      font-family: monospace;
      padding: 8px;
      background-color: aliceblue;
      border-radius: var(--btnBorderRadius);
      cursor: pointer;
      user-select: none;
      color: var(--clickable);

      &:hover {
        color: var(--clickableHover);
      }
    }

    #samplePayloadActions {
      position: absolute;
      top: 24px;
      right: 24px;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      font-size: 0.6rem;
      transition: font-size 300ms;

      button {
        color: rgba(0, 79, 159, 0.5);
        background-color: transparent;
        padding: 6px 0;
        border: none;
        white-space: nowrap;
        cursor: pointer;
        font-size: inherit;
      }

      &:hover {
        font-size: 1rem;

        button {
          color: var(--clickable);

          &:hover {
            color: var(--clickableHover);
          }
        }
      }
    }

    #payloadActions {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
    }
  }
}