import styled from "styled-components";

export const MessagesWrapper = styled.div`
  /* position: fixed; */
  width: 570px;
  /* height: 300px; */
  /* height: 40vh; */
  /* bottom: 0; */
  /* right: 0; */
  border-radius: 30px;
  background-color: rgba(0, 194, 194, 1);
  /* z-index: 99; */

  .message_by_wrapper {
    border-radius: ${({ isFullHeight }) =>
      isFullHeight ? "30px 30px 0 0" : "30px"};
    display: flex;
    align-items: center;
    background-color: rgba(0, 194, 194, 1);
    justify-content: space-between;
    padding: 16px 20px;
    color: #ffffff;

    p {
      color: var(--white, #fff);
      font-family: Nunito;
      font-size: 20px;
      font-style: normal;
      font-weight: 700;
      line-height: 28px; /* 140% */
      letter-spacing: 0.4px;
    }

    .icon-box {
      display: flex;
      align-items: center;
      cursor: pointer;
      span {
        margin-right: 15px;
      }
    }
  }
  .top__header_section {
    align-items: center;
    margin-bottom: 20px;
    color: #313333;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
  }
`;

export const MessagesContainer = styled.div`
  display: flex;
  /* min-height: calc(100vh - 105px);
  max-height: calc(100vh - 105px); */
  overflow-y: auto;
  background-color: #ffffff;
  border-radius: 30px;
  height: ${({ isFullHeight }) => (isFullHeight ? "" : "0px")};

  h1 {
    margin-top: 0px;
    margin-bottom: 20px;
    color: #313333;
    font-size: 24px;
  }
`;
export const FriendsContainer = styled.div`
  margin-right: 20px;
  border-radius: 30px;

  h1 {
    margin-top: 20px;
    margin-bottom: 20px;
    color: #313333;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
  }
`;
export const FriendsCardContainer = styled.div`
  width: 270px;
  background-color: #ffffff;
  border-radius: 30px;
  padding-bottom: 20px;
  height: calc(100vh - 200px);
  overflow: scroll;

  .search-header {
    padding: 15px 20px 15px 8px;
    display: flex;
    align-items: center;
    position: relative;

    .more-options {
      width: 200px;
      border: 1px solid #adb2b2;
      padding: 15px 10px;
      right: 2px;
      bottom: -50px;
      border-radius: 15px;
      background-color: #f5f7f7;
      width: 114px;
      height: 70px;
      position: absolute;
      z-index: 10;

      ul {
        list-style: none;

        li {
          cursor: pointer;
          color: #7c8080;
          margin-bottom: 8px;
          font-weight: 600;
          font-size: 12px;
        }
      }
    }

    span {
      margin-left: 8px;
      cursor: pointer;
    }

    .search-box {
      border: 1px solid #dfe5e5;
      border-radius: 17px;
      display: flex;
      align-items: center;
      padding: 12px 12px 12px 40px;
      position: relative;
      width: 100%;
      svg {
        width: 24px;
        position: absolute;
        left: 12px;
      }

      input {
        border: none;
        background: transparent;
        font-size: 14px;
      }
    }
  }

  .single-friend {
    padding: 10px;
    display: flex;
    cursor: pointer;
    position: relative;
    height: 67px;
    margin: 8px;
    border-radius: 10px;

    &:hover {
      background-color: rgba(0, 194, 194, 0.1);
    }

    &.active {
      background-color: rgba(0, 194, 194, 0.1);
    }

    .avatar-profile {
      max-width: 42px;
      width: 100%;
      height: 42px;
      position: relative;
      border-radius: 50%;
      border: 2px solid rgba(176, 220, 220, 1);

      .online-dot {
        background-color: #30d468;
        width: 10px;
        height: 10px;
        position: absolute;
        border-radius: 50%;
        right: 0;
        bottom: 2px;
      }

      img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
    }

    .user-details {
      margin-left: 10px;
      display: flex;
      flex-direction: column;
      h5 {
        font-size: 14px;
        font-weight: 700;
        color: #313333;
        margin-bottom: 2px;
      }
      .friend-tag {
        background-color: rgba(0, 194, 194, 0.1);
        border-radius: 6px;
        color: #636666;
        font-size: 12px;
        align-items: center;
        padding: 0 5px;
        display: flex;
        margin-top: 3px;
        font-weight: 400;
        width: 60px;

        svg {
          margin-right: 3px;
        }
      }

      .instructor-tag {
        background: rgba(212, 48, 206, 0.12);
        border-radius: 6px;
        color: #636666;
        font-size: 12px;
        align-items: center;
        padding: 0 5px;
        display: flex;
        margin-top: 3px;
        font-weight: 400;

        svg {
          margin-right: 3px;
        }
      }

      .enterprise-tag {
        background: rgba(249, 153, 84, 0.15);
        border-radius: 6px;
        color: #636666;
        font-size: 12px;
        align-items: center;
        padding: 0 5px;
        display: flex;
        margin-top: 3px;
        font-weight: 400;

        svg {
          margin-right: 3px;
        }
      }
    }

    .time-count {
      margin-left: auto;

      p {
        font-size: 12px;
        font-weight: 400;
        color: #7c8080;
        margin-bottom: 9px;
      }

      .other__options {
        display: flex;
        justify-content: end;
      }

      .user_chat_dropdown {
        margin-left: 5px;
        transition: all 0.3s ease;
      }

      .msg-count {
        border-radius: 50%;
        background-color: #febf10;
        color: #ffffff;
        font-size: 10px;
        font-weight: 600;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: auto;
        width: 15px;
        height: 15px;
      }
    }
  }

  .user_chat_dropdown {
    display: block;
  }
  .other__options {
    width: 100%;
  }

  .pinned-messages {
    > span {
      color: #000;
      font-size: 12px;
      font-weight: 400;
      margin-top: 5px;
      margin-bottom: 5px;
      display: block;
      display: flex;
      align-items: center;
      background-color: rgb(229, 229, 229);
      width: 94%;
      padding: 3px 8px;
      letter-spacing: 0.24px;

      svg {
        margin-right: 5px;
      }
    }
  }

  .all-messages {
    > span {
      color: #000;
      font-size: 12px;
      font-weight: 400;
      margin-top: 5px;
      margin-bottom: 5px;
      display: block;
      display: flex;
      align-items: center;
      background-color: rgb(229, 229, 229);
      width: 94%;
      padding: 3px 8px;
      letter-spacing: 0.24px;

      svg {
        margin-right: 5px;
      }
    }
  }

  .course_container {
    .single-friend {
      padding: 8px 15px;
      margin-bottom: 0;
    }
  }

  .course_header {
    background-color: rgba(0, 194, 194, 0.3);
    padding: 6px;
    display: flex;
    cursor: pointer;
    position: relative;
    height: 67px;
    margin: 8px;
    border-radius: 10px;
    height: 36px;
    align-items: center;

    p {
      color: #313333;
      font-size: 14px;
      letter-spacing: 0.28px;
      font-weight: 700;
    }

    span {
      background-color: #74c2c2;
      border-radius: 5px;
      padding: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 5px;
      width: 24px;
      height: 26px;

      svg {
        transition: 0.3s all;
      }
    }

    &:hover {
      background-color: rgba(0, 194, 194, 0.1);
    }

    &.active {
      background-color: rgba(0, 194, 194, 1);
      margin-bottom: 0;

      p {
        color: #ffffff;
      }
      span {
        background-color: rgba(176, 220, 220, 1);
      }

      .user_chat_dropdown {
        svg {
          color: #ffffff !important;
        }
      }
    }

    .other__options {
      display: flex;
      justify-content: end;
      width: 70px;
      margin-left: auto;
    }

    .user_chat_dropdown {
      margin-left: 4px;
      transition: all 0.3s ease;
    }

    .msg-count {
      border-radius: 50%;
      background-color: #febf10;
      color: #ffffff;
      font-size: 10px;
      font-weight: 600;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-left: auto;
      width: 15px;
      height: 15px;
    }
  }

  .rc-collapse {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
    &.show {
      height: auto;
    }
  }
`;
export const CardContainer = styled.div`
  background-color: #ffffff;
  border-radius: 30px;
  padding: 20px;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  height: 65vh;

  .input {
    border-top: 1px solid var(--Neutral-20, #dfe5e5);
  }

  .friend-header-section {
    background: #e5f9f9;
    border-radius: 20px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
    width: 530px;

    span {
      cursor: pointer;
      svg {
        color: #636666;
        fill: #636666;
      }
    }

    .more-options {
      width: 200px;
      border: 1px solid #adb2b2;
      padding: 15px 10px;
      right: 8px;
      bottom: -71px;
      border-radius: 15px;
      background-color: #f5f7f7;
      width: 114px;
      height: 89px;
      position: absolute;
      z-index: 10;

      ul {
        list-style: none;

        li {
          cursor: pointer;
          color: #7c8080;
          margin-bottom: 8px;
          font-weight: 600;
          font-size: 12px;
        }
      }
    }

    .single-friend {
      display: flex;
      width: 80%;

      .avatar-profile {
        max-width: 42px;
        width: 100%;
        height: 42px;
        position: relative;
        border-radius: 50%;
        border: 2px solid rgba(176, 220, 220, 1);

        .online-dot {
          background-color: #30d468;
          width: 12px;
          height: 12px;
          position: absolute;
          border-radius: 50%;
          right: 0;
          bottom: 2px;
        }

        img {
          width: 100%;
          height: 100%;
          border-radius: 50%;
        }
      }

      .user-details {
        margin-left: 15px;
        display: flex;
        flex-direction: column;
        h5 {
          font-size: 20px;
          font-weight: 600;
          color: #636666;
          margin-bottom: 4px;
          width: 100%;
        }
        .friend_cont {
          display: flex;
          /* justify-content: space-between; */

          .friend-tag {
            border-radius: 6px;
            background: rgba(212, 48, 206, 0.12);
            color: #636666;
            font-size: 12px;
            align-items: center;
            padding: 0px 5px;
            display: flex;
            justify-content: center;
            margin-top: auto;
            font-weight: 400;

            svg {
              margin-right: 3px;
            }
          }

          p {
            color: var(--Neutral-70, #636666);
            font-family: Nunito;
            font-size: 14px;
            font-style: normal;
            font-weight: 500;
            line-height: normal;
            letter-spacing: 0.28px;
            margin-left: 10px;
          }
        }

        .instructor-tag {
          background: rgba(212, 48, 206, 0.12);
          border-radius: 6px;
          color: #636666;
          font-size: 12px;
          align-items: center;
          padding: 0 5px;
          display: flex;
          margin-top: auto;
          font-weight: 400;

          svg {
            margin-right: 3px;
          }
        }

        .enterprise-tag {
          background: rgba(249, 153, 84, 0.15);
          border-radius: 6px;
          color: #636666;
          font-size: 12px;
          align-items: center;
          padding: 0 5px;
          display: flex;
          margin-top: auto;
          font-weight: 400;

          svg {
            margin-right: 3px;
          }
        }
      }
    }
  }
`;

