.chat-sidebar {
  box-shadow: (-1px) 0px 4px rgba(0, 0, 0, 0.5);
  background-color: $chat-primary;
  position: fixed;
  z-index: 999;
  top: 0;
  bottom: 0;
  right: 0;
  min-width: 250px;
  min-height: 360px;
  font-size: 15px;
  background-color: $chat-primary;
  color: $chat-text;
  transition: right 0.4s ease;
  max-width: 300px;
  right: -100%;

  @media (max-width: 767px) {
    width: 100%;
  }

  &.open {
    right: 0;
  }

  .chat-loader .chat-loader-svg.first .chat-loader-circle {
    fill: $chat-primary;
  }

  .chat-toaster {
    width: 95%;
    margin: 10px auto;
    left: 0;
    right: 0;
    top: 0;
    bottom: initial;
  }

  .chat-sidebar-wrapper {
    position: relative;
    height: 100%;

    .media-contact {
      .chat-message-date {
        display: none;
        color: #7d7d7d;
        position: absolute;
        right: 5px;
        bottom: 2px;
        font-size: 10px;
      }

      &:hover {
        .chat-message-date {
          display: block;
        }
      }
    }

    .create-group-input {
      border-top: 0;
      border-right: 0;
      border-left: 0;
    }

    .search-wrapper {
      position: relative;
      z-index: 2;
      background-color: $chat-primary-dark;

      .search-input {
        height: 45px;
        border: 0;
        font-size: 14px;
        border-bottom: 1px solid $chat-border-light;
      }
    }

    .chat-sidebar-header {
      background-color: $chat-primary-dark;
      float: left;
      width: 100%;
      margin: 0;
      border-bottom: 1px solid $chat-border-light;
      height: 54px;
    }

    .chat-sidebar-body {
      clear: both;
      position: relative;
      height: 100%;
      padding-bottom: 104px;

      .chat-tab-body {
        border-bottom: 1px solid $chat-border-light;
      }
    }

    .chat-sidebar-footer {
      position: absolute;
      width: 100%;
      bottom: -1px;
      text-align: center;
      box-shadow: 0px -1px 2px $chat-primary-dark;
      background-color: $chat-primary;

      .chat-button-group {
        padding: 10px;
      }

      .chat-dropdown {
        float: none;
        vertical-align: middle;

        .button-group > button {
          color: darken($chat-text-inverse, 30%);
          line-height: 24px;
          font-size: 18px;
          padding: 12px;
          background: transparent;

          &:hover {
            background-color: $chat-primary;
          }

          &.dropdown-display {
            text-align: left;
            padding-left: 20px;
          }
        }

        .dropdown-button {
          text-decoration: none;
        }
      }

      .chat-navbar {
        width: 100%;
        margin: 0;
        display: table;
        background-color: $chat-primary-dark;

        > li {
          float: none;
          display: table-cell;
          vertical-align: middle;
          color: darken($chat-text-inverse, 30%);
          border-top: 1px solid #8a8585;

          > a {
            color: darken($chat-text-inverse, 30%);
          }

          &.active {
            color: $chat-text-inverse;
            border-top: none;

            > a {
              color: $chat-text-inverse;
              border-bottom: 3px solid $chat-secondary;
              background: $chat-primary;
            }

            .chat-dropdown {
              border-top: 1px solid $chat-primary-dark;
              box-shadow: 0px -1px 1px $chat-primary-dark;

              .button-group > button {
                color: $chat-text-inverse;
                background-color: $chat-primary;
              }

              .show {
                button {
                  background: $chat-primary;

                  &.dropdown-button {
                    color: $chat-secondary;
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  .chat-version {
    float: right;
    margin: 5px;
    font-size: 10px;
    color: #b2b4b3;
  }

  .full-height {
    height: 100%;
    clear: both;
    position: relative;
  }

  @media (min-width: 768px) {
    &.sidebar-condensed {
      z-index: 1100;
      width: 275px;
      overflow: hidden;
      font-size: 14px;
      box-shadow: 0px 0 4px rgba(0, 0, 0, 0.5);
      margin-right: 15px;
      border-top-left-radius: $chat-default-border-radius;
      border-top-right-radius: $chat-default-border-radius;

      &.open {
        @media (max-width: 767px) {
          right: 0;
          margin-right: 0;
        }
      }

      @media (min-width: 768px) {
        top: auto !important;
        height: 375px;
      }

      &.closed {
        right: 0 !important;
        top: auto !important;
        height: 45px;
        min-height: initial;

        @media (max-width: 767px) {
          width: auto;
          min-width: initial;
        }

        .chat-sidebar-body, .chat-sidebar-footer, .chat-navbar ul > li > a:not(.chat-toggle), .chat-offline {
          display: none;
        }
      }

      .content-placeholder-item .animated-background {
        height: 35px;
      }

      .chat-sidebar-wrapper {
        .chat-badge {
          width: 15px;
          height: 15px;
          line-height: 15px;
          font-size: 8px;
        }

        .chat-sidebar-header {
          height: 45px;

          &.chat-navbar {
            font-size: 13px;

            .chat-navbar-brand {
              font-size: 14px;
            }

            a {
              line-height: 18px;
            }
          }
        }

        .chat-sidebar-body {
          padding-bottom: 88px;

          .chat-tab-content .chat-tab-body {
            padding: 8px 12px;
          }
        }

        .chat-sidebar-footer {

          .chat-dropdown .button-group {

            .dropdown-display {
              padding-left: 15px;
            }

            > button {
              line-height: 20px;
              padding: 10px;
            }
          }
        }

        .chat-tab-list .chat-tab-list-item {
          padding: 10px;
        }

        .contact-photo, .contact-photo .icon-img {
          width: 35px;
          height: 35px;
        }

        .media-contact {

          .media-contact-title {
            font-size: 14px;
          }

          .media-contact-text {
            font-size: 12px;
          }

          .chat-message-date {
            font-size: 10px;
            bottom: 1px;
          }
        }
      }

      .chat-popover {
        .media-contact-left {
          display: none !important;
        }
      }
    }
  }
}

.chat-toggle-tab {
  position: fixed;
  z-index: 1000;
  right: 0;
  top: 60px;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 1.25rem;
  background: $chat-primary;
  border-bottom-left-radius: 2px;
  border-top-left-radius: 2px;

  .chat-badge {
    top: 6px;
    right: 6px;
  }
}

.search-config {
  padding: 10px 15px;
  float: left;
  width: 100%;
  border-top: 1px solid $chat-border-light;
  border-bottom: 1px solid $chat-border-light;

  strong {
    display: block;
    margin-bottom: 5px;
  }

  label {
    float: left;
    width: 50%;
    margin-left: -1px;

    input[type="checkbox"] {
      width: 15px;
      height: 15px;
      vertical-align: middle;
      cursor: pointer;
    }
  }
}
