button.jsxc-collapsible {
  background-color: var(--jsxc-color-background-darker);
  border: 0;
  border-radius: 0;
  color: var(--jsxc-color-main-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: normal;
  outline: none;
  padding: 5px;
  text-align: left;
  width: 100%;

  &:hover {
    background-color: var(--jsxc-color-background-hover);
  }

  &::after {
    color: var(--jsxc-color-main-text);
    content: "\002B";
    float: right;
    font-weight: bold;
    margin-left: 5px;
  }

  +ul {
    max-height: 0;
  }

  &.jsxc-active {
    &::after {
      content: "\2212";
    }

    +ul {
      max-height: none;
    }
  }
}

.jsxc-filter-wrapper {
  position: relative;

  .jsxc-clear {
    background-color: $roster-input-bg;
    border: 0;
    bottom: 0;
    display: none;
    opacity: 0.4;
    outline: none;
    position: absolute;
    right: 0;
    top: 0;

    &:hover {
      opacity: 0.7;
    }
  }

  >i {
    bottom: 0;
    left: 0;
    opacity: 0.4;
    position: absolute;
    top: 0;
    width: 28px;
  }
}

input.jsxc-filter-input {
  background-color: $roster-input-bg;
  background-image: none;
  border: 0;
  color: var(--jsxc-color-main-text);
  height: 30px;
  outline: none;
  padding: 7px 28px 5px;
  transition: height 0.5s;
  width: 100%;

  &:focus {
    height: 42px;

    +.jsxc-clear {
      display: block;
    }
  }
}

.jsxc-collapsible-content {
  max-height: 0;
  overflow: hidden;
  padding-bottom: 15px;
  transition: max-height 0.2s ease-out;
}

#jsxc-roster {
  background-color: $roster-bg;
  border-left: 1px solid $roster-border-left;
  bottom: 0;
  color: var(--jsxc-color-main-text);
  display: flex;
  flex-direction: column;
  margin-left: 10px;
  overflow: visible;
  position: fixed;
  right: 0;
  top: 0;
  transition: right 0.5s;
  width: 200px;
  z-index: 80;

  .jsxc-roster-hidden & {
    right: -200px;
  }

  a {
    cursor: pointer;
  }

  .jsxc-avatar {
    cursor: pointer;
    position: relative;

    img {
      cursor: pointer;
    }
  }

  .jsxc-wait {
    background-color: $white;
    bottom: 0;
    left: 0;
    padding: 20px;
    position: absolute;
    top: 0;
    width: 160px;
    z-index: 60;

    img {
      padding: 5px;
    }

    h3 {
      font-size: 1.13em;
      font-weight: bold;
      margin-bottom: 5px;
    }
  }

  .jsxc-roster-item input {
    background-color: $roster-input-bg;
    background-image: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: inner 0 0 5px $roster-input-shadow;
    box-sizing: border-box;
    font-size: 13px;
    height: 35px;
    margin: 0;
    outline: none;
    padding: 7px 6px 5px;
    width: 100%;
  }

  p {
    color: $roster-color;
    padding: 10px;

    a {
      color: $roster-a;
      text-decoration: underline;
    }
  }

  .jsxc-expand input {
    left: 51px;
    width: 137px;
  }

  &.jsxc-state-hidden {
    display: block;
    right: -200px;
    transition: right 0.5s;
  }

  &.jsxc-state-shown {
    display: block;
    right: 0;
    transition: right 0.5s;
  }

  >.jsxc-bottom {
    background-color: $roster-bottom-bg;
    flex-shrink: 0;
    padding: 5px 4px 2px 0;
    width: 100%;

    &:hover {
      background-color: $roster-bottom-bg-hover;
    }

    >div:not(.jsxc-avatar) {
      height: 100%;
    }
  }

  form {
    padding: 15px;

    button,
    input {
      border-radius: 0;
      margin: 0 0 5px;
      width: 100%;
    }

    .btn-primary {
      background-color: #dadada;
      border-color: #c1c1c1;
      transition: background-color 0.5s;

      &:hover {
        background-color: #a2a2a2;
      }
    }

    label {
      display: block;
    }

    input {
      position: static;
    }
  }

  .jsxc-roster-status {
    bottom: 0;
    display: none;
    position: absolute;
  }

  &.jsxc-status-show {
    .jsxc-roster-status {
      display: block;
    }
  }

  &.jsxc-hide-offline {
    .jsxc-roster-item[data-presence="offline"] {
      display: none;
    }

    li.jsxc-hide-offline {
      .jsxc-hide-offline {
        display: none;
      }

      .jsxc-show-offline {
        display: inherit;
      }
    }

    .jsxc-contact-list::after,
    .jsxc-group-list::after {
      content: attr(data-offline-hidden-label);
    }
  }

  &[data-presence="offline"] {
    .jsxc-contact-list::after,
    .jsxc-group-list::after {
      content: attr(data-presence-offline-label);
    }

    .jsxc-bottom .jsxc-avatar {
      background-image: url("../images/icons/placeholder.svg");
    }

    .jsxc-filter-wrapper,
    .jsxc-collapsible,
    .jsxc-group-list {
      display: none;
    }
  }

  &[data-mute="yes"] {
    .jsxc-js-presence-menu .jsxc-menu__button::after {
      content: map-get($jsxc-icons-map, "mute");
      font-family: jsxc-icons !important;
      -moz-osx-font-smoothing: grayscale;
      -webkit-font-smoothing: antialiased;
      font-style: normal;
      font-variant: normal;
      font-weight: normal !important;
      line-height: 1;
      opacity: 0.4;
      padding-left: 0.2em;
      text-transform: none;
      vertical-align: text-top;
    }
  }
}

