/* ***** 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 mozilla.org code.
 *
 * The Initial Developer of the Original Code is
 * the Mozilla Foundation.
 * Portions created by the Initial Developer are Copyright (C) 2009
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Andreas Nilsson <nisses.mail@home.se>
 *   Richard Marti <mozilla@paenglab.ch>
 *
 * 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 ***** */

/* ===== addressbook.css ================================================
   == Styles for the main Address Book window.
   ====================================================================== */

@import url("chrome://messenger/skin/");
@import url("chrome://global/skin/toolbar.css");

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

#addressbookWindow:-moz-lwtheme {
  background-repeat: no-repeat;
  background-position: top right;
}

/* :::: Toolbar :::: */

#ab-toolbox {
  -moz-appearance: none;
  border-top: none;
  background-color: transparent;
}

toolbar:not(:-moz-lwtheme) {
  -moz-appearance: none;
  border: none;
  background-color: -moz-Dialog;
}

@media all and (-moz-windows-default-theme) {
  toolbar:not(:-moz-lwtheme) {
    background-color: rgb(227, 237, 246);
  }
}

toolbox > toolbar:first-child:not(:-moz-lwtheme) {
  background-image: -moz-linear-gradient(rgba(255, 255, 255, .5),
                    rgba(255, 255, 255, .0));
}

toolbox > toolbar:last-of-type:not(:-moz-lwtheme) {
  background-image: -moz-linear-gradient(transparent, transparent 10%,
                    rgba(0, 0, 0, .03) 50%, rgba(0, 0, 0, .1) 90%,
                    rgba(0, 0, 0, .2));
}

/* ::::: primary toolbar buttons ::::: */

