/*
# 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");
@import url("chrome://messenger/skin/shared/mailWindow1.css");

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

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

.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: 2px;
}
%endif

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

/* Don't use the listbox appearance as that gives us a blue-grey top border
   that collides with the primary toolbar border */
#threadTree, #folderTree {
  -moz-appearance:  none;
  background-color: -moz-Field;
  color: -moz-FieldText;
}

#messengerBox {
  background-color: -moz-Dialog;
}

/* ::::: 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(imapdeleted) {
  text-decoration: line-through;
}

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

.treecol-image image {
  -moz-padding-end: 4px;
  padding-bottom: 3px;
}

:-moz-system-metric(windows-classic) .treecol-image image {
  -moz-padding-end: 1px;
  padding-bottom: 2px;
}

/* ..... 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");
}

treechildren::-moz-tree-image(unreadButtonColHeader) {
  list-style-image: url("chrome://messenger/skin/icons/readmail.png");
}

treechildren::-moz-tree-image(unreadButtonColHeader, unread) {
  list-style-image: url("chrome://messenger/skin/icons/unreadmail.png");
}

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

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

treechildren::-moz-tree-image(attachmentCol, attach) {
  list-style-image: url("chrome://messenger/skin/icons/attachment-col.png");
  -moz-margin-start: 3px;
}

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

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

treechildren::-moz-tree-image(flaggedCol) {
  list-style-image: url("chrome://messenger/skin/icons/flag-empty.png");
  -moz-padding-end: 2px;
}

treechildren::-moz-tree-image(flaggedCol, flagged) {
  list-style-image: url("chrome://messenger/skin/icons/flag.png");
}

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

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

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

treechildren::-moz-tree-image(junkStatusCol, junk) {
  list-style-image: url("chrome://messenger/skin/icons/folder.png");
  -moz-image-region: rect(0 128px 16px 112px);
}

treechildren::-moz-tree-image(junkStatusCol, notjunk) {
  list-style-image: url("chrome://messenger/skin/icons/readmail.png");
  -moz-padding-start: 0px;
}

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

%ifndef WINDOWS_AERO
#subjectCol {
  -moz-padding-start: 17px;
}

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

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

treechildren::-moz-tree-image(subjectCol, forwarded) {
  -moz-image-region: rect(0 48px 16px 32px);
}

treechildren::-moz-tree-image(subjectCol, replied) {
  -moz-image-region: rect(0 32px 16px 16px);
}

treechildren::-moz-tree-image(subjectCol, replied, forwarded) {
  -moz-image-region: rect(0 64px 16px 48px);
}

treechildren::-moz-tree-image(subjectCol, new) {
  -moz-image-region: rect(0 96px 16px 80px);
}


/* 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) {
  -moz-image-region: rect(0 80px 16px 64px);
}

#threadTree treecolpicker.treecol-image {
  padding-bottom: 2px;
}

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

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

%ifndef WINDOWS_AERO
.folderview-cycler {
  -moz-padding-end: 0px;
}
%endif

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

#mailContent[layout="standard"] #threadpane-splitter {
  /* Overlap the folder pane splitter to make the splitters appear unified. */
  -moz-margin-start: -1px;
}

#mailContent[layout="standard"] #folderpane_splitter:-moz-locale-dir(rtl) {
  /* Don't draw the splitter's border here... */
  border-left: 0;
}

#mailContent[layout="standard"] #threadPaneBox:-moz-locale-dir(rtl),
#mailContent[layout="standard"] #messagepanebox:-moz-locale-dir(rtl){
  /* ... draw it here instead! (This removes the white highlight just to the
     right of the thread pane splitter so everything looks pretty.) */
  margin-right: -2px;
  border-right: 2px solid;
  -moz-border-right-colors: ThreeDHighlight ThreeDShadow;
}

#mailContent[layout="standard"] #threadPaneBox:-moz-locale-dir(rtl) {
  /* Make sure we have a white dot in the top-left corner where the splitters
     meet. */
  margin-bottom: -2px;
  padding-bottom: 2px;
}

