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

/* ===== messenger.css ==================================================
  == Styles shared throughout the Messenger application.
  ======================================================================= */

@import url("chrome://global/skin/");
@import url("chrome://messenger/content/messenger.css");
@import url("chrome://messenger/skin/shared/messenger.css");

toolbox:-moz-lwtheme {
  border-top-width: 0;
}

.toolbar-primary {
  border-top: none;
}

.menu-iconic > .menu-iconic-left,
.menuitem-iconic > .menu-iconic-left {
  display: -moz-box;
  padding-top: 0;
}

#tabbar-toolbar {
  border: none;
}

#tabbar-toolbar[customizing="true"] {
  min-width: 24px;
}

/* ::::: menubar ::::: */

#menubar-items {
  -moz-box-orient: vertical; /* for flex hack */
  margin-bottom: 1px;
}

#menubar-items > menubar {
  -moz-box-flex: 1; /* make menu items expand to fill toolbar height */
}

/* ::::: toolbarbutton ::::: */

.toolbarbutton-1,
.toolbarbutton-menubutton-button {
  padding-top: 5px;
  padding-bottom: 6px;
  -moz-padding-start: 4px;
  -moz-padding-end: 5px;
}

.toolbarbutton-1:hover:active:not([disabled]),
.toolbarbutton-1[open="true"],
.toolbarbutton-menubutton-button:hover:active:not([disabled]),
.toolbarbutton-menubutton-button[open="true"] {
  padding-top: 6px;
  padding-bottom: 5px;
  -moz-padding-start: 5px;
  -moz-padding-end: 4px;
}

.toolbarbutton-1[checked="true"] {
  padding: 1px 5px !important;
}

.toolbarbutton-1 .toolbarbutton-icon,
.formatting-button .toolbarbutton-icon {
  -moz-margin-end: 0px;
}

/* Has to be !important to overrule toolkit's dropmarker.css for the
   dropmarker[disabled="true"] case. */
.toolbarbutton-menu-dropmarker {
  -moz-padding-start: 3px !important;
}

toolbar[mode="full"] .toolbarbutton-1 {
  min-width: 55px;
}

sidebarheader .toolbarbutton-text:not([value]) {
  display: none;
}

#tabmail-buttons > toolbarbutton {
  margin-top: 3px;
  margin-bottom: 0;
}

menulist.folderMenuItem menu:not(.folderMenuItem) {
  padding-top: 3px;
  padding-bottom: 3px;
}

#searchInput,
#IMSearchInput,
.remote-gloda-search {
  -moz-appearance: none;
  border: 1px solid ThreeDShadow;
  -moz-padding-end: 2px;
  -moz-padding-start: 2px;
}

#searchInput:-moz-lwtheme,
#IMSearchInput:-moz-lwtheme,
.remote-gloda-search:-moz-lwtheme {
  border-color: rgba(0, 0, 0, .32);
  color: black;
}

#searchInput:-moz-lwtheme:hover:not([focused="true"]),
#IMSearchInput:-moz-lwtheme:hover:not([focused="true"]),
.remote-gloda-search:-moz-lwtheme:hover:not([focused="true"]) {
  background-color: rgba(255,255,255,.9);
}

#searchInput:-moz-lwtheme[focused="true"],
#IMSearchInput:-moz-lwtheme[focused="true"],
.remote-gloda-search:-moz-lwtheme[focused="true"] {
  background-color: white;
}

#status-bar:-moz-lwtheme {
  padding-bottom: 1px;
}

.remote-gloda-search-container {
  padding-top: 1px;
  padding-bottom: 1px;
}

treechildren::-moz-tree-cell-text {
  padding-inline-start: 2px;
  padding-bottom: 2px;
}

@media not all and (-moz-windows-default-theme) {
  treechildren::-moz-tree-cell-text {
    -moz-padding-start: 4px !important;
  }
}

/* ::::: Notifications ::::: */

notification[value="addon-install-failed"] .messageCloseButton {
  list-style-image: url("chrome://messenger/skin/icons/closeTab.png");
}

notification[type="critical"] .messageCloseButton:not(:hover):not(:active) {
  -moz-image-region: rect(0, 64px, 16px, 48px);
}

menulist.folderMenuItem > .menulist-label-box > .menulist-label {
  -moz-margin-start: 2px !important;
}

button[type="menu-button"] > button {
  margin: -3px;
  -moz-margin-end: 0;
}

@media not all and (-moz-windows-default-theme) {
  button[type="menu-button"] > button {
    margin: -2px;
    -moz-margin-end: 0;
  }
}