.toolbarbutton-menubutton-button,
.toolbarbutton-menubutton-dropmarker,
.toolbarbutton-1 {
  -moz-appearance: none;
  padding: 1px 5px !important;
  background: rgba(151, 152, 153, .05)
              -moz-linear-gradient(rgba(251, 252, 253, .95),
              rgba(246, 247, 248, .47) 49%, rgba(231, 232, 233, .45) 51%,
              rgba(225, 226, 229, .3));
  border-radius: 3.5px;
  border: 1px solid;
  border-color: rgba(0, 0, 0, .12) rgba(0, 0, 0, .19) rgba(0, 0, 0, .38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset,
              0 0 0 2px rgba(255, 255, 255, .1) inset;
  color: ButtonText;
  text-shadow: 0 0 3px white;
}

.toolbarbutton-menubutton-dropmarker,
toolbar[iconsize="small"][mode="icons"] .toolbarbutton-menubutton-button,
toolbar[iconsize="small"][mode="icons"] .toolbarbutton-1 {
  padding-left: 3px !important;
  padding-right: 3px !important;
}

.toolbarbutton-1 {
  -moz-box-orient: vertical;
}

toolbarbutton[type="menu-button"] {
  -moz-appearance: none !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.toolbarbutton-1,
toolbarbutton[type="menu-button"] {
  margin: 1px 3px;
}

toolbox[labelalign="end"] .toolbarbutton-1,
toolbox[labelalign="end"] .toolbarbutton-menubutton-button {
  -moz-box-orient: horizontal;
}

toolbar[iconsize="small"][mode="icons"] .toolbarbutton-1,
toolbar[iconsize="small"][mode="icons"] toolbarbutton[type="menu-button"] {
  margin-left: 2px;
  margin-right: 2px;
}

.toolbarbutton-menubutton-dropmarker {
  -moz-border-start-style: none;
}

.toolbarbutton-menubutton-button:-moz-locale-dir(ltr),
.toolbarbutton-menubutton-dropmarker:-moz-locale-dir(rtl) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.toolbarbutton-menubutton-button:-moz-locale-dir(rtl),
.toolbarbutton-menubutton-dropmarker:-moz-locale-dir(ltr) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.toolbarbutton-menubutton-button[disabled="true"],
.toolbarbutton-menubutton-dropmarker[disabled="true"],
.toolbarbutton-1[disabled="true"] {
  opacity: .8;
}

.toolbarbutton-menubutton-button[disabled="true"] > .toolbarbutton-icon,
.toolbarbutton-1[disabled="true"] > .toolbarbutton-icon {
  opacity: .5;
}

.toolbarbutton-menubutton-button:not([disabled="true"]):not(:active):hover,
toolbarbutton[type="menu-button"]:not([open="true"]):not(:active):hover >
                  .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
.toolbarbutton-1:not([disabled="true"]):not([checked="true"]):not(:active):hover {
  background-color: hsla(190, 60%, 70%, .5);
  border-color: hsla(190, 50%, 65%, .8) hsla(190, 50%, 50%, .8)
                hsla(190, 50%, 40%, .8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset,
              0 0 0 2px rgba(255, 255, 255, .1) inset,
              0 0 5px hsl(190, 90%, 80%);
  -moz-transition: background-color .4s ease-in,
                   border-color .3s ease-in,
                   box-shadow .3s ease-in;
}

.toolbarbutton-menubutton-button:not([disabled="true"]):hover:active,
toolbarbutton[type="menu-button"]:hover:active >
                   .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
toolbarbutton[type="menu-button"][open="true"] >
                                          .toolbarbutton-menubutton-dropmarker,
.toolbarbutton-1:not([disabled="true"]):hover:active,
.toolbarbutton-1[checked="true"],
.toolbarbutton-1[open="true"] {
  background-color: transparent;
  border-color: rgba(0, 0, 0, .65) rgba(0, 0, 0, .55) rgba(0, 0, 0, .5);
  box-shadow: 0 0 9px rgba(0, 0, 0, .4) inset,
                   0 0 3px rgba(0, 0, 0, .4) inset,
                   0 1px 0 rgba(255, 255, 255, .4);
  text-shadow: none;
}

.toolbarbutton-1[checked="true"]:not(:active):hover {
  background-color: rgba(90%, 90%, 90%, .4);
  -moz-transition: background-color .4s;
}

.toolbarbutton-menubutton-button > .toolbarbutton-icon,
.toolbarbutton-1 > .toolbarbutton-icon {
  -moz-margin-end: 0;
  width: 18px;
  height: 18px;
}

toolbar[iconsize="small"] .toolbarbutton-menubutton-button > .toolbarbutton-icon,
toolbar[iconsize="small"] .toolbarbutton-1 > .toolbarbutton-icon {
  margin: 1px;
  width: 16px;
  height: 16px;
}

/* Default icons have a built-in glow, so they are 18*18px even in small mode,
   except for the large back icon, which is why the code below uses 'auto'
   rather than 18px. This will pick the correct size based on the image
   region. */
:-moz-any(
    #button-newcard, #button-newlist, #button-editcard, #button-newmessage,
    #button-newim, #button-abdelete) .toolbarbutton-icon {
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
}

toolbox[labelalign="end"] > toolbar[mode="full"] .toolbarbutton-1 .toolbarbutton-text {
  -moz-padding-start: 2px;
}

toolbox[labelalign="end"] > toolbar[mode="full"] deck .toolbarbutton-text {
  text-align: start;
}

@media all and (-moz-windows-compositor) {
  #addressbookWindow,
  #abContent {
    -moz-appearance: -moz-win-borderless-glass;
    background: transparent;
  }

  #ab-toolbox:not(:-moz-lwtheme),
  #ab-toolbox > #ab-bar2,
  #ab-toolbox > toolbar {
    background: transparent;
    border-style: none;
  }

  #ab-toolbox:not(:-moz-lwtheme) {
    color: black;
    text-shadow: 0 0 .7em white, 0 0 .7em white, 0 1px 0 rgba(255, 255, 255, .4);
  }

  #menubar-items:not(:-moz-lwtheme) {
    background-color: rgba(255, 255, 255, .5);
    border-radius: 4px;
  }

  menubar > menu:-moz-window-inactive {
    color: MenuText;
  }

  /* lesser transparency on Glass background */
  .toolbarbutton-menubutton-button:not(:-moz-lwtheme),
  .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme),
  .toolbarbutton-1:not(:-moz-lwtheme) {
    background-color: rgba(227, 237, 246, .7);
  }

  /* lesser transparency on Glass background */
  .toolbarbutton-menubutton-button:not(:-moz-lwtheme):not([disabled="true"]):not(:active):hover,
  toolbarbutton[type="menu-button"]:not(:-moz-lwtheme):not([open="true"]):not(:active):hover >
                    .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
  .toolbarbutton-1:not(:-moz-lwtheme):not([disabled="true"]):not([checked="true"]):not(:active):hover {
    background-color: rgba(136, 197, 213, .85);
  }

  .toolbarbutton-menubutton-button[disabled="true"],
  .toolbarbutton-menubutton-dropmarker[disabled="true"] {
    opacity: 1 !important;
  }

  #addressbookWindow[sizemode=normal] #abContent {
    -moz-appearance: none;
    border: 1px solid rgba(10%, 10%, 10%, .4);
    border-top: none;
    background-color: transparent;
    background-clip: padding-box;
  }

  #addressbookWindow[sizemode=normal] statusbar {
    -moz-appearance: none;
    margin-top: -1px;
    border: 1px solid rgba(10%, 10%, 10%, .4);
    border-top-color: threedshadow;
    border-radius: 1px 1px 0 0;
    background-clip: padding-box;
  }
}