#mailContent[layout="wide"] #folderpane_splitter {
  /* Make this draw above the thread pane splitter so that we overlap its top
     border. This will make the splitters appear unified. */
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
}

#mailContent[layout="wide"] #threadpane-splitter {
  /* Don't draw the splitter's border here... */
  border-top: 0;
}

%ifndef WINDOWS_AERO
#mailContent[layout="wide"] #threadPaneBox,
#mailContent[layout="wide"] #folderPaneBox {
  /* ... draw it here instead! (This removes the white highlight just below the
     folder pane splitter so everything looks pretty.) */
  position: relative;
  z-index: 1;
  margin-bottom: -2px;
  border-bottom: 2px solid;
  -moz-border-bottom-colors: ThreeDHighlight ThreeDShadow;
}
%endif

#mailContent[layout="wide"] #folderPaneBox:-moz-locale-dir(ltr),
#mailContent[layout="wide"] #threadPaneBox:-moz-locale-dir(rtl) {
  /* Make sure we have a white dot in the top-left corner where the splitters
     meet. */
  margin-right: -2px;
  padding-right: 2px;
}

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

%ifndef WINDOWS_AERO
#threadTree treechildren::-moz-tree-row(odd) {
  background-image: url("chrome://messenger/skin/icons/row.png");
  background-position: bottom;
  background-repeat: repeat-x;
}
%endif

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

.tabmail-tab[type="message"][IsFeedMessage] {
  list-style-image: url("chrome://messenger-newsblog/skin/icons/rss-feed.png");
  -moz-image-region: rect(32px 16px 48px 0);
  width: 16px;
  height: 16px;
}

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

#tabpanelcontainer {
  -moz-appearance: none;
}

/* ..... Draw in titlebar ..... */

#messengerWindow[sizemode="normal"] > #titlebar {
  -moz-appearance: -moz-window-titlebar;
}

#messengerWindow[sizemode="maximized"] > #titlebar {
  -moz-appearance: -moz-window-titlebar-maximized;
}

@media (-moz-windows-classic) {
  #messengerWindow[tabsintitlebar] > #navigation-toolbox >
  #mail-toolbar-menubar2 {
    border-bottom: none;
  }

  #messengerWindow[tabsintitlebar][sizemode="normal"] >
  #navigation-toolbox > #mail-toolbar-menubar2 {
    margin-top: 4px;
  }
}

#titlebar-buttonbox-container {
  -moz-box-align: start;
}

/* The button box must appear on top of the navigator-toolbox in order for
 * click and hover mouse events to work properly for the button in the restored
 * window state. Otherwise, elements in the navigator-toolbox, like the menubar,
 * can swallow those events. It will also place the buttons above the fog on
 * themes with Aero Glass.
 */
#titlebar-buttonbox {
  z-index: 1;
}

#titlebar {
  -moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
}

#messengerWindow:not([tabsintitlebar]) #titlebar {
  visibility: collapse;
}

#titlebar-spacer {
  pointer-events: none;
}

#tabs-toolbar {
  -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
}

#titlebar-buttonbox {
  -moz-appearance: -moz-window-button-box;
  position: relative;
}

#messengerWindow[sizemode="maximized"] #titlebar-buttonbox {
  -moz-appearance: -moz-window-button-box-maximized;
}

#titlebar-min {
  -moz-appearance: -moz-window-button-minimize;
}

@media not all and (-moz-windows-classic) {
  #titlebar-min {
    -moz-margin-end: 2px;
  }
}

#titlebar-max {
  -moz-appearance: -moz-window-button-maximize;
}

#messengerWindow[sizemode="maximized"] #titlebar-max {
  -moz-appearance: -moz-window-button-restore;
}

#titlebar-close {
  -moz-appearance: -moz-window-button-close;
}

#messengerWindow[tabsintitlebar] .titlebar-placeholder[type="caption-buttons"] {
  margin-left: 10px; /* additional space for Aero Snap */
}

#messengerWindow:not([tabsintitlebar]) .titlebar-placeholder {
  visibility: collapse;
}

