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

 /* add back tree lines*/
treechildren::-moz-tree-line {
  visibility: visible;
}

/* ::::: Folder Pane ::::: */

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

.tabmail-tab[type="folder"][selected="true"] {
  -moz-image-region: rect(0 32px 16px 16px);
}

treechildren::-moz-tree-image(folderNameCol) {
  -moz-margin-end: 2px;
  list-style-image: url("chrome://messenger/skin/icons/folder.png");
  -moz-image-region: rect(0 16px 16px 0);
}

treechildren::-moz-tree-image(folderNameCol, newMessages-true) {
  -moz-image-region: rect(16px 16px 32px 0);
}

treechildren::-moz-tree-image(folderNameCol, selected, open) {
  -moz-image-region: rect(0 32px 16px 16px);
}

/* ..... Newsgroup ..... */

.tabmail-tab[type="folder"][ServerType="nntp"],
treechildren::-moz-tree-image(folderNameCol, serverType-nntp) {
  -moz-image-region: rect(0 160px 16px 144px);
}

/* ..... Feed ..... */

.tabmail-tab[type="folder"][IsFeedFolder="true"],
treechildren::-moz-tree-image(folderNameCol, isFeedFolder-true) {
  list-style-image: url("chrome://messenger-newsblog/skin/icons/rss-feed.png");
  -moz-image-region: rect(0 16px 16px 0);
  width: 16px;
  height: 16px;
}

treechildren::-moz-tree-image(folderNameCol, isFeedFolder-true, newMessages-true) {
  -moz-image-region: rect(16px 16px 32px 0);
}

/* Resets list-style-image for Feed Trash and Virtual folders */

.tabmail-tab[type="folder"][SpecialFolder="Trash"][ServerType="rss"],
.tabmail-tab[type="folder"][SpecialFolder="Virtual"][ServerType="rss"],
treechildren::-moz-tree-image(folderNameCol, serverType-rss, specialFolder-Trash),
treechildren::-moz-tree-image(folderNameCol, serverType-rss, specialFolder-Virtual) {
  list-style-image: url("chrome://messenger/skin/icons/folder.png");
}

/* ..... Inbox ..... */

.tabmail-tab[type="folder"][SpecialFolder="Inbox"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Inbox) {
  -moz-image-region: rect(0 48px 16px 32px);
}

treechildren::-moz-tree-image(folderNameCol, specialFolder-Inbox, newMessages-true) {
  -moz-image-region: rect(16px 48px 32px 32px);
}

/* ..... Sent ..... */

.tabmail-tab[type="folder"][SpecialFolder="Sent"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Sent) {
  -moz-image-region: rect(0 64px 16px 48px);
}

/* ..... Unsent ..... */

.tabmail-tab[type="folder"][SpecialFolder="Outbox"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Outbox) {
  -moz-image-region: rect(0 80px 16px 64px);
}

/* ..... Drafts ..... */

.tabmail-tab[type="folder"][SpecialFolder="Drafts"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Drafts) {
  -moz-image-region: rect(0 96px 16px 80px);
}

/* ..... Templates ..... */

.tabmail-tab[type="folder"][SpecialFolder="Templates"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Templates) {
  -moz-image-region: rect(0 112px 16px 96px);
}

/* ..... Junk ..... */

.tabmail-tab[type="folder"][SpecialFolder="Junk"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Junk) {
  -moz-image-region: rect(0 128px 16px 112px);
}

/* ..... Trash ..... */

.tabmail-tab[type="folder"][SpecialFolder="Trash"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Trash) {
  -moz-image-region: rect(0 144px 16px 128px);
}

/* ..... Archives ..... */

.tabmail-tab[type="folder"][SpecialFolder="Archive"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Archive) {
  -moz-image-region: rect(0 208px 16px 192px);
}

/* ..... Shared folders .....

treechildren::-moz-tree-image(folderNameCol, imapShared-true) {
  -moz-image-region: rect(0 192px 16px 176px);
}

*/ 

/* ..... Saved Search Folder ..... */

.tabmail-tab[type="folder"][SpecialFolder="Virtual"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Virtual) {
  -moz-image-region: rect(0 176px 16px 160px);
}

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

/* ..... Secure IMAP/POP account nodes ..... */
.tabmail-tab[type="folder"][IsServer="true"][ServerType="imap"][IsSecure="true"],
.tabmail-tab[type="folder"][IsServer="true"][ServerType="pop3"][IsSecure="true"] {
  -moz-image-region: rect(0 32px 16px 16px);
}