#button-newcard {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-toolbar.png");
  -moz-image-region: rect(0px 18px 18px 0px);
}

#button-newlist {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-toolbar.png");
  -moz-image-region: rect(0px 36px 18px 18px);
}

#button-editcard {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-toolbar.png");
  -moz-image-region: rect(0px 54px 18px 36px);
}

#button-newmessage {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-toolbar.png");
  -moz-image-region: rect(0px 72px 18px 54px);
}

#button-newim {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-toolbar.png");
  -moz-image-region: rect(0px 90px 18px 72px);
}

#button-abdelete {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/addressbook-toolbar.png");
  -moz-image-region: rect(0px 108px 18px 90px);
}

#abContent {
  text-shadow: none;
  background-color: -moz-Dialog;
}

/* ::::: Search Textbox ::::: */

#peopleSearchInput {
  -moz-appearance: none;
  background-clip: padding-box;
  border: 1px solid ThreeDDarkShadow;
  border-radius: 3.5px;
}

@media all and (-moz-windows-default-theme) {
  #peopleSearchInput {
    border-color:rgba(0, 0, 0, .32);
  }

  #peopleSearchInput:-moz-lwtheme {
    background-color: rgba(255, 255, 255, .8);
    border-color: rgba(0, 0, 0, .32);
    color: black;
  }
}

@media all and (-moz-windows-compositor) {
  #peopleSearchInput {
    background-color: rgba(255, 255, 255, .725);
    color: black;
  }

  #peopleSearchInput:hover {
    background-color: rgba(255, 255, 255, .898);
  }

  #peopleSearchInput[focused="true"] {
    background-color: white;
  }
}

/* ::::: address book sidebar ::::: */

@media all and (-moz-windows-default-theme) {
  sidebarheader {
    -moz-appearance: none;
    background-color: #F8F8F8;
    border-top: 0;
    border-bottom: 1px solid #A9B1B8;
  }
}

/* ::::: directory pane adjustments ::::: */

#abDirTreeHeader-title {
  -moz-padding-start: 4px;
}

/* ::::: directory pane icons ::::: */

