/* 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);
}

@media (-moz-mac-yosemite-theme) {
  #tabs-toolbar {
    margin-bottom: -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://global/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");
}

/* image preloading hack */
.tabmail-tabs::before {
  background-image:
    url(tabs/selected-end.svg),
    url(tabs/selected-start.svg),
    url(tabs/stroke-end.png),
    url(tabs/active-middle.png),
    url(tabs/stroke-start.png),
    url(tabs/background-end.png),
    url(tabs/background-middle.png),
    url(tabs/background-start.png);
}

@media (min-resolution: 1.1dppx) {
  /* image preloading hack */
  .tabmail-tabs::before {
    background-image:
      url(tabs/selected-end.svg),
      url(tabs/selected-start.svg),
      url(tabs/stroke-end@2x.png),
      url(tabs/active-middle@2x.png),
      url(tabs/stroke-start@2x.png),
      url(tabs/background-end@2x.png),
      url(tabs/background-middle@2x.png),
      url(tabs/background-start@2x.png);
  }

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

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

@media (-moz-mac-yosemite-theme) {
  /* image preloading hack */
  .tabmail-tabs::before {
    background-image:
      url(tabs/selected-end.svg),
      url(tabs/selected-start.svg),
      url(tabs/stroke-end.png),
      url(tabs/active-middle.png),
      url(tabs/stroke-start.png),
      url(tabs/background-end.png),
      url(tabs/background-middle.png),
      url(tabs/background-start.png),
      url(tabs/selected-end-yosemite-inactive.svg),
      url(tabs/selected-start-yosemite-inactive.svg),
      url(tabs/stroke-start-yosemite-inactive.png),
      url(tabs/active-middle-yosemite-inactive.png),
      url(tabs/stroke-end-yosemite-inactive.png);
  }

  .tab-background-middle[selected=true]:-moz-window-inactive {
    background-image: url(tabs/active-middle-yosemite-inactive.png),
                      var(--fgTabTexture),
                      none;
  }

  .tab-background-start[selected=true]:-moz-window-inactive:-moz-locale-dir(ltr):not(:-moz-lwtheme)::before,
  .tab-background-end[selected=true]:-moz-window-inactive:-moz-locale-dir(rtl):not(:-moz-lwtheme)::before {
    background-image: url(tabs/selected-start-yosemite-inactive.svg);
  }

  .tab-background-end[selected=true]:-moz-window-inactive:-moz-locale-dir(ltr):not(:-moz-lwtheme)::before,
  .tab-background-start[selected=true]:-moz-window-inactive:-moz-locale-dir(rtl):not(:-moz-lwtheme)::before {
    background-image: url(tabs/selected-end-yosemite-inactive.svg);
  }

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

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

  @media (min-resolution: 1.1dppx) {
    /* image preloading hack */
    .tabmail-tabs::before {
      background-image:
        url(tabs/selected-end.svg),
        url(tabs/selected-start.svg),
        url(tabs/stroke-end@2x.png),
        url(tabs/active-middle@2x.png),
        url(tabs/stroke-start@2x.png),
        url(tabs/background-end@2x.png),
        url(tabs/background-middle@2x.png),
        url(tabs/background-start@2x.png),
        url(tabs/selected-end-yosemite-inactive.svg),
        url(tabs/selected-start-yosemite-inactive.svg),
        url(tabs/stroke-start-yosemite-inactive@2x.png),
        url(tabs/active-middle-yosemite-inactive@2x.png),
        url(tabs/stroke-end-yosemite-inactive@2x.png);
    }

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

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

    .tab-background-end[selected=true]:-moz-window-inactive:-moz-locale-dir(ltr)::after,
    .tab-background-start[selected=true]:-moz-window-inactive:-moz-locale-dir(rtl)::after {
      background-image: url(tabs/stroke-end-yosemite-inactive@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;
  padding-inline-start: 26px;
}

/* Tabstrip close button */

.tabs-closebutton {
  -moz-box-align: stretch;
  margin-top: 1px;
  padding-inline-end: 4px;
  border: none;
}

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

/**
 * In-tab close button
 */

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

.tab-close-button {
  -moz-appearance: none;
  border: none !important;
  background: none;
  cursor: default;
}

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

@media (min-resolution: 1.1dppx) {
  #tabs-toolbar[brighttext] .tabs-closebutton:not([selected=true]):not(:hover),
  #tabs-toolbar[brighttext] .tab-close-button.close-icon:not([selected=true]):not(:hover) {
    -moz-image-region: rect(0, 128px, 32px, 96px);
  }
}

.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 4px;
  width: 16px;
  margin: 0 0 1px;
}

.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: 1.1dppx) {
  .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 {
  margin-inline-end: 2px;
}

.tabs-alltabs-box-animate {
  margin: 1px 0px 0px;
  width: 25px;
  background-color: #669CFF;
  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://global/skin/icons/loading.png") !important;
  -moz-image-region: auto !important;
}

@media (min-resolution: 1.1dppx) {
  .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://global/skin/icons/loading@2x.png") !important;
  }
}

tabpanels.plain {
  background-color: transparent;
}
