/***************************
 * browser tab styles
 ***************************/

/* See bug 1261 */
hbox.tabbrowser-strip {
  overflow: hidden;
}

.tabbrowser-tabs {
  background: transparent url("chrome://global/skin/tabs/tabbrowser-tabs-bkgnd.png") repeat-x;
  -moz-box-align: end;
}

/* ::::: tabbrowser ::::: */

.tabbrowser-tab:not([selected="true"]):hover {
  background: transparent url("chrome://global/skin/tabs/tabbrowser-tabs-bkgnd.png") repeat-x;
}

.tabbrowser-tab:hover > .tab-image-middle > .tab-icon > .tab-extra-status {
  background: none;
}

.tab-icon-image {
  width: 16px;
  height: 16px;
  list-style-image: url("chrome://global/skin/icons/small-globe-sunken.png");
}

.tab-icon {
  padding-top: 1px;
  margin: 4px 0px 1px 0px;
}

.tabbrowser-tab:not([selected="true"]) .tab-icon {
  margin-top: 3px;
}

.tabbrowser-tab[busy] > .tab-icon-image,
.tabbrowser-tab[busy] > .tab-image-middle > .tab-icon > .tab-icon-image {
%ifndef XP_MACOSX
  list-style-image: url("chrome://global/skin/throbber/Throbber-small.gif") !important; 
%else
  list-style-image: url("chrome://global/skin/icons/loading_16_grey.gif") !important; 
%endif
}

.tabbrowser-tab {
  background-color: transparent;
  -moz-appearance: none;
  -moz-box-pack: center;
  margin: 3px 0px 3px 1px;
  padding: 0px;
  border: none !important;
  min-width: 1px !important;
  text-align: center;
}


.tabbrowser-tab:first-child {
  margin-left: 4px;
}

.tabbrowser-tab[selected="true"] {
  -moz-user-focus: normal;
}

.tabbrowser-tab > .tab-image-middle > .tab-text {
  border: 1.4pt solid transparent;
}

.tab-text {
  font: icon;
  padding-top: 1px;
  margin-top: 4px;
%ifdef XP_WIN
  margin-right: 6px !important;
%endif
}

.tabbrowser-tab .tab-text {
  color: #000000;
}

%ifdef XP_WIN
.tabbrowser-tab[selected="true"] .tab-text {
  font-weight: bold;
}
%endif

.tabbrowser-tab:not([selected="true"]) .tab-text {
  color: #555555;
  margin-top: 3px;
}

.tabbrowser-tab:focus > .tab-image-middle > .tab-text {
  border: 1.4pt solid -moz-mac-focusring;
}

.tabbrowser-tab[selected="true"], .tabbrowser-tab:hover {
  color: #000000;
}

.tab-image-left, .tab-image-right {
  width: 8px;
  margin: 0px;
  padding: 0px;
}

.tabbrowser-tab > .tab-image-right {
  background: url("chrome://global/skin/tabs/tab-right.png") no-repeat;
}

.tabbrowser-tab:not([selected="true"]) > .tab-image-right {
  background: url("chrome://global/skin/tabs/tab-right-bkgnd.png") no-repeat;
  margin-bottom: 1px;
}

.tabbrowser-tab:hover:not([selected="true"]) > .tab-image-right {
  background: url("chrome://global/skin/tabs/tab-right-hover.png") no-repeat;
}

.tabbrowser-tab > .tab-image-left {
  background: url("chrome://global/skin/tabs/tab-left.png") no-repeat;
}

.tabbrowser-tab:not([selected="true"]) > .tab-image-left {
  background: url("chrome://global/skin/tabs/tab-left-bkgnd.png") no-repeat;
  margin-bottom: 1px;
}

.tabbrowser-tab:hover:not([selected="true"]) > .tab-image-left {
  background: url("chrome://global/skin/tabs/tab-left-hover.png") no-repeat;
}

.tabbrowser-tab > .tab-image-middle {
  background: url("chrome://global/skin/tabs/tab-middle.png") repeat-x;
  -moz-box-flex: 0 !important;
}

.tabbrowser-tab:not([selected="true"]) > .tab-image-middle {
  background: url("chrome://global/skin/tabs/tab-middle-bkgnd.png");
  margin-bottom: 1px;
}

.tabbrowser-tab:hover:not([selected="true"]) > .tab-image-middle {
  background: url("chrome://global/skin/tabs/tab-middle-hover.png");
}

.tabbrowser-tab:not([selected="true"]) > .tab-image-middle > .tab-icon > .tab-icon-image  {
  list-style-image: url("chrome://global/skin/icons/small-globe-sunken-grey.png");
}

.tabbrowser-strip {
  -moz-box-orient: vertical !important;
  -moz-appearance: dialog;
}

