/* 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 {
  -moz-binding: url("chrome://instantbird/content/contact.xml#contact");
  -moz-box-align: center;
}
contact[open],
contact[aliasing],
#buddylistbox:focus > contact[selected] {
  -moz-binding: url("chrome://instantbird/content/contact.xml#contact-big");
  -moz-box-orient: vertical;
  -moz-box-align: stretch;
}

contact[aliasing] .contactDisplayName {
  -moz-binding: url("chrome://global/content/bindings/textbox.xml#textbox");
}

buddy {
  -moz-binding: url("chrome://instantbird/content/buddy.xml#buddy");
}
buddy[dummy] {
  -moz-binding: url("chrome://instantbird/content/buddy.xml#buddy-dummy");
}

group {
  -moz-binding: url("chrome://instantbird/content/group.xml#group");
  -moz-box-align: center;
}

/* The height is required for the animation to work. */
group {
  height: 1em;
}

conv,
contact,
buddy {
  /* Variable set from blist.js. This is necessary as CSS transitions don't
     work with height: auto.
     Usually 16+2+2px for the protocol icon, padding top and bottom. */
  height: var(--blist-item-height);
}

contact[open],
contact[aliasing],
#buddylistbox:focus > contact[selected] {
  /* This is fine because height transitions in this state are on the
     buddies, and there is no transition on selection (it's instant). */
  height: auto;
}

/* Possible values of the |state| attribute:
 - not set: the binding is not initialized yet,
 - showing: during the expand animation,
 - visible: the buddy is visible to the user,
 - fading: the buddy has signed-off, during the fade out animation,
 - collapsing: collapse animation (before the node is removed from the DOM),
 - collapsed: the buddy is inside a closed group.
 */
contact:not([state]),
buddy:not([state]) {
  height: 0;
}

contact[state="showing"],
buddy[state="showing"] {
  /* Should match the transition effect for contact/buddy collapsing so
     that reordering doesn't make the whole list jump. */
  transition: height .2s ease-in;
}

contact[state="fading"] {
  opacity: 0;
  transition: opacity .4s ease-in 1s;
}

contact[state="collapsing"],
buddy[state="collapsing"],
group[collapsing="true"] {
  height: 0;
  transition: height .2s ease-in;
}

contact[state="collapsing"] *,
contact[state="showing"] *,
buddy[state="collapsing"] *,
buddy[state="showing"] *,
group[collapsing="true"] * {
  display: none;
}

#dummyContact {
  height: auto;
}

#dummylistbox {
  visibility: hidden;
}

tooltip[type="im"] {
  -moz-binding: url("chrome://chat/content/imtooltip.xml#tooltip");
}

#userIcon {
  -moz-user-focus: normal;
}

#statusTypeIcon {
  cursor: pointer;
  -moz-user-focus: ignore;
}

#displayName,
#statusMessage:not([statusType="offline"]) {
  cursor: text;
}

#displayName[editing],
#statusMessage[editing] {
  -moz-appearance: textfield;
  -moz-binding: url('chrome://global/content/bindings/textbox.xml#textbox');
}

.convUnreadCount,
.convUnreadTargetedCount,
.hideGroupButton,
.startChatBubble,
.expander-up,
.expander-down {
  cursor: pointer;
}

.hideGroupButton,
.startChatBubble,
.expander-up,
.expander-down {
  -moz-user-focus: ignore;
}

.hideGroupButton,
.startChatBubble
{
  display: none;
}

group:not([id="group-1"]):hover .hideGroupButton,
contact[cansend]:hover .startChatBubble,
#buddylistbox:focus > contact[cansend][selected] .startChatBubble {
  display: -moz-box;
}

conv {
  -moz-binding: url("chrome://instantbird/content/conv.xml#conv");
  -moz-box-align: center;
}

.convUnreadCount[value="0"],
.convUnreadTargetedCount[value="0"] {
  display: none;
}

#buddyListMsg[listedConvCount="0"] > .listboxHeader {
  display: none;
}

#buddyListMsg[listedConvCount="0"] > #convlistbox {
  -moz-user-focus: ignore;
}

/* Make the notification bar work with narrow windows. */
.notification-inner > hbox {
  display: inline-block;
}

.notification-inner > hbox > .messageImage {
  max-width: 0;
}

#userIconCanvas {
  display: none;
}

#userIconPanelImage[src=""] + #userIconPanelImageRemove {
  display: none;
}