/* ..... Local folders ..... */
.tabmail-tab[type="folder"][IsServer="true"][ServerType="none"] {
  -moz-image-region: rect(0 48px 16px 32px);
}

/* ..... News server ..... */
.tabmail-tab[type="folder"][IsServer="true"][ServerType="nntp"] {
  -moz-image-region: rect(0 64px 16px 48px);
}

/* ..... Secure news server ..... */
.tabmail-tab[type="folder"][IsServer="true"][ServerType="nntp"][IsSecure="true"] {
  -moz-image-region: rect(0 80px 16px 64px);
}

/* .....  Newsgroup .....  */
.tabmail-tab[type="folder"][ServerType="nntp"] {
  -moz-image-region: rect(0 160px 16px 144px);
}

treechildren::-moz-tree-cell-text(folderNameCol, newMessages-true),
treechildren::-moz-tree-cell-text(folderNameCol, specialFolder-Inbox, newMessages-true) {
  font-weight: bold;
}

/* ..... Mail server  ..... */

treechildren::-moz-tree-image(folderNameCol, isServer-true) {
  list-style-image: url("chrome://messenger/skin/icons/server.png");
  -moz-image-region: rect(0 16px 16px 0);
}

treechildren::-moz-tree-image(folderNameCol, biffState-NewMail, isServer-true) {
  -moz-image-region: rect(16px 16px 32px 0);
}

/* ..... Secure mail server ..... */

treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-pop3, isSecure-true),
treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-imap, isSecure-true) {
  -moz-image-region: rect(0 32px 16px 16px);
}

treechildren::-moz-tree-image(folderNameCol, biffState-NewMail, isServer-true, isSecure-true) {
  -moz-image-region: rect(16px 32px 32px 16px);
}

/* ..... Local folders ..... */

treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-none) {
  -moz-image-region: rect(0 48px 16px 32px);
}

treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-none, biffState-NewMail) {
  -moz-image-region: rect(16px 48px 32px 32px);
}

/* ..... News server ..... */

treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-nntp) {
  -moz-image-region: rect(0 64px 16px 48px) !important;
}

treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-nntp, isSecure-true) {
  -moz-image-region: rect(0 80px 16px 64px) !important;
}

/* ..... Feed server ..... */

.tabmail-tab[type="folder"][IsServer="true"][ServerType="rss"],
treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-rss) {
  list-style-image: url("chrome://messenger-newsblog/skin/icons/server-rss.png");
  -moz-image-region: rect(0 16px 16px 0);
}

/* ::::: All Servers ::::: */

treechildren::-moz-tree-cell-text(folderNameCol, biffState-NewMail, isServer-true),
treechildren::-moz-tree-cell-text(folderNameCol, newMessages-true),
treechildren::-moz-tree-cell-text(folderNameCol, specialFolder-Inbox, newMessages-true) {
  color: -moz-hyperlinktext;
}

treechildren::-moz-tree-cell-text(folderNameCol, biffState-NewMail, isServer-true, selected),
treechildren::-moz-tree-cell-text(folderNameCol, newMessages-true, selected),
treechildren::-moz-tree-cell-text(folderNameCol, specialFolder-Inbox, newMessages-true, selected) {
  color: -moz-CellHighlightText;
}

treechildren::-moz-tree-cell-text(folderNameCol, biffState-NewMail, isServer-true, selected, focus),
treechildren::-moz-tree-cell-text(folderNameCol, newMessages-true, selected, focus),
treechildren::-moz-tree-cell-text(folderNameCol, specialFolder-Inbox, newMessages-true, selected, focus) {
  color: HighlightText;
}

treechildren::-moz-tree-cell-text(closed, subfoldersHaveUnreadMessages-true) {
  font-weight: bold;
}

treechildren::-moz-tree-cell-text(folderNameCol, isServer-true),
treechildren::-moz-tree-cell-text(hasUnreadMessages-true) {
  font-weight: bold;
}

treechildren::-moz-tree-cell-text(folderNameCol, noSelect-true) {
  color: gray;
  font-style: italic;
}

.tree-folder-checkbox {
  list-style-image: none;
}

/* ::::: Folder Summary Popup ::::: */

.folderSummary-message-row {
  /* This max width ends up dictating the overall width of the popup
     because it controls how large the preview, subject and sender text can be
     before cropping kicks in */
  max-width: 450px;
}

.folderSummary-subject {
  font-weight: bold; 
}

.folderSummary-previewText {
  color: grey; 
}