.tabbrowser-tabs {
  border: none;
  padding: 0;
  margin: 0;
  -moz-box-pack: center;
  -moz-box-align: center;
  background: url("chrome://global/skin/tabs/tabbrowser-tabs-bkgnd.png") repeat-x;
}

.tab-image-right, .tab-image-left, .tab-image-middle {
  min-height: 27px;
  max-height: 27px;
}

.tabbrowser-tab:not([selected="true"]) .tab-image-right,
.tabbrowser-tab:not([selected="true"]) .tab-image-left,
.tabbrowser-tab:not([selected="true"]) .tab-image-middle {
  max-height: 26px;
  min-height: 26px;
}

.tabs-bottom {
  border: none;
  height: 4px !important;
  background: url("chrome://global/skin/tabs/tabs-bottom-bg.png") repeat !important;
  margin: 0px !important;
}

.tabs-left {
  display: -moz-box;
  width: 3px;
}

.tabbrowser-tabs[overflow="true"] .tabs-left {
  display: none;
}

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

/**
 * In-tab close button
 */
 
.tabs-closebutton {
  background-color: transparent;
  -moz-appearance: none;
  border: 0;
  list-style-image: url("chrome://flock/skin/common/closeTab.png");
  -moz-image-region: rect(0px 16px 16px 0px);
}

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

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

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

.tab-close-button {
  list-style-image: url("chrome://global/skin/tab-close-matrix.png");
  -moz-image-region: rect(0px 16px 16px 0px);
  -moz-appearance: none;
  border: none !important;
  padding: 0px;
  background: inherit;
  cursor: default;
  max-height: 27px;
  min-height: 27px;
}

.tabbrowser-tab:not([selected="true"]) .tab-close-button {
  max-height: 26px;
  min-height: 26px;
}

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

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

.tabbrowser-tab > .tab-close-button {
  background-image: url("chrome://global/skin/tabs/tab-middle.png");
  background-repeat: repeat-x;
  -moz-margin-start: -5px;
  -moz-margin-end: -1px;
  -moz-padding-end: 0px;
}

.tabbrowser-tab[selected="true"] > .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;
}

.tabbrowser-tab:not([selected="true"]) > .tab-close-button {
  background-image: url("chrome://global/skin/tabs/tab-middle-bkgnd.png");
  margin-bottom: 1px;
}

.tabbrowser-tab:not([selected="true"]):hover > .tab-close-button {
  background-image: url("chrome://global/skin/tabs/tab-middle-hover.png");
}

/* New tab button */
.tabbar-newtab-button {
  -moz-appearance: none;
  border: 0;
  padding: 2px 0 0 0;
%ifdef XP_UNIX
%ifdef XP_MACOSX
/* Mac */

%else
/* Linux */
  margin: -2px -2px 0 0 !important;
%endif
%else
/* Windows */
  margin: -2px -5px 0 0 !important;
%endif
}

.tabbar-newtab-button {
  list-style-image: url("chrome://global/skin/tabs/new-tab-tabbar.png");
  -moz-image-region: rect(0 18px 25px 0);
}

.tabbar-newtab-button:active,
.tabbar-newtab-button:hover:active {
  -moz-image-region: rect(50px 18px 75px 0);
}

.tabbar-newtab-button:hover {
  -moz-image-region: rect(50px 18px 75px 0);
}

.tabbrowser-arrowscrollbox > .scrollbutton-up,
.tabbrowser-arrowscrollbox .scrollbutton-down,
.tabbrowser-arrowscrollbox .scrollbutton-down-box,
.tabbrowser-tabs .tabs-alltabs-box,
.tabbrowser-tabs .tabs-alltabs-button {
  height: 28px;
  width: 18px;
  padding: 2px 4px 4px 3px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: top left;  
%ifdef XP_UNIX
%ifdef XP_MACOSX
/* Mac */
  margin: 4px 0px 0 0;
%else
/* Linux */
  margin: 4px -1px 0 0;
%endif
%else
/* Windows */
  margin: 4px 0px 0 0;
%endif
}  

/* Left/Up Scroll Button */
.tabbrowser-arrowscrollbox .scrollbutton-up {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-start-bkgnd.png") !important;
  list-style-image: url("chrome://global/skin/tabs/tab-arrow-start.png");
  -moz-image-region: rect(0, 11px, 14px, 0); 
  -moz-appearance: none;
  border: none !important;
%ifdef XP_UNIX
%ifdef XP_MACOSX
/* Mac */
  margin-right: none;
%else
/* Linux */
  margin-right: -2px !important;
%endif
%else
/* Windows */
  margin-right: -5px !important;
%endif
}  

.tabbrowser-arrowscrollbox .scrollbutton-up:not([disabled="true"]):hover {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-start-bkgnd-hover.png") !important;
  -moz-image-region: rect(0, 22px, 14px, 11px);
  -moz-appearance: none;
}