.jsxc-roster-toggle {
  background-color: var(--jsxc-color-background-dark);
  border-radius: 14px 0 0 14px;
  cursor: pointer;
  height: 44px;
  margin-right: 1px;
  margin-top: -22px;
  position: absolute;
  right: 100%;
  top: 50%;
  transition: width 0.5s, background-color 0.5s;
  width: 14px;
  z-index: 110;

  &::after {
    border: 8px solid var(--jsxc-color-text-lighter);
    border-bottom-color: transparent;
    border-left-color: transparent;
    border-left-width: 0;
    border-top-color: transparent;
    content: " ";
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -7px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    width: 0;

    .jsxc-roster-shown & {
      transform: rotate(180deg);
    }
  }

  &:hover {
    background-color: var(--jsxc-color-background-darker);
    width: 28px;
  }
}

.jsxc-roster-item {
  color: $roster-color;
  margin: 0;
  padding: 0;

  &:hover {
    background-color: $roster-bg-hover;
  }

  &[data-subscription="from"],
  &[data-subscription="none"] {
    .jsxc-bar__caption {
      opacity: 0.7;
    }

    .jsxc-avatar {
      filter: grayscale(100%);
    }
  }

  &--filtered {
    display: none;
  }
}

#jsxc-roster[data-presence="offline"] li:not(.jsxc-offline-available) {
  opacity: 0.5;

  &:hover {
    background-color: inherit;
    cursor: auto;
  }
}

li.jsxc-hide-offline {
  .jsxc-hide-offline {
    display: inherit;
  }

  .jsxc-show-offline {
    display: none;
  }
}

.jsxc-bounce {
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-name: jsxc-bounce-6;
  animation-timing-function: ease;
  background-color: $notice-bg;
  border-radius: 11px;
  color: $notice-color;
  display: inline-block;
  font-size: 80%;
  height: auto;
  line-height: 1.5em;
  padding: 2px 3px;
  position: relative;
  text-align: center;
  transform-origin: bottom;

  &:empty {
    display: none;
  }
}

.jsxc-contact-list,
.jsxc-group-list {
  @include presence-indicator(" .jsxc-avatar");
  list-style: none;
  margin: 0;
  margin-bottom: 1em;
  overflow: hidden;
  padding: 0;
  width: 100%;
  z-index: 85;

  &::after {
    display: block;
    font-size: 0.8em;
    font-style: italic;
    line-height: 44px;
    opacity: 0.6;
    text-align: center;
  }

  &:empty::after {
    content: attr(data-empty-list-label);
  }

  &-wrapper {

    @extend %scrollbar;
    flex-grow: 1;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .jsxc-unread-msg {
    .jsxc-name {
      padding-right: 0;
    }
  }

  .jsxc-oneway {
    .jsxc-avatar,
    .jsxc-caption {
      opacity: 0.7;
    }
  }

  .jsxc-right {
    float: right;
    margin-right: 6px;

    div {
      color: $white;
      font-size: 13px;
      font-weight: bold;
      line-height: 20px;
      text-align: center;

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

.jsxc-blocked {
  cursor: default !important;

  .jsxc-bar__caption {
    color: var(--jsxc-color-error);
    text-decoration: line-through;
  }

  .jsxc-menu {
    display: none;
  }
}
