/* 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/. */

%ifdef XP_UNIX
%ifndef XP_MACOSX
%define XP_LINUX
%endif
%endif

.browser {
  margin: 0 0;
}

.conv-bottom, .conv-nicklist {
  margin: 0 0;
}

.convBox {
  min-height: 135px;
}

.conv-top {
  min-height: 60px;
}

.conv-top-info {
  margin: 0 0;
  padding: 0 0;
  border-style: none;
  -moz-appearance: none;
%ifdef XP_MACOSX
  background-color: -moz-mac-chrome-active;
  background-image: -moz-linear-gradient(rgba(255,255,255,.43), rgba(255,255,255,0));
  border-bottom: 1px solid rgba(0, 0, 0, 0.57);
}

.conv-top-info:-moz-window-inactive {
  background-color: -moz-mac-chrome-inactive;
  border-bottom-color: rgba(0, 0, 0, 0.32);
%else
  background-color: -moz-Dialog;
%ifdef XP_WIN
  background-image: -moz-linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0));
%else
  background-image: -moz-linear-gradient(rgba(255,255,255,.3), rgba(255,255,255,0));
%endif
%ifndef XP_WIN
  border-bottom: 1px solid ThreeDShadow;
%else
  border-bottom: none;
%endif
%endif
}

.userIconHolder {
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 5px;
  overflow: hidden;
}

.userIcon,
.userIconHolder {
  max-width: 48px;
  max-height: 48px;
  width: 48px;
  height: 48px;
}

.userIcon:not([src]),
.userIconHolder:not([userIcon]) {
  display: none;
}

.userIcon[src=""] {
  background-image: url("chrome://instantbird/skin/userIcon.png");
  background-size: contain;
  background-repeat: no-repeat;
}

.statusTypeIcon {
  margin: 0 0;
  min-height: 16px;
  min-width: 16px;
  max-height: 16px;
  max-width: 16px;
  -moz-appearance: none;
  background-color: transparent;
  border: none;
}

.statusMessage {
  margin: 0 0 !important;
%ifdef XP_MACOSX
  min-height: 16px;
%endif
}

.statusMessage[noTopic]:not([editing]),
.statusMessageWithDash[noTopic] {
  font-style: italic;
}

.alltargets-button > .toolbarbutton-text,
.alltargets-button > .toolbarbutton-menu-dropmarker {
  display: none;
}

/* Remove the margin set by the menu dropmarker so that target switcher button
 * doesn't have uneven padding. */
.alltargets-button > .toolbarbutton-icon {
  margin: 0;
}

.alltargets-item[selected="true"] {
  font-weight: bold;
}

/* The Australis themed button is borrowed from the Firefox toolbarbutton
 * (browser/themes/windows/browser.css). The properties are set in class
 * toolbarbutton-1 of the CSS file. */
.conv-top-info > toolbarbutton {
  -moz-appearance: none;
  max-height: 22px;
  border: 1px solid transparent;
  padding: 2px 3px;
  margin: 0 0;
}

.conv-top-info > toolbarbutton:hover:not([disabled="true"]) {
  background: hsla(0,0%,100%,0.5) linear-gradient(hsla(0,0%,100%,0.1), hsla(0,0%,100%,0.2)) padding-box;
  transition: background-color 250ms;
  border: 1px solid hsla(0,0%,0%,0.5);
  box-shadow: 0 1px 0 hsla(0,0%,100%,0.5),
              0 1px 0 hsla(0,0%,100%,0.7) inset;
  border-radius: 3px;
}

.conv-top-info > toolbarbutton[open="true"],
.conv-top-info > toolbarbutton[open="true"]:hover,
.conv-top-info > toolbarbutton:active:not([disabled="true"]) {
  background: linear-gradient(transparent, rgba(0,0,0,0.15)) !important;
  border: 1px solid hsla(0,0%,0%,0.5);
  box-shadow: 0 1px 0 hsla(0,0%,100%,0.5),
              0 1px 0 hsla(0,0%,0%,0.05) inset,
              0 1px 1px hsla(0,0%,0%,0.2) inset;
  border-radius: 3px;
}

.displayNameAndToolbar {
  border-bottom: 1px solid rgba(0,0,0,0.25);
  margin: 1px 4px 20px 0;
}

.status-overlay-icon[status="away"],
.status-overlay-icon[status="unavailable"] {
  list-style-image: url('chrome://chat/skin/away.png');
}

