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

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

/**
 * Tabmail Tabs
 */

#tabpanelcontainer:-moz-lwtheme {
  color: inherit;
}

.tabmail-arrowscrollbox {
  margin-bottom: -1px;
}

/**
 * Tab
 */

@media (min-resolution: 1.25dppx) {
  /* image preloading hack from shared/tabmail.css */
  #tabs-toolbar::before {
    background-image: url(tabs/background-end@2x.png),
                      url(tabs/background-middle@2x.png),
                      url(tabs/background-start@2x.png);
  }

  .tabmail-tab:hover > .tab-stack > .tab-background:not([selected=true]),
  .tabs-newtab-button:hover {
    background-image: url(tabs/background-start@2x.png),
                      url(tabs/background-middle@2x.png),
                      url(tabs/background-end@2x.png);
  }

  .tab-background-middle[selected=true] {
    background-image: url(tabs/active-middle@2x.png),
                      var(--fgTabTexture),
                      none;
  }

  .tab-background-start[selected=true]:-moz-locale-dir(ltr)::after,
  .tab-background-end[selected=true]:-moz-locale-dir(rtl)::after {
    background-image: url(tabs/stroke-start@2x.png);
  }

  .tab-background-end[selected=true]:-moz-locale-dir(ltr)::after,
  .tab-background-start[selected=true]:-moz-locale-dir(rtl)::after {
    background-image: url(tabs/stroke-end@2x.png);
  }
}

#messengerWindow[tabsintitlebar]
.tabmail-tab:not([selected]):not(:-moz-lwtheme) {
  color: CaptionText;
}

#messengerWindow[tabsintitlebar]
.tabmail-tab:not([selected]):not(:-moz-lwtheme):-moz-window-inactive {
  color: InactiveCaptionText;
}

.tabmail-tab[busy],
.tabmail-tab[thinking] {
  list-style-image: url("chrome://messenger/skin/icons/loading.png") !important;
  -moz-image-region: auto !important;
}

.tabmail-tab[type="glodaSearch"] {
  list-style-image: url("chrome://global/skin/icons/Search-glass.png");
}

.tabmail-tab[selected] > .tab-stack > .tab-content > .tab-text {
  opacity: 1.0 !important;
}

.tabmail-arrowscrollbox > .scrollbutton-up:-moz-lwtheme-brighttext,
.tabmail-arrowscrollbox > .scrollbutton-down:-moz-lwtheme-brighttext,
.tabs-alltabs-button:-moz-lwtheme-brighttext,
.tabs-closebutton:-moz-lwtheme-brighttext {
  background-color: rgba(0,0,0,.5);
}

.tabmail-arrowscrollbox > .scrollbutton-up:-moz-lwtheme-darktext,
.tabmail-arrowscrollbox > .scrollbutton-down:-moz-lwtheme-darktext,
.tabs-alltabs-button:-moz-lwtheme-darktext,
.tabs-closebutton:-moz-lwtheme-darktext {
  background-color: rgba(255,255,255,.5);
}

.tabmail-tabs:-moz-lwtheme {
  padding-top: 1px;
  background-color: transparent;
  background-image: none;
}

.tabmail-tab {
  list-style-image: url("chrome://global/skin/icons/folder-item.png");
  -moz-image-region: rect(0px, 16px, 16px, 0px);
}

tabpanels {
  -moz-appearance: none;
  background-color: transparent;
}

/* tabmail-tab focus ring */
.tabmail-tab > .tab-stack > .tab-content > .tab-text {
  border: 1px dotted transparent;
}

.tabmail-tab:focus > .tab-stack > .tab-content > .tab-text {
  border: 1px dotted -moz-DialogText;
}

/* Tab DnD indicator */
.tab-drop-indicator {
  list-style-image: url(tabs/dragIndicator.png);
  margin-bottom: -11px;
}

/**
 * close buttons
 */

.tabs-closebutton-box {
  margin-top: 2px;
  margin-bottom: 4px;
}

.tab-close-button > .toolbarbutton-icon {
  -moz-margin-end: 0px !important;
  margin-top: 1px;
}

