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

/* ===== mailWindow1.css ================================================
  == Styles for the main Mail window in the default layout scheme.
  ======================================================================= */

@import url("chrome://messenger/skin/");
@import url("chrome://messenger/skin/primaryToolbar.css");
@import url("chrome://messenger/skin/folderMenus.css");
@import url("chrome://messenger/skin/folderPane.css");
@import url("chrome://messenger/skin/tagColors.css");

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* give the toolbox a min-height of 41px for Australis theme */
.mail-toolbox:not([mode="full"]) > toolbar:only-of-type,
.mail-toolbox[mode="full"][labelalign="end"] > toolbar:only-of-type {
  margin-top: 5px;
  margin-bottom: 5px;
}

.mail-toolbox[iconsize="large"]:not([mode="full"]) > toolbar:only-of-type,
.mail-toolbox[iconsize="large"][mode="full"][labelalign="end"] >
toolbar:only-of-type {
  margin-top: 2px;
  margin-bottom: 3px;
}

.mail-toolbox[mode="text"]:not([mode="full"]) > toolbar:only-of-type {
  margin-top: 3px;
  margin-bottom: 3px;
}

#viewPickerLabel:not(:-moz-lwtheme) {
  color: MenuText;
}

#folderTree {
  border-bottom: 1px solid ThreeDShadow;
  background-color: -moz-OddTreeRow;
  background-image: url("chrome://messenger/skin/grain.png");
}

#threadTree {
  border-bottom: 1px solid ThreeDShadow;
}

#mailContent {
  -moz-appearance: toolbox;
  background-color: -moz-Dialog;
}

#tabmail:-moz-lwtheme {
  text-shadow: none;
}

#folderPaneHeader {
  border-bottom: 1px solid ThreeDShadow;
}

#folderUnreadCol,
#folderTotalCol,
#folderSizeCol {
  text-align: right;
}

#folderNameCol [sortDirection="ascending"],
#folderNameCol [sortDirection="descending"] {
  list-style-image: none;
}

/* ::::: thread decoration ::::: */

treechildren::-moz-tree-row(dummy)  {
  background-color:  #F0F0F0;
  margin-bottom: 1px;
  -moz-padding-start: 2px;
}

treechildren::-moz-tree-row(dummy, selected) {
  background-color: -moz-Dialog;
}

treechildren::-moz-tree-row(dummy, selected, focus)  {
  background-color: Highlight;
}

treechildren::-moz-tree-cell-text(dummy) {
  font-weight: bold;
}

treechildren::-moz-tree-cell-text(read) {
  font-weight: normal;
}

treechildren::-moz-tree-cell-text(unread) {
  font-weight: bold;
}

treechildren::-moz-tree-cell-text(imapdeleted) {
  text-decoration: line-through;
}

/* on a collapsed thread, if the top level message is read, but the thread has
 * unread children, underline the text.  4.x mac did this, very slick 
 */
treechildren::-moz-tree-cell-text(container, closed, hasUnread, read) {
  text-decoration: underline;
}

/* ::::: message column icons ::::: */

/* ..... column picker ..... */

.tree-columnpicker-icon  {
  list-style-image: url("chrome://messenger/skin/icons/columnpicker.svg");
}

/* ..... thread column ..... */

.threadColumnHeader {
  list-style-image: url("chrome://messenger/skin/icons/thread-col.svg");
}

treechildren::-moz-tree-image(threadCol, container) {
  list-style-image: url("chrome://messenger/skin/icons/thread.png");
}

treechildren::-moz-tree-image(threadCol, watch) {
  list-style-image: url("chrome://messenger/skin/icons/thread-watched.png");
}

treechildren::-moz-tree-image(threadCol, ignore) {
  list-style-image: url("chrome://messenger/skin/icons/thread-ignored.png");
}

treechildren::-moz-tree-image(threadCol, ignoreSubthread) {
  list-style-image: url("chrome://messenger/skin/icons/message-ignored.png");
}

/* ..... read column ..... */

.readColumnHeader {
  list-style-image: url("chrome://messenger/skin/icons/readcol.svg");
  -moz-padding-end: 3px;
}

treechildren::-moz-tree-image(unreadButtonColHeader) {
  list-style-image: url("chrome://messenger/skin/icons/message-list.png");
  -moz-image-region: rect(0px 16px 16px 0px); /* message-read.png */
}

treechildren::-moz-tree-image(unreadButtonColHeader, dummy) {
  list-style-image: none;
}