.status-overlay-icon[status="idle"] {
  list-style-image: url('chrome://chat/skin/idle.png');
}

.status-overlay-icon[status="mobile"] {
  list-style-image: url('chrome://chat/skin/mobile.png');
}

.status-overlay-icon[status="offline"] {
  list-style-image: url('chrome://chat/skin/offline.png');
}

.status-overlay-icon[status="unknown"] {
  list-style-image: url('chrome://chat/skin/unknown.png');
}

@media all and (min-height: 251px) {
  .statusImageStack,
  .displayNameAndstatusMessageStack {
    margin: 2px 0 2px 2px;
  }

  .displayNameAndstatusMessageStack {
    margin-inline-start: 4px;
  }

  .statusMessage {
    margin-top: 32px !important;
  }

  .statusMessage[editing] {
%ifdef XP_MACOSX
    margin: 29px 0 -1px -4px !important;
%else
%ifdef XP_WIN
    margin: 28px 0 -1px -2px !important;
%else
    margin: 29px 0 -3px -4px !important;
%endif
%endif
  }

  .displayName {
    font-size: 16px;
    margin: 5px 0 0 0 !important;
    padding-right: 20px;
  }

  .statusTypeIcon {
    margin: 32px 0 0;
  }

  .convToolbar {
    margin: 1px 0 0;
  }

  .userIconHolder[userIcon] + .statusTypeIcon {
    margin-left: 32px;
  }
}

@media all and (max-height: 250px) {
  .conv-top-info {
    -moz-box-align: baseline;
  }

  .displayName,
  .statusMessageWithDash {
    margin: 2px 0 !important;
  }

  .statusMessage[editing] {
%ifdef XP_WIN
    margin: -1px 2px 0px 8px !important;
%else
    margin: -3px 0 -1px 9px !important;
%endif
  }

  .statusTypeIcon {
    margin: 1px 3px;
  }

  .convToolbar {
    margin: -1px 1px 0;
  }

  .conv-top-info > toolbarbutton {
    max-height: 20px;
    padding: 1px 2px;
  }
}

.conv-messages {
  min-width: 150px;
%ifndef XP_MACOSX
%ifndef XP_WIN
  border-bottom: solid 1px GrayText;
%else
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-left: none;
  border-right: none !important;
%endif
%endif
}

%ifndef XP_MACOSX
.conv-messages[chat] {
  border-right: solid 1px GrayText;
}
%endif


/* Status text bar */

.conv-status-container {
  display: block;
  padding: 3px;
  padding-bottom: 1px;
%ifdef XP_MACOSX
  border-top: 1px solid GrayText;
  margin-bottom: -1px; /* match splitter-bottom height */
%else
  margin-bottom: -3px; /* match splitter-bottom height */
%endif

  /* Animation copied from the findbar in Firefox */
  transition-property: margin-top, opacity, visibility;
  transition-duration: 100ms, 100ms, 0s;
  transition-timing-function: ease-in-out, ease-in-out, linear;
}

.conv-status-container[hidden] {
  /* Override display:none to make the transition work. */
  display: -moz-box;
  visibility: collapse;
  margin-top: -1em;
  opacity: 0;
  transition-delay: 0s, 0s, 100ms;
}


/* Input box */

.conv-textbox {
  margin: 0;
  -moz-appearance: none;
}

%ifdef XP_MACOSX
.conv-textbox {
  padding: 3px;
  border: none;
  box-shadow: inset 0 1px 3px 0px rgba(0, 0, 0, 0.6);
}

.conv-textbox[focused="true"] {
  box-shadow: inset 0 0 2px 1px rgba(40, 120, 212, 0.9),
                    0 0 2px 0px rgba(40, 120, 212, 0.6),
              inset 0 1px 2px 0px rgba(0, 0, 0, 0.5);
}

.conv-textbox[invalidInput="true"] {
  box-shadow: inset 0 0 2px 1px rgba(255, 0, 0, 0.9),
                    0 0 2px 0px rgba(255, 0, 0, 0.6),
              inset 0 1px 2px 0px rgba(0, 0, 0, 0.4);
}

%else
.conv-textbox {
  padding: 2px;
  border: 1px solid transparent;
}

.conv-textbox[invalidInput="true"] {
  border-color: red;
}

.conv-textbox > .textbox-input-box {
  background: inherit;
}