/* Down/Right Scroll Button */
.tabbrowser-arrowscrollbox .scrollbutton-down {
  padding: 2px 2px 4px 4px;
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-end-bkgnd.png") !important;
  list-style-image: url("chrome://global/skin/tabs/tab-arrow-end.png");
  -moz-image-region: rect(0, 11px, 14px, 0);
%ifdef XP_WIN
  margin-right: -5px !important;  
%endif
  -moz-appearance: none;
  border: none !important;
}

.tabbrowser-arrowscrollbox .scrollbutton-down:not([disabled="true"]):hover {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-end-bkgnd-hover.png") !important;
  -moz-image-region: rect(0, 22px, 14px, 11px);
  -moz-appearance: none;
}

.tabbrowser-arrowscrollbox > .scrollbutton-up[disabled="true"],
.tabbrowser-arrowscrollbox .scrollbutton-down[disabled="true"] {
  -moz-image-region: rect(0, 33px, 14px, 22px);
  -moz-appearance: none;
}

.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled="true"]):hover:active,
.tabbrowser-arrowscrollbox .scrollbutton-down:not([disabled="true"]):hover:active {
  -moz-image-region: rect(0, 44px, 14px, 33px);
  -moz-appearance: none;
}

/**
 * All Tabs Button
 * (from Firefox 2)
 */

.tabs-alltabs-box {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-end-bkgnd.png");
  background-repeat: no-repeat;
  -moz-border-radius-topleft: 0px;
  -moz-appearance: none;
}

stack[chromedir="rtl"] > hbox > .tabs-alltabs-box {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-start-bkgnd.png");
  -moz-border-radius-topleft: 0px;
  -moz-border-radius-topright: 0px;
  -moz-appearance: none;
}

.tabbrowser-tabs[overflow="true"] .tabs-alltabs-box {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-end-bkgnd.png");
  -moz-border-radius-topleft: 0px;
  -moz-border-radius-topright: 0px;
  -moz-appearance: none;
}

.tabbrowser-tabs[overflow="true"] stack[chromedir="rtl"] > hbox > .tabs-alltabs-box {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-start-bkgnd.png");
  -moz-appearance: none;
}

.tabs-alltabs-button {
  margin: 6px 1px 0 0;
  border: 0;
  -moz-appearance: none;
}

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

.tabs-alltabs-button > .toolbarbutton-icon {
  -moz-appearance: none;
%ifdef XP_UNIX
%ifdef XP_MACOSX
/* Mac */
  -moz-margin-end: 2px;
%else
/* Linux */
  -moz-margin-end: -2px;
%endif
%else
/* Windows */
  -moz-margin-end: 2px;
%endif
}

.tabs-alltabs-button > .toolbarbutton-menu-dropmarker {
  width: 5px;
  height: 4px; 
}

.tabs-alltabs-button:hover {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-end-bkgnd-hover.png");
  background-repeat: no-repeat;
  -moz-appearance: none; 
  border: none !important;
}

stack[chromedir="rtl"] > hbox > .tabs-alltabs-button:hover {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-start-bkgnd-hover.png");
  -moz-appearance: none;
}

.tabbrowser-tabs[overflow="true"] .tabs-alltabs-button:hover {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-end-bkgnd-hover.png");
  -moz-appearance: none; 
}

.tabbrowser-tabs[overflow="true"] stack[chromedir="rtl"] > hbox > .tabs-alltabs-button:hover {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-start-bkgnd-hover.png");
  -moz-appearance: none;
}

.tabs-alltabs-box-animate {
  margin-top: 2px;
  margin-bottom: 4px;
  width: 18px !important;
  height: 23px !important;
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-end-bkgnd-animate.png");
  background-repeat: no-repeat;
  opacity: 0.0;
  -moz-appearance: none;
}

stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
  background-image: url("chrome://global/skin/tabs/alltabs-box-overflow-start-bkgnd-animate.png");
}

/**
* Tab Drag and Drop
*/

.tab-drop-indicator-bar {
  height: 10px;
  margin-top: -10px;
  position: relative;
  -moz-margin-start: -2px;
}

.tab-drop-indicator-bar[dragging="true"] {
  display: -moz-box;
}

.tab-drop-indicator {
  height: 10px;
  width: 8px;
  margin-bottom: -10px;
  position: relative;
  background: url("chrome://global/skin/tabs/tabDragIndicator.png") 50% 50% no-repeat;
}

/**
 * All Tabs Menupopup 
 */

.alltabs-item > .menu-iconic-left > .menu-iconic-icon {
  width: 16px;
  height: 16px;
  list-style-image: url("chrome://global/skin/tabs/folder-item.png");
  -moz-image-region: rect(0px, 16px, 16px, 0px);
}

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

.alltabs-item[busy] > .menu-iconic-left > .menu-iconic-icon {
  list-style-image: url("chrome://global/skin/throbber/Throbber-small.gif");
  opacity: 0.6;
}
