body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background: #f0f0f0;
  display: grid;
  place-content: center;
  height: 100dvh;
}

main {
  width: 400px;
  max-width: 100%;
  height: 70vh;

  background: #262E35;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 8px;
  margin-bottom: 16px;

  overflow-y: auto;
  scroll-behavior: smooth;
}

ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
}

.message {
  display: flex;
  flex-direction: column;
  margin: 4px 0;
  padding: 4px 8px;

  span {
    width: 36px;
    height: 36px;
    background: #eee;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 999999px;
  }

  p {
    border-radius: 4px;
    padding: 4px 8px;
    margin-top: 4px;
  }

  &.user {
    align-self: flex-end;
    align-items: flex-end;

    span,
    p {
      /* background: rgb(219, 236, 255); */
      background: #36404A;
      color: white;
    }
  }

  &.bot {
    align-self: flex-start;

    span,
    p {
      background: #7169EF;
      color: white;
    }
  }
}

form {
  display: flex;

  input {
    border-radius: 999999px;
    flex-grow: 1;
    border: 0;
    padding: 8px;
    margin-right: 8px;
    border: 1px solid #ccc;
  }

  button {
    background: #7169EF;
    border: 0;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px;
    transition: background 0.3s ease;

    &[disabled] {
      background: #ccc;
      opacity: 0.6;
      pointer-events: none;
    }

    &:hover {
      background: #36404A;
    }
  }
}

small {
  font-size: 10px;
  color: #555;
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  margin: auto;
  width: 400px;
}

.loading {
  text-align: center;
  display: flex;
  justify-content: center;
  height: 100%;
  align-items: center;
  flex-direction: column;
  margin-top: 50%;

  i {
    pointer-events: none;
    width: 2.5em;
    height: 2.5em;
    border: 0.4em solid transparent;
    border-color: #eee;
    border-top-color: #3e67ec;
    border-radius: 50%;
    animation: loadingspin 1s linear infinite;
  }

  h4 {
    color: white;
    margin-bottom: 8px;
  }

  h5 {
    font-weight: 400;
    margin: 0;
    font-size: 10px;
    opacity: 0.4;
    color: white;
  }
}

@keyframes loadingspin {
  100% {
    transform: rotate(360deg);
  }
}
