@use "../variables.scss" as *;

.messagesContainer {
  position: relative;
  width: 100%;
  max-height: 90lvh;
  background-color: $messagesBg;
  border-radius: 8px;
  box-shadow: 0 4px 8px $messagesShadow;
  padding: 20px;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  @media (max-width: 1024px) {
    width: 85%;
    padding: 15px;
    margin: auto;
    transform: translateX(0%);
    margin-bottom: 50px;
  }

  @media (max-width: 768px) {
    width: 90%;
    padding: 15px;
    box-shadow: none;
    border-radius: 6px;
    margin: auto;
    transform: translateX(3%);
    margin-bottom: 50px;
  }

  @media (max-width: 480px) {
    padding: 10px;
  }

  h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: $messagesTitle;
    flex-shrink: 0;
    text-align: center;

    @media (max-width: 1024px) {
      font-size: 1.3rem;
    }

    @media (max-width: 768px) {
      font-size: 1.2rem;
    }

    @media (max-width: 480px) {
      font-size: 1rem;
    }
  }

  .messageList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px;

    @media (max-width: 768px) {
      gap: 0.8rem;
      padding-right: 5px;
    }
  }

  .messageItem {
    background-color: $messagesItemBg;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px $messagesItemShadow;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    @media (max-width: 768px) {
      padding: 0.8rem;
      border-radius: 4px;
    }

    @media (max-width: 480px) {
      padding: 0.6rem;
    }

    p {
      margin: 0;
      font-size: 0.9rem;
      color: $messagesItemText;

      strong {
        color: $messagesItemTextEmphasis;
      }

      @media (max-width: 1024px) {
        font-size: 0.85rem;
      }

      @media (max-width: 768px) {
        font-size: 0.8rem;
        text-align: center;
      }

      @media (max-width: 480px) {
        font-size: 0.75rem;
        text-align: center;
      }
    }

    .buttonContainer {
      display: flex;
      gap: 0.5rem;
      margin-top: 0.5rem;

      @media (max-width: 768px) {
        gap: 0.3rem;
        justify-content: center;
      }
    }

    .replyButton,
    .deleteButton {
      padding: 0.5rem;
      border-radius: 5px;
      font-size: 0.9rem;
      font-weight: bold;
      cursor: pointer;
      transition: background-color 0.3s ease;
      text-align: center;

      @media (max-width: 1024px) {
        font-size: 0.85rem;
      }

      @media (max-width: 768px) {
        font-size: 0.8rem;
        text-align: center;
      }

      @media (max-width: 480px) {
        font-size: 0.75rem;
        padding: 0.4rem;
        text-align: center;
      }
    }

    .replyButton {
      background-color: $messagesReplyButtonBg;
      color: $messagesReplyButton;
      flex: 3;

      &:hover {
        background-color: $messagesReplyButtonHoverBg;
      }
    }

    .deleteButton {
      background-color: $messagesDeleteButtonBg;
      color: $messagesDeleteButton;
      flex: 1;

      &:hover {
        background-color: $messagesDeleteButtonHoverBg;
      }
    }
  }
}