treechildren::-moz-tree-image(unreadButtonColHeader, unread) {
  -moz-image-region: rect(16px 16px 32px 0px); /* message-unread.png */
}

/* ..... attachment column ..... */

.attachmentColumnHeader {
  list-style-image: url("chrome://messenger/skin/icons/attachment-col.svg");
  -moz-padding-end: 3px;
}

treechildren::-moz-tree-image(attachmentCol, attach) {
  list-style-image: url("chrome://messenger/skin/icons/message-list.png");
  -moz-image-region: rect(160px 16px 176px 0px); /* message-attachment.png */
  -moz-padding-start: 2px;
}

/* ..... flag column ..... */

.flagColumnHeader {
  list-style-image: url("chrome://messenger/skin/icons/flag-col.svg");
  -moz-padding-end: 3px;
}

treechildren::-moz-tree-image(flaggedCol) {
  list-style-image: url("chrome://messenger/skin/icons/message-list.png");
  -moz-image-region: rect(96px 16px 112px 0px); /* message-unstarred.png */
  -moz-padding-end: 3px;
}

treechildren::-moz-tree-image(flaggedCol, dummy) {
  list-style-image: none;
}

treechildren::-moz-tree-image(flaggedCol, flagged) {
  -moz-image-region: rect(80px 16px 96px 0px); /* message-starred.png */
  -moz-padding-end: 3px;
}

/* ..... junkStatus column ..... */

.junkStatusHeader {
  list-style-image: url("chrome://messenger/skin/icons/junk-col.svg");
  -moz-padding-end: 3px;
}

/* "unknown" now looks like "not junk".  see bug #182386 */
treechildren::-moz-tree-image(junkStatusCol) {
  list-style-image: url("chrome://messenger/skin/icons/message-list.png");
  -moz-image-region: rect(0px 16px 16px 0px); /* message-read.png */
  -moz-padding-start: 0px;
}

treechildren::-moz-tree-image(junkStatusCol, junk) {
  -moz-image-region: rect(32px 16px 48px 0px); /* message-junk.png */
}

treechildren::-moz-tree-image(junkStatusCol, dummy) {
  list-style-image: none;
}

treechildren::-moz-tree-image(junkStatusCol, notjunk) {
  -moz-image-region: rect(0px 16px 16px 0px); /* message-read.png */
  -moz-padding-start: 0px;
}

/* ..... subject column ..... */

#subjectCol {
  -moz-padding-start: 16px;
}

#subjectCol[primary="true"] {
  -moz-padding-start: 26px;
}

treechildren::-moz-tree-image(subjectCol) {
  -moz-margin-end: 2px;
  list-style-image: url("chrome://messenger/skin/icons/message-list.png");
  -moz-image-region: rect(48px 16px 64px 0px); /* message-blank.png */
}

treechildren::-moz-tree-image(subjectCol, dummy) {
  list-style-image: none;
}

treechildren::-moz-tree-image(subjectCol, forwarded) {
  -moz-image-region: rect(128px 16px 144px 0px); /* message-forwarded.png */
}

treechildren::-moz-tree-image(subjectCol, replied) {
  -moz-image-region: rect(112px 16px 128px 0px); /* message-replied.png */
}

treechildren::-moz-tree-image(subjectCol, replied, forwarded) {
  -moz-image-region: rect(144px 16px 160px 0px); /* message-replied-forwarded.png */
}

treechildren::-moz-tree-image(subjectCol, new) {
  -moz-image-region: rect(64px 16px 80px 0px); /* message-new.png */
}


/* IMPORTANT: make sure the imap-deleted column always comes after the replied/forwarded style rules.
   This ensures that we show that the message is marked as deleted over status information. */

treechildren::-moz-tree-image(subjectCol, imapdeleted) {
  list-style-image: url("chrome://messenger/skin/icons/message.png");
  -moz-image-region: rect(0 80px 16px 64px);
}

treechildren::-moz-tree-cell-text(subjectCol) {
  -moz-padding-start: 0;
}

#sizeCol,
#unreadCol,
#totalCol {
  text-align: right;
}

/* We need to hide overflow in messagepanebox, so that resizing doesn't spill
   header content over the statusbar.
   */

#messagepanebox {
  overflow: hidden;
}

/* ..... folder pane adjustments ..... */

#folderpane-title {
  -moz-padding-start: 12px;
  -moz-padding-end: 8px;
}

.folderview-cycler {
  -moz-padding-end: 0px !important;
}