treechildren::-moz-tree-image(DirCol) {
  -moz-margin-end: 2px;
  list-style-image: url("chrome://messenger/skin/addressbook/icons/addrbook.png");
}

treechildren::-moz-tree-image(DirCol, IsMailList-true) {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/ablist.png");
}

treechildren::-moz-tree-image(DirCol, IsRemote-true) {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/remote-addrbook.png");
}

treechildren::-moz-tree-image(DirCol, IsRemote-true, IsSecure-true) {
  list-style-image: url("chrome://messenger/skin/addressbook/icons/secure-remote-addrbook.png");
}

/* Don't use the listbox appearance as that gives us a blue-grey top border
   that collides with the primary toolbar border */
#dirTree {
  -moz-border-end: 1px solid transparent;
}

@media all and (-moz-windows-default-theme) {
  #dirTree {
    background-color: #EEF3FA;
  }
}

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

/* ::::: splitters ::::: */

#dirTree-splitter {
  border: none;
  -moz-border-end: 1px solid #A9B7C9;
  min-width: 0;
  width: 3px;
  background-color: transparent;
  -moz-margin-start: -3px;
  position: relative;
  z-index: 10;
}

#results-splitter {
  border: none;
  border-top: 1px solid #A9B7C9;
  min-height: 0;
  height: 3px;
  background-color: transparent;
  margin-bottom: -3px;
  position: relative;
  z-index: 10;
}

/* ::::: results pane ::::: */

#abResultsTree {
  -moz-border-end: 1px solid ThreeDHighlight;
}

@media all and (-moz-windows-default-theme) {
  #abResultsTree {
    background-color: #EEF3FA;
  }
}

#GeneratedName {
  -moz-padding-start: 30px;
}

treechildren::-moz-tree-image(GeneratedName) {
  -moz-margin-end: 2px;
  list-style-image: url("chrome://messenger/skin/addressbook/icons/abcard.png");
}

treechildren::-moz-tree-image(GeneratedName, MailList) {
  -moz-margin-end: 2px;
  list-style-image: url("chrome://messenger/skin/addressbook/icons/ablist.png");
}

treechildren::-moz-tree-cell-text(GeneratedName) {
  -moz-padding-start: 0 !important;
}

/* ::::: card view pane ::::: */

#CardViewOuterBox {
  border: none;
  border-top: 1px solid ThreeDShadow;
}

#CardViewBox {
  -moz-user-focus: ignore;
  overflow: auto;
  min-width: 150px;
  color: -moz-FieldText;
  background-color: -moz-Field;
}

@media all and (-moz-windows-default-theme) {
  #CardViewBox {
    background-color: #EEF3FA;
  }
}

#CardViewInnerBox {
  margin-top: 2px;
  margin-bottom: 2px;
  padding: 0 8px;
}

#CardTitle {
  font-size: 150%;
  font-weight: bold;
  border-bottom: 2px solid -moz-FieldText;
  min-width: 120px;
  margin: 0px;
}
 
.cardViewGroup {
  margin-top: 8px;
  padding-bottom: 5px;
  min-width: 50px;
}

.CardViewHeading {
  padding: 1px;
  -moz-padding-start: 5px;
  background-color: Highlight;
  color: HighlightText;
  font-weight: bold;
  min-width: 30px;
}

#cvBuddyIcon {
  -moz-padding-start: 20px;
  padding-top: 2px;
}

.CardViewText,
.CardViewLink {
  -moz-padding-start: 20px;
  -moz-padding-end: 2px;
  min-width: 30px;
  margin: 0px;
}

.CardViewLink {
  color: -moz-nativehyperlinktext;
  cursor: pointer;
}

#cvHomeMapIt, #cvWorkMapIt {
  margin-bottom: 0px;
}

html|a {
  -moz-padding-start: 0px;
  -moz-padding-end: 2px;
  border: none !important;
  text-decoration: underline;
}

html|p {
  border: none !important;
}