export const MessageBody = styled.div`
  overflow-y: scroll;
  max-height: calc(100vh - 100px);
  padding: 10px 0 30px;
  flex-grow: 1;

  .loader-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }

  .date__section {
    height: 2px;
    background-color: #f5f7f7;
    margin: 20px 0 25px;
    position: relative;

    span {
      background-color: #f5f7f7;
      color: #666668;
      font-size: 10px;
      font-weight: 300;
      text-align: center;
      border-radius: 5px;
      padding: 5px 20px;
      position: absolute;
      left: 45%;
      bottom: -9px;
    }
  }
`;

export const NoChat = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 85%;
  text-align: center;
  h5 {
    color: #00c2c2;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
  }

  p {
    color: #636666;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    line-height: 24px;
  }
`;

export const FriendMessageBox = styled.div``;
export const MessageBox = styled.div`
  .user-message-box {
    margin: 12px 17px 12px auto;
    width: 50%;
    position: relative;
  }

  .friend-message-box {
    margin: 12px;
    width: 50%;
    position: relative;
  }
  .user-icon {
    position: absolute;
    width: 13px;
    height: 13px;
    top: -3px;
    right: -15px;
  }

  .user-text {
    background-color: #f5f7f7;
    color: #313333;
    padding: 6px 8px;
    border-radius: 10px;
    margin-left: 6px;
    h5 {
      font-size: 14px;
      font-weight: 700;
    }
    h6 {
      font-size: 14px;
      font-weight: 400;
    }

    .msg-time-stamp {
      color: #313333;
      font-size: 12px;
      font-weight: 400;
      margin-left: auto;
      text-align: right;
      text-transform: uppercase;
    }
  }

  .user-img {
    background-color: transparent;
    padding: 4px 4px 0;
    border-radius: 10px;
    margin-left: 6px;
    border: 3px solid #f5f7f7;
    position: relative;
    min-height: 50px;

    img {
      width: 100%;
      border-radius: 10px;
    }

    .msg-time-stamp {
      color: #ffffff;
      font-size: 10px;
      font-weight: 400;
      margin-left: auto;
      text-align: right;
      position: absolute;
      bottom: 10px;
      right: 10px;
      background-color: rgba(0, 0, 0, 0.3);
      border-radius: 6px;
      padding: 3px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
  }

  .friend-img {
    background-color: #00c2c2;
    padding: 4px 4px 0;
    border-radius: 10px;
    margin-left: 6px;
    border: 3px solid #f5f7f7;
    position: relative;
    min-height: 50px;

    img {
      width: 100%;
      border-radius: 10px;
    }

    .msg-time-stamp {
      color: #ffffff;
      font-size: 12px;
      font-weight: 400;
      margin-left: auto;
      text-align: right;
      position: absolute;
      bottom: 10px;
      right: 10px;
      background-color: rgba(0, 0, 0, 0.3);
      border-radius: 6px;
      padding: 3px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
  }

  .friend-icon {
    background-color: #00c2c2;
    border-radius: 50%;
    position: absolute;
    width: 13px;
    height: 13px;
    top: -5px;
    left: -10px;
  }

  .friend-text {
    background-color: #00c2c2;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 10px;
    margin-left: 6px;
    h5 {
      font-size: 14px;
      font-weight: 700;
    }
    h6 {
      font-size: 14px;
      font-weight: 400;
      /* padding-top: 6px; */
    }

    .msg-time-stamp {
      color: #f5f7f7;
      font-size: 12px;
      font-weight: 400;
      margin-left: auto;
      text-align: right;
      margin-top: 6px;
      text-transform: uppercase;
    }
  }

  .friend-audio {
    background-color: #00c2c2;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 10px;
    margin-left: 6px;
    height: 60px;

    .audio-btn {
      border: none;
      outline: none;
      background-color: transparent;
      padding: 0;
      margin-right: 5px;
    }
    .msg-time-stamp {
      color: #f5f7f7;
      font-size: 12px;
      font-weight: 400;
      margin-left: auto;
      text-align: right;
      text-transform: uppercase;
    }
  }

  wave {
    overflow: hidden !important;
  }
  .user-audio {
    background-color: #f5f7f7;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 10px;
    margin-left: 6px;
    height: 60px;

    .audio-btn {
      border: none;
      outline: none;
      background-color: transparent;
      padding: 0;
      margin-right: 5px;
    }
    .msg-time-stamp {
      color: #313333;
      font-size: 12px;
      font-weight: 400;
      margin-left: auto;
      text-align: right;
      text-transform: uppercase;
    }
  }
`;
export const TextMessagePanel = styled.div`
  display: flex;
  align-items: center;
  background-color: #ffffff;
  padding-top: 10px;
  padding-bottom: 10px;

  .emoji-box {
    position: absolute;
    bottom: 70px;
    right: 30px;
    z-index: 11;
  }

  .react-input-emoji--container {
    background-color: transparent;
    border: none;
  }
  .text-input-wrapper {
    width: 90%;
    display: flex;
    align-items: center;
    padding: 0 0;
    background-color: #f7f7f7;
    border-radius: 15px;
    /* overflow-x: hidden; */
    &.text-mode {
      padding: 3px 0;
    }
    svg {
      cursor: pointer;
    }

    .icon-box {
      display: flex;
      align-items: center;
      padding: 0 5px 0 10px;
      gap: 25px;
      span {
        display: flex;
        cursor: pointer;
      }
    }

    .icon-box > svg {
      margin-right: 15px;
    }
    .emoji-icon {
      /* padding: 16px 0%; */
      padding-right: 27px;
    }
    .input {
      background-color: transparent;
      width: 75%;
      border: none;
      color: #666668;
      font-size: 16px;
      font-weight: 400;
      width: 100%;
      max-height: 50px;
      overflow-y: auto;

      /* padding: 16px 0; */
      &:empty::before {
        content: attr(placeholder);
        color: #666668;
      }
    }

    .left-recorder-state {
      padding: 16px 27px;
      font-size: 16px;
      font-weight: 600;
      color: #4a4d4d;
      background-color: #00c2c21a;
      border-radius: 15px;
      width: fit-content;
      display: flex;
      align-items: center;
      gap: 23px;
      .icon {
        display: flex;
      }
    }
    .waves-section {
      display: flex;
      gap: 16px;
      margin-left: 16px;
      align-items: center;
      width: 100%;
      #waves {
        /* min-width: 500px; */
        width: 100%;
        max-height: 58px;
        display: block;
      }
      #waves-input {
        /* min-width: 500px; */
        width: 100%;
        max-height: 58px;
        display: block;
      }
      .react-mic {
        opacity: 0;
        pointer-events: none;
        position: absolute;
      }
      .icon {
        display: flex;

        &:nth-last-of-type(1) {
          margin-left: auto;
          padding-right: 26px;
        }
      }
    }
  }

  .send-box {
    width: 52px;
    height: 52px;
    background-color: #febf10;
    box-shadow: 0px 10px 20px rgba(254, 191, 16, 0.25);
    border-radius: 12px;
    display: flex;
    margin-left: 25px;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    cursor: pointer;

    &.disabled {
      background-color: #c6cccc !important;
      box-shadow: none !important;
    }
  }
`;

export const Dropdown = styled.div`
  .more-options {
    width: 200px;
    border: 1px solid #adb2b2;
    padding: 15px 10px;
    right: 12px;
    bottom: -80px;
    border-radius: 15px;
    background-color: #f5f7f7;
    width: 114px;
    height: 89px;
    position: absolute;
    z-index: 10;

    ul {
      list-style: none;

      li {
        cursor: pointer;
        color: #7c8080;
        margin-bottom: 8px;
        font-weight: 600;
        font-size: 12px;
      }
    }
  }
`;