%ifndef WINDOWS_AERO
/* Render a window top border for lwthemes on WinXP modern themes: */
@media (-moz-windows-theme: luna-blue) {
  #messengerWindow[tabsintitlebar][sizemode="normal"]
  #titlebar-content:-moz-lwtheme {
    background-image: linear-gradient(to bottom, rgb(8, 49, 216) 0,
                                      rgb(8, 49, 216) 1px, rgb(15, 77, 227) 1px,
                                      rgb(15, 77, 227) 2px, rgb(22, 106, 238) 2px,
                                      rgb(22, 106, 238) 3px, rgb(8, 85, 221) 3px,
                                      rgb(8, 85, 221) 4px, transparent 4px);
  }

  #messengerWindow[tabsintitlebar][sizemode="normal"]
  #titlebar-content:-moz-lwtheme:-moz-window-inactive {
    background-image: linear-gradient(to bottom, rgb(91, 104, 205) 0,
                                      rgb(91, 104, 205) 1px, rgb(116, 128, 220) 1px,
                                      rgb(116, 128, 220) 2px, rgb(117, 140, 221) 2px,
                                      rgb(117, 140, 221) 4px, transparent 4px);
  }
}

@media (-moz-windows-theme: luna-silver) {
  #messengerWindow[tabsintitlebar][sizemode="normal"]
  #titlebar-content:-moz-lwtheme {
    background-image: linear-gradient(to bottom, rgb(102,102,126) 0,
                                      rgb(102, 102, 126) 1px, rgb(168, 167, 191) 1px,
                                      rgb(168, 167, 191) 2px, white 2px, white 3px,
                                      rgb(188, 188, 207) 3px, rgb(188, 188, 207) 4px,
                                      transparent 4px);
  }

  #messengerWindow[tabsintitlebar][sizemode="normal"]
  #titlebar-content:-moz-lwtheme:-moz-window-inactive {
    background-image: linear-gradient(to bottom, rgb(186, 186, 197) 0,
                                      rgb(186, 186, 197) 1px, rgb(236, 238, 245) 1px,
                                      rgb(236, 238, 245) 2px, white 2px, white 3px,
                                      rgb(215, 215, 227) 3px, rgb(215, 215, 227) 4px,
                                      transparent 4px);
  }
}

@media (-moz-windows-theme: luna-olive) {
  #messengerWindow[tabsintitlebar][sizemode="normal"]
  #titlebar-content:-moz-lwtheme {
    background-image: linear-gradient(to bottom, rgb(139, 161, 105) 0,
                                      rgb(139, 161, 105) 1px, rgb(171, 189, 133) 1px,
                                      rgb(171, 189, 133) 2px, rgb(164, 178, 127) 2px,
                                      rgb(164, 178, 127) 3px, transparent 3px);
  }

  #messengerWindow[tabsintitlebar][sizemode="normal"]
  #titlebar-content:-moz-lwtheme:-moz-window-inactive {
    background-image: linear-gradient(to bottom, rgb(207, 214, 188) 0,
                                      rgb(207, 214, 188) 1px, rgb(224, 226, 200) 1px,
                                      rgb(224, 226, 200) 2px, rgb(214, 216, 190) 2px,
                                      rgb(214, 216, 190) 3px, transparent 3px);
  }
}
%endif

#viewPicker > .menulist-label-box > .menulist-icon,
#locationFolders > .menulist-label-box > .menulist-icon {
  min-height: 16px;
}

#viewPickerPopup > menuitem[type="radio"] {
  -moz-appearance: none;
}

#viewPickerPopup > menu > .menu-text {
  -moz-appearance: none;
  -moz-margin-start: 0 !important;
  -moz-padding-start: 0 !important;
}

#viewPickerTagsPopup > menuitem > .menu-iconic-text,
#viewPickerCustomViewsPopup > menuitem > .menu-iconic-text {
  padding: 1px 3px;
}

@media not all and (-moz-windows-compositor) {
  #mail-toolbar-menubar2[autohide="false"] +
  #tabs-toolbar > .titlebar-placeholder {
    display: none;
  }
}
