.chat-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: none;
  width: auto;
  min-width: 230px;
  max-width: 250px;
  font-family: $font-family-default;
  font-size: 14px;
  font-style: normal;
  font-weight: normal;
  line-height: 1.42857143;
  text-align: left;
  text-align: start;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
  word-spacing: normal;
  word-wrap: normal;
  white-space: normal;
  background-color: $chat-primary-dark;
  color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  line-break: auto;

  &.fade {
    opacity: 0;
    transition: opacity 0.15s linear;

    &.in {
      opacity: 1;
    }
  }

  > .arrow {
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 11px;

    &:after {
      position: absolute;
      display: block;
      width: 0;
      height: 0;
      border-color: transparent;
      border-style: solid;
      content: "";
      border-width: 10px;
    }
  }

  &.top {
    border-top: 3px solid $chat-secondary;
    margin-top: -10px;

    > .arrow {
      bottom: -11px;
      left: 50%;
      margin-left: -11px;
      border-top-color: #999;
      border-top-color: rgba(0, 0, 0, 0.25);
      border-bottom-width: 0;

      &:after {
        bottom: 1px;
        margin-left: -10px;
        content: " ";
        border-top-color: $chat-primary-dark;
        border-bottom-width: 0;
      }
    }
  }

  &.right {
    border-right: 3px solid $chat-secondary;
    margin-left: 10px;

    > .arrow {
      top: 50%;
      left: -11px;
      margin-top: -11px;
      border-right-color: #999;
      border-right-color: rgba(0, 0, 0, 0.25);
      border-left-width: 0;

      &:after {
        bottom: -10px;
        left: 1px;
        content: " ";
        border-right-color: $chat-primary-dark;
        border-left-width: 0;
      }
    }
  }

  &.bottom {
    border-bottom: 3px solid $chat-secondary;
    margin-top: 10px;

    > .arrow {
      top: -11px;
      left: 50%;
      margin-left: -11px;
      border-top-width: 0;
      border-bottom-color: #999;
      border-bottom-color: rgba(0, 0, 0, 0.25);

      &:after {
        top: 1px;
        margin-left: -10px;
        content: " ";
        border-top-width: 0;
        border-bottom-color: $chat-primary-dark;
      }
    }
  }

  &.left {
    border-left: 3px solid $chat-secondary;
    margin-left: -10px;

    > .arrow {
      top: 50%;
      right: -11px;
      margin-top: -11px;
      border-right-width: 0;
      border-left-color: #999;
      border-left-color: rgba(0, 0, 0, 0.25);

      &:after {
        right: 1px;
        bottom: -10px;
        content: " ";
        border-right-width: 0;
        border-left-color: $chat-primary-dark;
      }
    }
  }

  .popover-title {
    padding: 8px 14px;
    margin: 0;
    font-size: 14px;
    background-color: $chat-primary;
    border-bottom: 1px solid #ebebeb;
    border-radius: 5px 5px 0 0;
  }

  .popover-content {
    padding: 9px 14px;
  }

  .media-contact {
    display: block;
    padding: 5px 12px;
    max-width: 275px;

    &.media-lg {
      padding-top: 10px;
      padding-bottom: 10px;
      max-width: 275px;
    }

    .contact-photo {
      position: relative;

      .chat-badge.bottom-left, .chat-status-indicator {
        left: 0px;
        //bottom: 0px;
      }
    }

    .media-contact-body {
      //width: auto;
    }
  }

  .chat-contact-list {
    padding-left: 0;
    margin: 0;
    max-height: 270px;
    overflow: hidden;
    overflow-y: auto;

    li {
      &:hover {
        background-color: $chat-primary;
      }

      &:last-child {
        margin-bottom: 0;
      }

      &.has-unread {
        border-left: 0;
      }

      img, .icon-img {
        width: 40px;
        height: 40px;
      }

      .chat-popover-close {
        position: absolute;
        right: 5px;
        top: 0;
        bottom: 0;
        height: 18px;
        margin: auto;
        color: $chat-icon;

        &:hover {
          cursor: pointer;
          color: $chat-icon-dark;
        }
      }
    }

    .chat-badge.middle-right {
      display: block;
      right: 25px;
    }
  }
}
