@import './apps/commudle-admin/src/assets/styles/variables';

:host {
  height: 100%;

  .discussion-chat-component {
    height: 100%;
    min-height: 100px;
    position: relative;

    .messages {
      .loading-spinner {
        .spinner {
          height: 40px;

          & > div {
            animation: stretch-delay 1.2s infinite ease-in-out;
            background-color: $cadet;
            display: inline-block;
            height: 100%;
            margin: 0 1px;
            width: 4px;

            &:nth-child(2) {
              animation-delay: -1.1s;
            }

            &:nth-child(3) {
              animation-delay: -1s;
            }

            &:nth-child(4) {
              animation-delay: -0.9s;
            }

            &:nth-child(5) {
              animation-delay: -0.8s;
            }
          }

          @keyframes stretch-delay {
            0%,
            40%,
            100% {
              transform: scaleY(0.4);
            }
            20% {
              transform: scaleY(1);
            }
          }
        }
      }

      height: calc(100% - 40px);
      overflow-y: auto;

      // Custom scrollbar
      &::-webkit-scrollbar {
        width: 12px;
      }

      &::-webkit-scrollbar-track {
        background-color: transparent;
      }

      &::-webkit-scrollbar-thumb {
        background-clip: content-box;
        background-color: darken($light-purple, 5%);
        border: 3px solid transparent;
        border-radius: $border-10;
      }

      &::-webkit-scrollbar-thumb:hover {
        background-color: darken($light-purple, 8%);
      }

      .message {
        margin-bottom: 1rem;
        padding: 25px 25px 10px 25px;
      }

      .message:hover {
        background-color: rgb(0 0 0 / 5%);
      }

      .filler-message {
        left: 50%;
        position: absolute;
        text-align: center;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 80%;

        h4 {
          color: darkgrey;
        }
      }
    }

    .send-message-form {
      bottom: 0.5rem;
      position: sticky;
      width: 100%;

      form {
        display: flex;

        button {
          margin-left: 5px;
          max-width: 40px;
          width: 20%;
        }
      }
    }
  }
}

.disclaimer {
  max-width: 90vh;
  width: 350px;
}

.active {
  animation: highlight 1000ms ease-out;
}

@keyframes highlight {
  0% {
    background-color: yellow;
  }
  50% {
    background-color: initial;
  }
}
