// 
// Chat.scss
//

// chat left sidebar

.chat-leftsidebar{
  @media (min-width: 992px) {
    min-width: 260px;
  }

  @media (min-width: 1200px) {
    min-width: 380px;
  }

  .chat-leftsidebar-nav{
    .nav{
      .nav-link{
        &.active{
          background-color: rgba(var(--bs-primary-rgb), 1);
          color: $white;
        }
      }
    }
  }
}

// search-box

.search-box{
  .form-control{
      padding-left: 40px;
  }
  .search-icon{
      font-size: 16px;    
      position: absolute;
      left: 13px;
      top: 0;
      height: 100%;
      display: flex;
      align-items: center;
  }
}


.chat-noti-dropdown{
  &.active{
    &:before{
      content: "";
      position: absolute;
      width: 8px;
      height: 8px;
      background-color: $danger;
      border-radius: 50%;
      right: 0;
    }
  }

  .btn{
    padding: 6px;
    box-shadow: none;
    font-size: 20px;
    color: var(--#{$prefix}gray-600);    
    border-color: transparent !important;
  }
}

.chat-message-list{
  height: calc(100vh - 346px);
  @media (min-width: 992px){
    height: calc(100vh - 406px);
  }
}



.chat-list{
  margin: 0;
  li{
    &.active{
      a{
        background-color: rgba(var(--bs-primary-rgb), 0.075); 
        border-color: transparent;
      }
    }
    a{
      display: block;
      padding: 14px 16px;
      color: $text-muted;
      transition: all 0.4s;
      border-top: 1px solid var(--#{$prefix}border-color);
      position: relative;
      &:hover{
        background-color: rgba(var(--bs-primary-rgb), 0.075); 
        border-color: transparent;
      }
    }

    .user-img{
      position: relative;

      .user-status{
        width: 10px;
        height: 10px;
        background-color: $gray-500;
        border-radius: 50%;
        border: 2px solid $card-bg;
        position: absolute;
        left: 0;
        bottom: 0;
      }

      &.online{
        .user-status{
          background-color: $success;
        }
      }

      &.away{
        .user-status{
          background-color: $warning;
        }
      }
    }

    &.unread{
      a{
        font-weight: $font-weight-semibold;
        color: var(--#{$prefix}body-color);
      }
    }

    .unread-message {
      position: absolute;
      display: inline-block;
      right: 16px;
      top: 33px;
    }
  }
}

.contact-list{
  font-size: 12px;
  text-transform: uppercase;
  color: $text-muted;
  font-weight: $font-weight-semibold;
  margin-bottom: 7px;
}

// user chat nav

.user-chat-nav{
  .dropdown{
    .nav-btn{
      height: 36px;
      width: 36px;
      line-height: 36px;
      box-shadow: none;
      padding: 0;
      font-size: 18px;
      color: var(--#{$prefix}gray-600);
    }
  }
}

// chat conversation

.chat-conversation{
  li{
    clear: both;
  }

  .chat-day-title{
    position: relative;
    text-align: center;
    margin-bottom: 24px;
    border: none;

    .title{
      background-color: $card-bg;
      position: relative;
      z-index: 1;
      padding: 6px 24px;
    }

    &:before{
      content: "";
      position: absolute;
      width: 100%;
      height: 1px;
      left: 0;
      right: 0;
      background-color: var(--#{$prefix}border-color);
      top: 10px;
    }
    .badge{
      font-size: 12px;
    }
  }

  .conversation-list{
    margin-bottom: 24px;
    position: relative;
    max-width: 85%;

    .ctext-wrap {
      display: flex;
      margin-bottom: 10px;
    }

    .ctext-wrap-content {
      padding: 12px 20px;
      background-color: rgba(var(--bs-primary-rgb), 1);
      border-radius: 8px;
      color: $white;
      position: relative;
      margin-left: 16px;

      &:before {
          content: "";
          position: absolute;
          border: 5px solid transparent;
          border-right-color: rgba(var(--bs-primary-rgb), 1);
          border-top-color: rgba(var(--bs-primary-rgb), 1);
          left: -10px;
          top: 10px;
      }

      .conversation-name {
          .time{
            font-size: 10px;
            position: absolute;
            right: -58px;
            bottom: 0;
            color: $text-muted;
            font-weight: $font-weight-normal;
            opacity: 0;
            transition: all .4s;
          }
    
          .user-name{
            color: rgba($white, 0.5); 
          }
          
      }

      &:hover{
        .time{
          opacity: 1;
        }
      }


    }

  .dropdown {
      .dropdown-toggle {
          font-size: 18px;
          padding: 4px;
          color: $gray-600;

          @media (max-width: 575.98px) {
              display: none;
          }
      }

  }


  .message-img {
    border-radius: .2rem;
    position: relative;

      .message-img-list {
          position: relative;
      }

      img {
          max-width: 120px;
      }
    }

}

  .right {
    .conversation-list {
        float: right;
        text-align: right;

        .ctext-wrap {

            .ctext-wrap-content {
                order: 2;
                background-color: var(--#{$prefix}light);
                text-align: right;
                border-radius: 8px;
                margin-left: 0;
                margin-right: 16px;
                color: var(--#{$prefix}body-color);

                &:before {
                    border: 5px solid transparent;
                    border-top-color: var(--#{$prefix}light);
                    border-left-color: var(--#{$prefix}light);
                    left: auto;
                    right: -10px;
                }
            }

            .conversation-name {
              justify-content: flex-end;
              .user-name, .time{
                color: $text-muted; 
              }
              .time{
                order: 1;
                margin-left: 0;
                margin-right: 8px;
                position: absolute;
                left: -58px;
                right: auto;
              }

              .user-name{
                  order: 2;
                }
            }
        }

        .dropdown {
            order: 1;
        }
      }
  }
}

.chat-send{
  @media (max-width: 575.98px) {
    min-width: auto;
  }
 }

body[data-layout="horizontal"]{
  .chat-message-list{
    height: calc(100vh - 346px);
    @media (min-width: 992px){
      height: calc(100vh - 476px);
    }
  }

  .chat-conversation{
    height: calc(100vh - 300px);
    @media (min-width: 992px){
      height: calc(100vh - 420px);
    }
  }
}