.tab-close-button,
.tabs-closebutton {
  -moz-appearance: none;
  -moz-image-region: rect(0, 16px, 16px, 0);
  border: none;
  cursor: default;
  list-style-image: url(icons/closeTab.png);
}

#tabs-toolbar[brighttext] .tabs-closebutton:not(:hover):not(:active),
#tabs-toolbar[brighttext] .tab-close-button:not(:hover):not([selected="true"]) {
  -moz-image-region: rect(0, 64px, 16px, 48px);
}

.tabs-closebutton {
  padding: 0 2px;
}

.tab-close-button {
  -moz-margin-start: 6px;
  -moz-padding-start: 0 !important;
  -moz-padding-end: 0 !important;
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.tab-close-button:hover,
.tabs-closebutton:hover {
  -moz-image-region: rect(0, 32px, 16px, 16px);
}

.tab-close-button:hover:active,
.tabs-closebutton:hover:active {
  -moz-image-region: rect(0, 48px, 16px, 32px);
}

.tab-close-button:focus,
.tabs-closebutton:focus {
  outline: none !important;
}

/**
 * Tab Scrollbox Arrow Buttons
 */

.tabs-left {
  display: none;
}

.tabmail-arrowscrollbox > .scrollbutton-up {
  margin-top: 1px;
  margin-bottom: 1px;
  padding: 0 0 3px;
  width: 18px;
  height: 23px;
  -moz-margin-start: 0px;
  -moz-margin-end: 2px;
  list-style-image: url(tabs/arrow-left.png);
}

.tabmail-arrowscrollbox > .scrollbutton-up > .toolbarbutton-icon {
  margin: 2px 0px 0px;
}

.tabmail-arrowscrollbox > .scrollbutton-down-stack {
  height: 23px;
  margin-top: 1px;
  margin-bottom: 1px;
  -moz-margin-start: 2px;
}

.tabmail-arrowscrollbox > stack > .scrollbutton-down-box {
  width: 18px;
}

.tabmail-arrowscrollbox > stack > .scrollbutton-down {
  width: 18px;
  margin: 0px;
  padding: 0 0 3px;
  list-style-image: url(tabs/arrow-left.png);
}

.tabmail-arrowscrollbox > stack > .scrollbutton-down > .toolbarbutton-icon {
  margin-top: 2px;
  margin-bottom: 0px;
  -moz-margin-start: 1px;
  -moz-margin-end: 0px;
}

#tabs-toolbar[brighttext] .tabmail-arrowscrollbox > .scrollbutton-up,
#tabs-toolbar[brighttext] .tabmail-arrowscrollbox > stack > .scrollbutton-down {
  list-style-image: url(tabs/arrow-left-inverted.png);
}

.tabmail-arrowscrollbox > .scrollbutton-up[disabled],
.tabmail-arrowscrollbox > stack > .scrollbutton-down[disabled] {
  opacity: .4;
}

.tabmail-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(rtl),
.tabmail-arrowscrollbox > stack > .scrollbutton-down:-moz-locale-dir(ltr) {
  transform: scaleX(-1);
}

/**
 * All Tabs Button
 */

.tabs-alltabs-button {
  margin-top: 1px;
  margin-bottom: 1px;
  width: 18px !important;
  height: 23px !important;
  -moz-padding-start: 4px !important;
  -moz-padding-end: 4px !important;
  padding: 0px;
}

.tabs-alltabs-button > .toolbarbutton-text {
  display: none;
}

.tabs-alltabs-button > .toolbarbutton-icon {
  -moz-margin-end: 0;
}

.tabs-alltabs-button > .toolbarbutton-menu-dropmarker {
  -moz-margin-end: 3px !important;
  list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow.png);
  -moz-image-region: rect(0, 13px, 11px, 0);
}

#tabs-toolbar[brighttext] .tabs-alltabs-button > .toolbarbutton-menu-dropmarker {
  list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
}

/**
 * All Tabs Menupopup
 */

.alltabs-item {
  list-style-image: url("chrome://global/skin/icons/folder-item.png");
  -moz-image-region: rect(0px, 16px, 16px, 0px);
}

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

.alltabs-item[busy] {
  list-style-image: url("chrome://messenger/skin/icons/loading.png") !important;
}