.folderview-cycler[dir="prev"],
.folderview-cycler[dir="next"]:-moz-locale-dir(rtl) {
  list-style-image: url("chrome://messenger/skin/icons/arrow/foldercycler-arrow-left.png");
}

.folderview-cycler[dir="next"],
.folderview-cycler[dir="prev"]:-moz-locale-dir(rtl) {
  list-style-image: url("chrome://messenger/skin/icons/arrow/foldercycler-arrow-right.png");
}

/* ..... splitter adjustments ..... */

#folderpane_splitter,
#threadpane-splitter:not([orient="vertical"]) {
  -moz-appearance: none;
  border-left: 1px solid ThreeDShadow;
  /* splitter grip area */
  width: 5px;
  margin-top: 0;
  /* make only the splitter border visible */
  -moz-margin-end: -5px;
  /* because of the negative margin needed to make the splitter visible */
  position: relative;
  z-index: 10;
  transition: border-width .3s ease-in;
}

#threadpane-splitter:not([orient="vertical"]) {
  -moz-margin-start: -5px;
  -moz-margin-end: 0;
}

/* Until Bug 621351 is fixed we need border-right and border-left in
 * combination with -moz-locale-dir instead of -moz-border-end and
 * -moz-border-start for transition
 */

#folderpane_splitter:-moz-locale-dir(rtl),
#threadpane-splitter:not([orient="vertical"]):-moz-locale-dir(ltr) {
  border-right: 1px solid ThreeDShadow;
  border-left: none;
}

#folderpane_splitter[state="collapsed"]:hover:-moz-locale-dir(ltr),
#threadpane-splitter[state="collapsed"]:not([orient="vertical"]):hover:-moz-locale-dir(rtl) {
  border-left: 4px solid highlight;
}

#folderpane_splitter[state="collapsed"]:hover:-moz-locale-dir(rtl),
#threadpane-splitter[state="collapsed"]:not([orient="vertical"]):hover:-moz-locale-dir(ltr) {
  border-right: 4px solid highlight;
}

#threadpane-splitter,
#attachment-splitter {
  -moz-appearance: none;
  border-bottom: 1px solid ThreeDShadow;
  /* splitter grip area */
  height: 5px;
  /* make only the splitter border visible */
  margin-top: -5px;
  /* because of the negative margin needed to make the splitter visible */
  position: relative;
  z-index: 10;
  transition: border-width .3s ease-in;
}

#attachment-splitter:not([state="collapsed"]) {
  border-bottom: 1px solid transparent;
}

#attachment-splitter,
#threadpane-splitter[state="collapsed"] {
  transition: border-color .3s;
}

#threadpane-splitter[state="collapsed"]:hover,
#attachment-splitter[state="collapsed"]:hover {
  border-bottom: 4px solid highlight;
}

#messagesBox {
  /* For some reason, the thread/message panes overlap the folder pane splitter
     by 1px because of the CSS above. Fix this. */
  -moz-margin-start: 1px;
}

/* ..... tree adjustments ..... */

#accountCentralBox { 
  border-bottom: 1px solid ThreeDShadow;
}

/* ..... message pane adjustments ..... */

#messagepanebox {
  border-bottom: 1px solid ThreeDShadow;
}

/* ..... status bar adjustments ..... */

#quotaMeter {
  -moz-appearance: none;
  min-width: 4em;
  max-width: 4em;
  border: 1px solid ThreeDShadow;
}
#quotaPanel .progress-bar {
  -moz-appearance: none;
  background-color: #88AAFF;
  opacity: .5;
}
#quotaPanel[alert="warning"] .progress-bar {
  background-color: orange;
}
#quotaPanel[alert="critical"] .progress-bar {
  background-color: red;
  opacity: .6;
}
#quotaLabel {
  text-align: center;
}

#threadTree > treechildren::-moz-tree-row(odd) {
  background-color: transparent;
}

#threadTree > treechildren::-moz-tree-row(selected) {
  color: -moz-cellhighlighttext;
  background-color: -moz-cellhighlight;
}

#threadTree > treechildren::-moz-tree-row(selected, focus) {
  color: HighlightText;
  background-color: Highlight;
}

.tabmail-tab[type="message"] {
  list-style-image: url("chrome://messenger/skin/icons/server.png");
  -moz-image-region: rect(0 16px 16px 0);
}

/* ..... tabs ..... */

#tabpanelcontainer {
  -moz-appearance: none;
}