@media (-moz-os-version: windows-xp) {
  #tabmail:not(:-moz-lwtheme) {
    background-color: ActiveCaption;
  }

  #tabmail:not(:-moz-lwtheme):-moz-window-inactive {
    background-color: InactiveCaption;
  }

  .toolbarbutton-1[checked="true"] {
    padding-top: 6px !important;
    padding-bottom: 5px !important;
    -moz-padding-start: 5px !important;
    -moz-padding-end: 4px !important;
  }

  treechildren::-moz-tree-cell-text {
    -moz-padding-start: 5px;
  }

  menulist.folderMenuItem menu:not(.folderMenuItem) {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  #searchInput,
  #IMSearchInput,
  .remote-gloda-search {
    min-height: 22px;
  }

  .remote-gloda-search-container {
    padding-top: 6px;
    padding-bottom: 5px;
  }

  #tabmail-buttons > toolbarbutton {
    margin-top: 1px;
    margin-bottom: 1px;
  }
}

@media not all and (-moz-os-version: windows-xp) {
  .toolbar-primary {
    -moz-appearance: none;
  }

  .toolbarbutton-menu-dropmarker {
    margin-top: 0;
  }

  #searchInput,
  #IMSearchInput,
  .remote-gloda-search {
    background-clip: padding-box;
    min-height: 24px;
    margin-top: 1px;
    margin-bottom: 1px;
    width: 25em;
  }

  @media not all and (-moz-windows-default-theme) {
    #tabmail:not(:-moz-lwtheme) {
      background-color: ActiveCaption;
    }

    #tabmail:not(:-moz-lwtheme):-moz-window-inactive {
      background-color: InactiveCaption;
    }

    notification[value="addon-install-blocked"],
    notification[value="addon-install-complete"] {
      background-image: url("chrome://mozapps/skin/extensions/stripes-info-negative.png"),
                        linear-gradient(rgba(204, 217, 234, 0.5),
                                        rgba(231, 237, 246, 0.8));
    }
  }

  @media not all and (-moz-windows-compositor) {
    #print-preview-toolbar:not(:-moz-lwtheme) {
      -moz-appearance: -moz-win-browsertabbar-toolbox;
    }
  }
}

@media (-moz-windows-default-theme) and (-moz-os-version: windows-vista),
       (-moz-windows-default-theme) and (-moz-os-version: windows-win7) {
  #searchInput,
  #IMSearchInput,
  .remote-gloda-search {
    border-radius: 2px;
    border-color: hsla(210, 54%, 20%, .25) hsla(210, 54%, 20%, .27)
                  hsla(210, 54%, 20%, .3);
    box-shadow: 0 1px hsla(0, 0%, 0%, .01) inset,
                0 1px hsla(0, 0%, 100%, .1);
  }

  #searchInput:not(:-moz-lwtheme):not([focused]):hover,
  #IMSearchInput:not(:-moz-lwtheme):not([focused]):hover,
  .remote-gloda-search:not(:-moz-lwtheme):not([focused]):hover {
    border-color: hsla(210, 54%, 20%, .35) hsla(210, 54%, 20%, .37)
                  hsla(210, 54%, 20%, .4);
  }

  #searchInput:not(:-moz-lwtheme)[focused],
  #IMSearchInput:not(:-moz-lwtheme)[focused],
  .remote-gloda-search:not(:-moz-lwtheme)[focused] {
    border-color: hsla(206, 100%, 60%, .65) hsla(206, 100%, 55%, .65)
                  hsla(206, 100%, 50%, .65);
  }
}

@media (-moz-windows-compositor) {
  #tabmail-container {
    -moz-appearance: -moz-win-exclude-glass;
  }

  #unifinder-searchBox,
  #task-addition-box {
    border-top: none;
    background-color: -moz-dialog;
  }

  #tabbar-toolbar #searchInput:not(:-moz-lwtheme) {
    background-color: rgba(255, 255, 255, .725);
    border-color: rgba(0, 0, 0, .32);
    color: black;
  }

  #tabbar-toolbar #searchInput:not(:-moz-lwtheme):hover {
    background-color: rgba(255, 255, 255, .898);
  }

  #tabbar-toolbar #searchInput:not(:-moz-lwtheme)[focused="true"] {
    background-color: white;
  }
}

@media (-moz-windows-default-theme) and (-moz-os-version: windows-win8),
       (-moz-windows-default-theme) and (-moz-os-version: windows-win10) {
  #searchInput:not(:-moz-lwtheme),
  #IMSearchInput:not(:-moz-lwtheme),
  .remote-gloda-search:not(:-moz-lwtheme) {
    background-color: hsla(0, 0%, 100%, .9);
    border: 1px solid transparent;
    border-color: hsla(210, 54%, 20%, .25) hsla(210, 54%, 20%, .27)
                  hsla(210, 54%, 20%, .3);
    box-shadow: 0 1px 0 hsla(0, 0%, 0%, .01) inset,
                0 1px 0 hsla(0, 0%, 100%, .1);
    transition-property: border-color, background-color;
    transition-duration: 200ms;
  }

  #searchInput:not(:-moz-lwtheme)[focused],
  #IMSearchInput:not(:-moz-lwtheme)[focused],
  .remote-gloda-search:not(:-moz-lwtheme)[focused] {
    background-color: hsla(0, 0%, 100%, 1);
    border-color: #4595e5;
  }
}