%ifndef XP_WIN
.conv-textbox {
  margin-inline-start: 1px;
}
%endif
%endif


/* Character counter */

.conv-counter {
  color: black;
  background-color: rgba(246, 246, 246, 0.7);
  border-inline-start: 1px solid rgb(200, 200, 200);
  border-top: 1px solid rgb(200, 200, 200);
  font-size: 120%;
  padding-top: 0;
  padding-inline-start: 5px;
}

.conv-counter:-moz-locale-dir(ltr) {
  border-top-left-radius: 3px;
}

.conv-counter:-moz-locale-dir(rtl) {
  border-top-right-radius: 3px;
}

.conv-counter[value=""] {
  display: none;
}

/* Negative counter values (user went over the character limit). */
.conv-counter[value^="-"] {
  color: red;
}

%ifdef XP_MACOSX
.conv-counter {
  padding-bottom: 0;
  padding-inline-end: 5px;
  margin-inline-end: 2px;
  margin-bottom: 2px !important; /* override 4px from description */
}

%else
.conv-counter {
  padding-bottom: 1px;
  padding-inline-end: 6px;
  margin: 0 !important;  /* override margins from description */
}

.conv-counter[value^="-"] {
  margin-bottom: 1px !important;
  /* The 6px padding-end from .conv-counter is split into a 1px
     margin-end (to avoid the border) and 5px padding-end (as
     regular padding). */
  margin-inline-end: 1px !important;
  padding-top: 1px;
  padding-bottom: 0;
  padding-inline-end: 5px;
}
%endif


/* Splitters */

.splitter {
  margin: 0;
  border-style: none;
%ifdef XP_MACOSX
  min-height: 2px;
  background: -moz-linear-gradient(top, rgba(0,0,0,0.35), transparent);
%else
  height: 3px;
  background: transparent;
%endif
}

.splitter-bottom {
  background: #ddd; /* match URL popup bottom edge from tabbrowser-*.css */
%ifndef XP_LINUX
  min-height: 1px;
  height: 1px;
%endif
}

%ifdef XP_MACOSX
grippy {
  display: none;
}

.splitter.conv-chat {
  background: -moz-linear-gradient(top, #404040, rgba(0,0,0,0.35));
  min-width: 1px;
  width: 1px;
}

.splitter.conv-chat:-moz-window-inactive {
  background: rgba(0,0,0,0.35);
}

.splitter.conv-chat[state="collapsed"] {
  width: 3px;
}
%else
%ifdef XP_WIN
.splitter.conv-chat {
  border-left: 1px solid rgba(0, 0, 0, 0.25);
}

/* Splitter style change above somehow made it smaller, fix this here: */
grippy {
  margin: 0 1px;
}
%endif
%endif


#conv-toolbar {
  border-style: none;
}

.listcell-label {
  font-weight: bold;
  padding-inline-start: 1px;
%ifdef XP_MACOSX
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
%endif
}

.listcell-icon {
  min-width: 16px;
  margin: 0 2px;
}

%ifdef XP_MACOSX
.conv-nicklist-header {
  -moz-appearance: treeheadercell;
  margin-right: -1px;
}

%endif
.conv-nicklist-header-label {
%ifdef XP_MACOSX
  margin-inline-start: 3px !important;
  margin-top: 1px !important;
  margin-bottom: 0 !important;
%else
  font-weight: bold;
  margin-inline-start: 0 !important;
%endif
  margin-inline-end: 2px !important;
}

%ifdef XP_MACOSX
.conv-nicklist {
  -moz-appearance: -moz-mac-source-list;
  width: 160px;
  border: 0;
}
%endif

.listitem-iconic[inactive] > .listcell-iconic > .listcell-icon {
  opacity: 0.45;
}

.listitem-iconic[inactive][selected] > .listcell-iconic > .listcell-icon {
  opacity: 0.7;
}

.listitem-iconic[inactive] > .listcell-iconic > .listcell-label {
  color: GrayText !important;
  font-weight: normal;
}

.listitem-iconic[inactive][selected] > .listcell-iconic > .listcell-label {
%ifdef MACOSX
  color: -moz-DialogText !important;
%else
  color: -moz-cellhighlighttext !important;
%endif
}

.conv-nicklist:focus > .listitem-iconic[inactive][selected] > .listcell-iconic > .listcell-label {
  color: HighlightText !important;
}

.alltargets-item-icon {
  min-width: 16px;
  min-height: 16px;
}
