/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Personas.
 *
 * The Initial Developer of the Original Code is Mozilla.
 * Portions created by the Initial Developer are Copyright (C) 2007
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Chris Beard <cbeard@mozilla.org>
 *   Myk Melez <myk@mozilla.org>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

/* Header */

/* IMPORTANT: these rules are very carefully devised to work in conjunction
 * with additional rules below to add the persona image and remove borders
 * between toolbars in the top chrome without changing the overall height
 * of the top chrome, so content doesn't jump up or down when the user switches
 * from the default theme to a persona. So when changing these rules, be very
 * careful that you don't inadvertently change the overall height of the toolbar. */

/* Anchor the image to the top-right corner of the window. */
#messengerWindow[persona] {
  -moz-appearance: none;
  background-repeat: no-repeat;
  background-position: top right;
}

/* Make the toolbox and search input transparent so the image shines through them. */
#messengerWindow[persona] toolbar {
  -moz-appearance: none;
  background-color: transparent;
  /*background-image: none !important;*/
}

#messengerWindow[persona] #nav-bar {
  -moz-appearance: none;
  background-image: none; 
  background-color: transparent;
}

/* Gray out the window slightly when it's not active. */
#messengerWindow[persona]:not([active="true"]) > #mail-toolbox > toolbar {
  -moz-appearance: none;
  background-color: transparent; 
  border-bottom-color: inherit;
  border-top-color: inherit;
}


/******************************************************************************/
/* Make some elements a little transparent so the persona flavors their look. */

#messengerWindow[persona] #searchInput,
#messengerWindow[persona] #urlbar,
#messengerWindow[persona] #searchbar,
#messengerWindow[persona] #mail-bar3 > toolbaritem > menulist /* View and Folder menus */
{
  opacity: 0.8;
}

#messengerWindow[persona] toolbarbutton.bookmark-item {
  -moz-appearance: none;
  background-color: transparent;
}

#messengerWindow[persona] .findbar-find-next,
#messengerWindow[persona] .findbar-find-previous,
#messengerWindow[persona] .findbar-highlight {
  background: url("chrome://personas/skin/white-gray-gradient.png") repeat-x top center;
  color: inherit !important;
}

#messengerWindow[persona] .findbar-container > toolbarbutton:not([disabled]):hover:active,
#messengerWindow[persona] .findbar-container > hbox > toolbarbutton:not([disabled]):hover:active {
  background-image: url("chrome://personas/skin/white-gray-gradient-active.png");
  color: inherit !important;
}

#messengerWindow[persona] .findbar-container > toolbarbutton[disabled],
#messengerWindow[persona] .findbar-container > hbox > toolbarbutton[disabled] {
  opacity: 0.5;
}


/******************************************************************************/
/* Eliminate top/bottom borders from statusbars so they don't mar the persona. */

#status-bar[persona] statusbar {
  border-top-width: 1px !important;
  border-top-color: transparent !important;
}

#status-bar[persona] #FindToolbar {
  border-top-width: 1px;
  border-top-color: transparent;
}


/******************************************************************************/
/* Eliminate text shadows from toolbarbutton, tab, and statusbar text so it
 * doesn't create an unnatural color stroke on the bottom half of the text. */

#messengerWindow[persona] .toolbarbutton-text,
#messengerWindow[persona] .tab-text,
#status-bar[persona] statusbar {
  text-shadow: none;
}


/******************************************************************************/
/* Style the tab bar. */

#messengerWindow[persona] .tabmail-tabs {
  -moz-appearance: none;
  background-color: transparent;
  background-image: none !important;
}

#messengerWindow[persona]:not([active="true"]) .tabmail-strip {
  opacity: 0.8; 
}

#messengerWindow[persona] .tabmail-strip {
  -moz-appearance: none;
  /*background-image: url(chrome://personas/skin/tabmail-tabs-bkgnd.png) !important;*/
  background-color: transparent; 
  background-image: none !important;
}

#messengerWindow[persona] .tabmail-tab {
  /*opacity: 0.6;*/
  /*color: black !important;*/
}

#messengerWindow[persona] .tabmail-tab[selected="true"],
#messengerWindow[persona] .tabmail-tab:hover {
  /*background-color: none;*/
  /*opacity: 0.6;*/
}

#messengerWindow[persona] .tab-text,
#messengerWindow[persona] .tab-text-shadow {
  /*font-weight: normal !important;*/
}

#messengerWindow[persona] .tabmail-tab {
  -moz-appearance: none;
  -moz-border-radius: 0 0 6px 6px;
  color: #222;
  -moz-box-pack: center;
  -moz-box-align: center;
  margin-bottom: 1px;
  -moz-margin-end: 1px;
  padding: 0 5px;
  border-style: none solid solid;
  border-width: 3px;
  -moz-border-right-colors: rgba(0, 0, 0, .08) rgba(0, 0, 0, .17) rgba(180, 180, 180, .29);
  -moz-border-bottom-colors: rgba(0, 0, 0, .08) rgba(0, 0, 0, .17) rgba(180, 180, 180, .29);
  -moz-border-left-colors: rgba(0, 0, 0, .08) rgba(0, 0, 0, .17) rgba(180, 180, 180, .29);
  -moz-background-clip: padding;
  min-width: 1px !important;
  text-align: center;
  height: 24px;
  background-image: none !important;
}

#messengerWindow[persona] .tabmail-tab:not([selected="true"]) {
  background-image: url(chrome://personas/skin/tabmail-tabs-bkgnd.png) !important;
  /*background-image: url(chrome://browser/skin/tabmail/tab-bkgnd.png);*/
  /*background-image: none !important;*/
}

#messengerWindow[persona] .tabmail-tab[selected="true"] {
  -moz-user-focus: normal;
  padding: 0 6px 1px;
  border-width: 2px;
  -moz-border-left-colors: rgba(0, 0, 0, .1) rgba(0, 0, 0, .2);
  -moz-border-bottom-colors: rgba(0, 0, 0, .1) rgba(0, 0, 0, .2);
  -moz-border-right-colors: rgba(0, 0, 0, .1) rgba(0, 0, 0, .2);
  background-color: transparent !important;
  background-image: none !important;
}


/******************************************************************************/
/* Eliminate top/bottom borders from statusbars so they don't mar the persona. */

/* IMPORTANT: these rules are very carefully devised to remove or hide borders
 * without changing the overall height of the bottom chrome, so content doesn't
 * jump up or down when the user switches from the default theme to a persona.
 * So when changing these rules, be very careful that you don't inadvertently
 * change the overall height of the toolbar. */

#status-bar[persona], #status-bar[persona] > hbox, #status-bar[persona] statusbarpanel {
  -moz-appearance: none; /* undo -moz-appearance: statusbarpanel */

  background-repeat: no-repeat;
  border: 0px solid transparent;
}
