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

#tabs-toolbar {
  background-image: linear-gradient(to top, hsla(0, 0%, 0%, .3) 1px,
                                    transparent 1px);
}

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

/**
 * Tab
 */

.tab-label {
  margin-top: 1px;
  margin-bottom: 0;
  text-align: center;
}

.tabmail-tab {
  list-style-image: url("chrome://messenger/skin/icons/item.png");
}

.tab-throbber {
  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://messenger/skin/icons/search-tab.png");
}

@media (min-resolution: 2dppx) {
  /* 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);
  }

  /* Background tab separators */
  .tabmail-tab:not([selected]):not(:hover) +
  .tabmail-tab:not([selected]):not(:hover)::before {
    background-image: url(tabs/separator@2x.png);
  }

  .tab-throbber {
    list-style-image: url("chrome://messenger/skin/icons/loading@2x.png") !important;
  }

  .tabmail-tab[type="glodaSearch"] {
    list-style-image: url("chrome://messenger/skin/icons/search-tab@2x.png");
  }
}

.tabmail-tab:not(:hover) > .tab-stack > .tab-content >
  .tab-icon-image:not([selected="true"]) {
  opacity: .9;
}

.tab-label:not([selected="true"]) {
  opacity: .7;
}

.tabmail-tab,
.tabs-newtab-button {
  font: message-box;
  border: none;
}

.tabmail-tab:not(:-moz-lwtheme) {
  color: #333;
  text-shadow: 0 1px rgba(255, 255, 255, 0.4);
}

.tabmail-tab:focus > .tab-stack > .tab-content > .tab-label {
  box-shadow: 0 0 1px -moz-mac-focusring inset,
              0 0 4px 1px -moz-mac-focusring, 0 0 1.5px 1px -moz-mac-focusring;
}

.tabmail-tabs {
  border: none;
  -moz-box-pack: center;
  -moz-box-align: center;
  height: 23px;
  margin-bottom: 0;
}

tabmail > tabbox > tabpanels {
  -moz-appearance: none !important;
}


/**
 * Tab Drag and Drop
 */

.tab-drop-indicator {
  list-style-image: url(tabs/dragIndicator.png);
  margin-bottom: -3px;
  -moz-padding-start: 26px;
}

/**
 * In-tab close button
 */

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

.tab-close-button {
  list-style-image: url("chrome://global/skin/icons/close.png");
  -moz-appearance: none;
  -moz-image-region: rect(0, 16px, 16px, 0);
  border: none !important;
  height: 30px;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 2;
  background: none;
  cursor: default;
}

.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);
}

.tabmail-tab[selected] > .tab-stack > .tab-content > .tab-close-button {
  /* Make this button focusable so clicking on it will not focus the tab while
     it's getting closed */
  -moz-user-focus: normal;
}

.tabmail-arrowscrollbox > .scrollbutton-up,
.tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down {
  border: 0;
  border-right: 2px solid;
  -moz-border-right-colors: rgba(0,0,0,0.25) rgba(255,255,255,0.15);
  list-style-image: url(tabs/arrow.png);
  -moz-image-region: rect(0, 13px, 20px, 0);
  padding: 0;
  width: 16px;
  margin: 0;
}

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

.tabmail-arrowscrollbox > .scrollbutton-up:hover,
.tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:hover {
  -moz-image-region: rect(0, 26px, 20px, 13px);
  background-image: linear-gradient(transparent, rgba(0,0,0,0.15));
}

.tabmail-arrowscrollbox > .scrollbutton-up:hover:active,
.tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:hover:active {
  -moz-image-region: rect(0, 39px, 20px, 26px);
  background-image: linear-gradient(transparent, rgba(0,0,0,0.3));
}

.tabmail-arrowscrollbox > .scrollbutton-up[disabled="true"],
.tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down[disabled="true"] {
  -moz-image-region: rect(0, 13px, 20px, 0) !important;
  opacity: .5;
  background-image: none !important;
}

@media (min-resolution: 2dppx) {
  .tabmail-arrowscrollbox > .scrollbutton-up,
  .tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down {
    list-style-image: url(tabs/arrow@2x.png);
    -moz-image-region: rect(0, 26px, 40px, 0);
  }

  .tabmail-arrowscrollbox > .scrollbutton-up:hover,
  .tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:hover {
    -moz-image-region: rect(0, 52px, 40px, 26px);
  }

  .tabmail-arrowscrollbox > .scrollbutton-up:hover:active,
  .tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:hover:active {
    -moz-image-region: rect(0, 78px, 40px, 52px);
  }

  .tabmail-arrowscrollbox > .scrollbutton-up[disabled="true"],
  .tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down[disabled="true"] {
    -moz-image-region: rect(0, 26px, 40px, 0) !important;
  }

  .tabmail-arrowscrollbox > .scrollbutton-up > .toolbarbutton-icon,
  .tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down > .toolbarbutton-icon {
    width: 13px;
    height: 20px;
  }
}

/**
 * New Tab & All Tabs Buttons
 */

.tabs-alltabs-box {
  margin: 0;
}

.tabs-newtab-button,
.tabs-alltabs-button {
  margin: 0;
  padding: 0 4px;
}

.tabs-newtab-button {
  list-style-image: url(chrome://messenger/skin/tabs/newtab.png);
}

.tabs-alltabs-button {
  padding-top: 2px;
  list-style-image: url(chrome://messenger/skin/tabs/alltabs-box-bkgnd-icon.png);
  -moz-image-region: rect(0, 16px, 16px, 0);
}

.tabs-alltabs-button[open] {
  -moz-image-region: rect(16px, 16px, 32px, 0);
}

.tabs-newtab-button > .toolbarbutton-text,
.tabs-alltabs-button > .toolbarbutton-menu-dropmarker,
.tabs-alltabs-button > .toolbarbutton-text {
  display: none;
}

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

.tabs-alltabs-box-animate {
  margin: 1px 0px 0px;
  width: 25px;
  background-image: url("chrome://messenger/skin/tabs/alltabs-box-overflow-bkgnd-animate.png");
  background-repeat: no-repeat;
  opacity: 0.0;
}

/**
 * All Tabs Menupopup 
 */

.alltabs-item {
  list-style-image: url("chrome://messenger/skin/icons/item.png");
}

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

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

.tabs-closebutton {
  -moz-padding-end: 4px;
  list-style-image: url("chrome://global/skin/icons/close.png") !important;
  border: none;
  -moz-box-align: stretch;
  -moz-image-region: rect(0, 16px, 16px, 0);
}

.tabs-closebutton:hover > .toolbarbutton-icon {
  background-image: none !important;
}

@media (min-resolution: 2dppx) {
  .tabs-alltabs-button {
    list-style-image: url(chrome://messenger/skin/tabs/alltabs-box-bkgnd-icon@2x.png);
    -moz-image-region: rect(0, 32px, 32px, 0);
  }

  .tabs-alltabs-button[open] {
    -moz-image-region: rect(32px, 32px, 64px, 0);
  }

  .tabs-alltabs-button > .toolbarbutton-icon {
    width: 16px;
    height: 16px;
  }

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

  .tab-close-button,
  .tabs-closebutton {
    list-style-image: url("chrome://global/skin/icons/close@2x.png") !important;
    -moz-image-region: rect(0, 32px, 32px, 0);
  }

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

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

  .tab-close-button > .toolbarbutton-icon,
  .tabs-closebutton > .toolbarbutton-icon {
    width: 16px;
  }
}

tabpanels.plain {
  background-color: transparent;
}
