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

/**
 * Tabmail Tabs
 */

#tabs-toolbar {
  padding: 0;
}

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

.tabmail-tabs:not(:-moz-lwtheme) {
  -moz-appearance: menubar;
}

.tabmail-tabs[overflow="true"] {
  -moz-padding-start: 0px;
}

.tabmail-tabs > .tabmail-tab:first-child > .tab-stack > .tab-content >
.tab-close-button {
  visibility: collapse;
}

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

/**
 * Tab
 */

.tabmail-tab {
  -moz-appearance: none;
  color: -moz-DialogText;
  margin: 0 0 -1px;
  padding: 0;
  border-radius: 0;
  border-width: 0;
  background: none;
}

.tabmail-tab[selected] {
  position: relative;
  text-shadow: none;
}

.tabmail-tab:-moz-lwtheme {
  color: inherit;
  text-shadow: inherit;
}

.tab-stack {
  height: 31px;
}

.tabmail-tab:hover > .tab-stack > .tab-background:not([selected=true]),
.tab-background[selected=true] {
  background-repeat: no-repeat,
                     no-repeat,
                     no-repeat;
  background-position: left 0,
                       30px 0,
                       right 0;
  background-size: 30px 100%,
                   -moz-calc(100% - 60px) 100%,
                   30px 100%;
}

.tabmail-tab:hover > .tab-stack > .tab-background:not([selected=true]) {
  background-image: url(icons/tabBackgroundStart.png),
                    url(icons/tabBackgroundMiddle.png),
                    url(icons/tabBackgroundEnd.png);
}

.tab-background[selected=true] {
  background-image: url(icons/tabActiveStart.svg),
                    url(icons/tabActiveMiddle.svg),
                    url(icons/tabActiveEnd.svg);
}

.tab-background[selected=true]:-moz-lwtheme {
  opacity: .52;
}

.tabmail-tab:not([selected]):not(:hover) +
.tabmail-tab:not([selected]):not(:hover)::before {
  content: "";
  display: -moz-box;
  width: 2px;
  height: 28px;
  -moz-margin-start: -2px;
  -moz-margin-end: 0;
  background: -moz-linear-gradient(bottom, hsla(210, 23%, 10%, .4),
              hsla(210, 23%, 10%, .1) 80%, transparent),
              -moz-linear-gradient(bottom, hsla(0, 0%, 100%, .4),
              hsla(0, 0%, 100%, .1) 80%, transparent);
  background-position: 0 0, 1px 0;
  background-size: 1px 100%;
  background-repeat: no-repeat;
}

.tab-content {
  -moz-padding-start: 10px;
  -moz-padding-end: 7px;
}

.tab-background {
  -moz-margin-start: -14px;
  -moz-margin-end: -14px;
}

.tab-background-start,
.tab-background-end {
  width: 30px;
  clip-path: url(chrome://messenger/content/messenger.xul#tab-curve-clip-path);
}

.tab-background-end:-moz-locale-dir(ltr),
.tab-background-start:-moz-locale-dir(rtl) {
  -moz-transform: scaleX(-1);
}

.tab-background-middle {
  -moz-box-flex: 1;
}

.tabmail-tab,
.tab-background,
.tab-content {
  pointer-events: none;
}

.tab-background-start,
.tab-background-middle,
.tab-background-end,
.tab-close-button {
  pointer-events: auto;
}

.tabmail-arrowscrollbox > scrollbox {
  -moz-padding-start: 14px;
  -moz-padding-end: 14px;
}

.tab-icon-image,
.tab-throbber {
  width: 16px;
  height: 16px;
  -moz-margin-end: 7px;
}

.tabmail-tab {
  list-style-image: url("moz-icon://stock/gtk-file?size=menu");
}

.tab-throbber {
  list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
  -moz-image-region: auto !important;
}

.tabmail-tab[type="glodaSearch"] {
  list-style-image: url(moz-icon://stock/gtk-find?size=menu);
}

.tabmail-tab > .tab-stack > .tab-content > .tab-text {
  /* tabmail-tab focus ring */
  border: 1px dotted transparent;
  margin: -1px !important; /* let the border not consume any space, like outline */
}

.tabmail-tab:not(:-moz-lwtheme) > .tab-stack > .tab-content > .tab-text {
  color: -moz-MenuBarText;
  opacity: .5;
}

.tabmail-tab[selected]:not(:-moz-lwtheme) > .tab-stack > .tab-content > .tab-text {
  color: -moz-DialogText;
  opacity: 1;
}

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

/* Tab drag and drop */
.tab-drop-indicator {
  list-style-image: url(chrome://messenger/skin/icons/tabDragIndicator.png);
  margin-bottom: -11px;
}

/* In-tab close button */
.tab-close-button {
  -moz-margin-start: 6px;
  -moz-padding-start: 0 !important;
  -moz-padding-end: 0 !important;
  position: relative;
  z-index: 4;
  border: none;
  list-style-image: url(icons/closeTab.svg);
  -moz-image-region: auto;
}

.tab-close-button > .toolbarbutton-icon {
  margin-top: 1px;
}

.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;
  list-style-image: url(icons/closeTab-active.svg);
}

/**
 * Tab Scrollbox Arrow Buttons
 */

/* Tabstrip close button */
.tabs-closebutton {
  list-style-image: url("moz-icon://stock/gtk-close?size=menu");
  border: none;
  margin-bottom: 1px;
}

.tabmail-arrowscrollbox > .scrollbutton-up {
  -moz-appearance: tab-scroll-arrow-back;
  margin: 0px;
}

.tabmail-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down {
  -moz-appearance: tab-scroll-arrow-forward;
  margin: 0px;
}

.tabs-alltabs-box-animate {
  background-color: Highlight;
  opacity: 0.0;
}

/* All tabs menupopup */
.alltabs-item {
  list-style-image: url("moz-icon://stock/gtk-file?size=menu");
}

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

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

.tabs-alltabs-button {
  margin-bottom: 1px;
}

.tabs-alltabs-button > .toolbarbutton-menu-dropmarker {
  -moz-appearance: none !important;
  margin-bottom: -1px;
  -moz-padding-start: 0 !important;
  list-style-image: url("chrome://messenger/skin/icons/dropmarker.svg");
}

.tabs-alltabs-button:hover > .toolbarbutton-menu-dropmarker {
  list-style-image: url("chrome://messenger/skin/icons/dropmarker-hover.svg");
}

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

.alltabs-item > .menu-iconic-left {
  visibility: visible !important;
}

/* Content Tabs */

.contentTabToolbox {
  -moz-appearance: none;
  height: 0px;
  border: 0;
}

.contentTabInstance[disablechrome] .contentTabToolbox {
  display: none;
}

.contentTabToolbox:not(:-moz-lwtheme) {
  border-bottom: 1px solid rgb(105, 105, 105);
}

.contentTabToolbox:-moz-lwtheme {
  height: 1px;
  background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5) 50%);
  background-color: rgba(255, 255, 255, 0.3);
}

.contentTabToolbar {
  height: 0px;
  min-height: 0px;
  padding: 0;
}
