/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

.contact-import-spinner {
  display: none;
}

.contact-import-spinner.busy {
  display: inline-block;
  vertical-align: middle;
  -moz-margin-start: 10px;
}

.content-area input.contact-filter {
  margin-top: 14px;
  border-radius: 10000px;
}

.contact-list {
  overflow-x: hidden;
  overflow-y: auto;
  /* Space for six contacts, not affected by filtering.  This is enough space
     to show the dropdown menu when there is only one contact. */
  height: 306px;
}

.contact-list-title {
  padding: 0 1rem;
  color: #666;
  font-weight: 500;
  font-size: .9em;
}

.contact,
.contact-separator {
  padding: .5rem 15px;
  font-size: 13px;
}

.contact {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  color: #666;
}

.contact-separator {
  background-color: #eee;
  color: #888;
}

.contact-separator:not(:first-child) {
  border-top: 1px solid #ccc;
}

.contact:hover {
  background-color: #E3F7FE;
}

.contact:hover > .icons {
  display: block;
  z-index: 1;
}

.contact > .details {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact:hover > .details {
  /* Hovering the contact shows the icons/ buttons, which takes up horizontal
   * space. This causes the fixed-size avatar to resize horizontally, so we assign
   * a flex value equivalent to the maximum pixel value to avoid the resizing
   * to happen. Consider this a hack. */
  flex: 190;
}

.contact > .avatar {
  width: 40px;
  height: 40px;
  background-color: #ccc;
  border-radius: 50%;
  -moz-margin-end: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  background-image: url("../shared/img/audio-call-avatar.svg");
  background-repeat: no-repeat;
  background-color: #4ba6e7;
  background-size: contain;
  -moz-user-select: none;
}

/*
 * Loop through all 12 default avatars.
 */
.contact:nth-child(12n + 1) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#blue-avatar");
  background-color: #4A90E2;
}

.contact:nth-child(12n + 2) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#orange-avatar");
  background-color: #F3A35C;
}

.contact:nth-child(12n + 3) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#mintgreen-avatar");
  background-color: #50E2C2;
}

.contact:nth-child(12n + 4) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#lightpink-avatar");
  background-color: #E364A1;
}

.contact:nth-child(12n + 5) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#grey-avatar");
  background-color: #9B9B9B;
}

.contact:nth-child(12n + 6) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#yellow-avatar");
  background-color: #F3E968;
}

.contact:nth-child(12n + 7) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#purple-avatar");
  background-color: #9C61AF;
}

.contact:nth-child(12n + 8) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#lightgreen-avatar");
  background-color: #9AC967;
}

.contact:nth-child(12n + 9) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#darkblue-avatar");
  background-color: #607CAE;
}

.contact:nth-child(12n + 10) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#darkpink-avatar");
  background-color: #CE4D6E;
}

.contact:nth-child(12n + 11) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#brown-avatar");
  background-color: #8A572A;
}

.contact:nth-child(12n + 12) > .avatar.defaultAvatar {
  background-image: url("../shared/img/avatars.svg#green-avatar");
  background-color: #56B397;
}

.contact > .avatar > img {
  width: 100%;
}

.contact-list-empty {
  background-image: url("../shared/img/empty_contacts.svg");
  background-repeat: no-repeat;
  background-position: top center;
  padding-top: 28%;
  padding-bottom: 5%;
  text-align: center;
  color: #4a4a4a;
  font-weight: lighter;
}

.panel-text-medium,
.panel-text-large {
  margin: 3px;
}

.panel-text-medium {
  font-size: 1.6rem;
}

.panel-text-large {
  font-size: 2.2rem;
}

.contact > .details > .username {
  font-size: 1.3rem;
  line-height: 20px;
  color: #000;
}

.contact.blocked > .details > .username {
  color: #d74345;
}

.contact > .details > .username > strong {
  font-weight: bold;
}

.contact > .details > .username > i.icon-blocked {
  display: inline-block;
  width: 10px;
  height: 20px;
  -moz-margin-start: 3px;
  background-image: url("../shared/img/icons-16x16.svg#block-red");
  background-position: center;
  background-size: 10px 10px;
  background-repeat: no-repeat;
}

.contact > .details > .email {
  color: #4a4a4a;
  font-size: 11px;
  line-height: 14px;
}

.icons {
  cursor: pointer;
  display: none;
  -moz-margin-start: auto;
  color: #fff;
  -moz-user-select: none;
}

.icons:hover {
  display: block;
}

.icons i {
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
}

.icon-contact-video-call {
  padding: 15px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #5bc0a4;
  background-image: url("../shared/img/icons-14x14.svg#video-white");
  background-size: 16px 16px;
}

.icon-contact-video-call:hover {
  background-color: #47b396;
}

.icon-contact-video-call:active {
  background-color: #3aa689;
}

.icon-vertical-ellipsis {
  /* Added padding for a larger click area. */
  padding: 0 10px;
  margin: 6px 0;
  -moz-margin-start: 5px;
  -moz-margin-end: -8px;
  width: 4px;
  height: 20px;
  background-image: url("../shared/img/ellipsis-v.svg");
  background-size: contain;
}

.contact > .dropdown-menu {
  z-index: 2;
  top: 37px;
  right: 22px;
  bottom: auto;
  left: auto;
}

html[dir="rtl"] .contact > .dropdown-menu {
  right: auto;
  left: 22px;
}

.contact > .dropdown-menu-up {
  bottom: 25px;
  top: auto;
}

.contact-form > .button-group {
  margin-top: 1rem;
}

.contacts-gravatar-promo {
  position: relative;
  border: 1px dashed #c1c1c1;
  border-radius: 2px;
  background-color: #fbfbfb;
  padding: 10px;
  margin-top: 10px;
}

.contacts-gravatar-promo > p {
  margin-top: 2px;
  margin-bottom: 8px;
  margin-right: 4px;
  word-wrap: break-word;
}

html[dir="rtl"] .contacts-gravatar-promo > p {
  margin-right: 0;
  margin-left: 4px;
}

.contacts-gravatar-promo > p > a {
  color: #0295df;
  text-decoration: none;
}

.contacts-gravatar-promo > p > a:hover {
  text-decoration: underline;
}

.contacts-gravatar-promo > .button-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

html[dir="rtl"] .contacts-gravatar-promo > .button-close {
  right: auto;
  left: 8px;
}

.contact-controls {
  padding: 0 16px;
}

.contact-controls > .button {
  padding: .5em;
  border: none;
  border-radius: 5px;
}

.button.primary {
  background: #00A9DC;
  color: #fff;
}

.button.secondary {
  background: #EBEBEB;
  color: #4D4D4D;
}

.contact-controls > .primary {
  flex: 5;
}

.contact-controls > .secondary {
  flex: 3;
}
