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

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

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

/* Disable Shared Folder Rule for now
treechildren::-moz-tree-image(folderNameCol, imapShared-true) {
  list-style-image: url("chrome://messenger/skin/icons/folder-share.png");
}
*/

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

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

/* ..... Feed Folders ..... */
.tabmail-tab[type="folder"][ServerType="rss"],
treechildren::-moz-tree-image(folderNameCol, isFeedFolder-true) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 224px 16px 208px);
}

/* ..... Inbox ..... */
.tabmail-tab[type="folder"][SpecialFolder="Inbox"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Inbox),
treechildren::-moz-tree-image(folderNameCol, specialFolder-Inbox, newMessages-true) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 48px 16px 32px);
}

/* ..... Sent ..... */
.tabmail-tab[type="folder"][SpecialFolder="Sent"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Sent) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 64px 16px 48px);
}

/* ..... Unsent ..... */
.tabmail-tab[type="folder"][SpecialFolder="Outbox"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Outbox) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 80px 16px 64px);
}

/* ..... Drafts ..... */
.tabmail-tab[type="folder"][SpecialFolder="Drafts"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Drafts) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 96px 16px 80px);
}

/* ..... Templates ..... */
.tabmail-tab[type="folder"][SpecialFolder="Templates"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Templates) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 112px 16px 96px);
}

/* ..... Junk ..... */
.tabmail-tab[type="folder"][SpecialFolder="Junk"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Junk) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 128px 16px 112px);
}

/* ..... Trash ..... */
.tabmail-tab[type="folder"][SpecialFolder="Trash"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Trash) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 144px 16px 128px);
}

/* ..... Saved Search Folder ..... */
.tabmail-tab[type="folder"][SpecialFolder="Virtual"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Virtual) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
  -moz-image-region: rect(0 176px 16px 160px);
}

/* ..... Archive Folder ..... */
.tabmail-tab[type="folder"][SpecialFolder="Archive"],
treechildren::-moz-tree-image(folderNameCol, specialFolder-Archive) {
  list-style-image: url("chrome://messenger/skin/icons/folder-pane.png") !important;
  -moz-image-region: rect(0 208px 16px 192px) !important;
}

@media (min-resolution: 2dppx) {
  treechildren::-moz-tree-image(folderNameCol) {
    width: 16px;
    height: 16px;
}

  .tabmail-tab[type="folder"],
  treechildren::-moz-tree-image(folderNameCol) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 32px 32px 0);
  }

  treechildren::-moz-tree-image(folderNameCol, newMessages-true) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 32px 32px 0);
  }

  /* ..... News Folders ..... */
  .tabmail-tab[type="folder"][ServerType="nntp"],
  treechildren::-moz-tree-image(folderNameCol, serverType-nntp) {
    -moz-image-region: rect(0 320px 32px 288px);
  }

  /* ..... Feed Folders ..... */
  .tabmail-tab[type="folder"][ServerType="rss"],
  treechildren::-moz-tree-image(folderNameCol, isFeedFolder-true) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 448px 32px 416px);
  }

  /* ..... Inbox ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Inbox"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Inbox),
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Inbox, newMessages-true) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 96px 32px 64px);
  }

  /* ..... Sent ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Sent"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Sent) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 128px 32px 96px);
  }

  /* ..... Unsent ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Outbox"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Outbox) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 160px 32px 128px);
  }

  /* ..... Drafts ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Drafts"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Drafts) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 192px 32px 160px);
  }

  /* ..... Templates ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Templates"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Templates) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 224px 32px 192px);
  }

  /* ..... Junk ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Junk"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Junk) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 256px 32px 224px);
  }

  /* ..... Trash ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Trash"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Trash) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 288px 32px 256px);
  }

  /* ..... Saved Search Folder ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Virtual"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Virtual) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png");
    -moz-image-region: rect(0 352px 32px 320px);
  }

  /* ..... Archive Folder ..... */
  .tabmail-tab[type="folder"][SpecialFolder="Archive"],
  treechildren::-moz-tree-image(folderNameCol, specialFolder-Archive) {
    list-style-image: url("chrome://messenger/skin/icons/folder-pane@2x.png") !important;
    -moz-image-region: rect(0 416px 32px 384px) !important;
  }
}

/* ..... Server Folders ..... */

/* ..... Account nodes ..... */
.tabmail-tab[type="folder"][IsServer="true"],
treechildren::-moz-tree-image(folderNameCol, isServer-true),
treechildren::-moz-tree-image(folderNameCol, biffState-NewMail, 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"],
treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-pop3, isSecure-true),
treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-imap, isSecure-true) {
  list-style-image: url("chrome://messenger/skin/icons/server.png");
  -moz-image-region: rect(0 32px 16px 16px);
}

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

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

/* ..... Secure news server ..... */
.folderMenuItem[IsServer="true"][ServerType="nntp"][IsSecure="true"],
treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-nntp, isSecure-true) {
  list-style-image: url("chrome://messenger/skin/icons/server.png");
  -moz-image-region: rect(0 80px 16px 64px);
}

/* ..... Feed Folders ..... */
treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-rss) {
  list-style-image: url("chrome://messenger/skin/icons/server.png");
  -moz-image-region: rect(0 96px 316px 80px);
}

@media (min-resolution: 2dppx) {
  /* ..... Account nodes ..... */
  .tabmail-tab[type="folder"][IsServer="true"],
  treechildren::-moz-tree-image(folderNameCol, isServer-true),
  treechildren::-moz-tree-image(folderNameCol, biffState-NewMail, isServer-true) {
    list-style-image: url("chrome://messenger/skin/icons/server@2x.png");
    -moz-image-region: rect(0 32px 32px 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"],
  treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-pop3, isSecure-true),
  treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-imap, isSecure-true) {
    list-style-image: url("chrome://messenger/skin/icons/server@2x.png");
    -moz-image-region: rect(0 64px 32px 32px);
  }

  /* ..... Local folders ..... */
  .tabmail-tab[type="folder"][IsServer="true"][ServerType="none"],
  treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-none) {
    list-style-image: url("chrome://messenger/skin/icons/server@2x.png");
    -moz-image-region: rect(0 96px 32px 64px);
  }

  /* ..... News Folders ..... */
  .tabmail-tab[type="folder"][IsServer="true"][ServerType="nntp"],
  treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-nntp) {
    list-style-image: url("chrome://messenger/skin/icons/server@2x.png");
    -moz-image-region: rect(0 128px 32px 96px);
  }

  /* ..... Secure news server ..... */
  .folderMenuItem[IsServer="true"][ServerType="nntp"][IsSecure="true"],
  treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-nntp, isSecure-true) {
    list-style-image: url("chrome://messenger/skin/icons/server@2x.png");
    -moz-image-region: rect(0 160px 32px 128px);
  }

  /* ..... Feed Folders ..... */
  treechildren::-moz-tree-image(folderNameCol, isServer-true, serverType-rss) {
    list-style-image: url("chrome://messenger/skin/icons/server@2x.png");
    -moz-image-region: rect(0 192px 32px 160px);
  }
}

/* ::::: 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) {
  font-weight: bold;
  color: blue;
}

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

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: gray; 
}
