/* ***** 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 quickFilterBar.css.
 *
 * The Initial Developer of the Original Code is
 * The Mozilla Foundation.
 * Portions created by the Initial Developer are Copyright (C) 2010
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   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 ***** */
 
@import url("chrome://messenger/content/quickFilterBar.css");

/* :::: Filter Tab Bar Button :::: */

#qfb-show-filter-bar {
  -moz-appearance: none;
  list-style-image: url("chrome://messenger/skin/icons/filter.png");
  background: -moz-linear-gradient(left, transparent, transparent 1px,
              rgba(255, 255, 255, .4) 1px, rgba(255, 255, 255, .4));
  background-position: -5px -2px;
  background-repeat: no-repeat;
  background-size: -moz-calc(100% + 11px) -moz-calc(100% + 7px);
  border: 0;
  margin: 3px 0 0;
  -moz-margin-end: 1px;
  padding: 0 4px;
  -moz-border-image: url(chrome://messenger/skin/icons/tab.png) 4 5 3 6 /
                     4px 5px 3px 6px repeat stretch;
  height: 22px;
  border-radius: 10px 8px 0 0;
}

#qfb-show-filter-bar:hover {
  background-image: -moz-linear-gradient(left, transparent, transparent 1px,
                    rgba(255, 255, 255, .6) 1px, rgba(255, 255, 255, .6));
}

#qfb-show-filter-bar:hover:active,
#qfb-show-filter-bar[checked],
#qfb-show-filter-bar[checked]:hover {
  background-image: -moz-linear-gradient(left, transparent, transparent 1px,
                    rgba(255, 255, 255, .8) 1px, rgba(255, 255, 255, .9));
}

#qfb-show-filter-bar > .toolbarbutton-icon {
  padding: 0 3px;
}

#qfb-show-filter-bar > .toolbarbutton-text {
  display: none;
}

/* :::: Filter Bar :::: */

#quick-filter-bar-main-bar {
  -moz-padding-start: 2px;
}

#quick-filter-bar-tab-bar,
#quick-filter-bar-filter-text-bar {
  padding: 2px;
}

#quick-filter-bar-main-bar,
#quick-filter-bar-tab-bar,
#quick-filter-bar-filter-text-bar {
  border-bottom: 1px solid ThreeDShadow;
}

@media all and (-moz-windows-default-theme) {
  #quick-filter-bar-main-bar,
  #quick-filter-bar-tab-bar,
  #quick-filter-bar-filter-text-bar {
    background: #f8f8f8;
    border-bottom-color: #a9b1b8;
  }
}

@media all and (-moz-windows-default-theme) {
  #threadTree[filterActive="searching"] {
    background-color: #ffffcc;
  }

  #threadTree[filterActive="matches"] {
    background-color: #f2f9fc;
  }

  #threadTree[filterActive="nomatches"] {
    background: -moz-repeating-linear-gradient(top left -45deg, #fff0f4,
                #fff0f4 5px, white 5px, white 10px);
  }
}

/* :::: Filter Buttons :::: */

#quick-filter-bar toolbarbutton {
  -moz-appearance: none;
  border-radius: 3.5px;
  border: 1px solid transparent;
  color: ButtonText;
}

#quick-filter-bar toolbarbutton:not([checked="true"]):hover {
  border-top-color: ButtonHighlight;
  -moz-border-start-color: ButtonHighlight;
  border-bottom-color: ButtonShadow;
  -moz-border-end-color: ButtonShadow;
}

#quick-filter-bar toolbarbutton:hover:active,
#quick-filter-bar toolbarbutton[checked="true"] {
  padding: 3px;
  border-top-color: ButtonShadow;
  -moz-border-start-color: ButtonShadow;
  border-bottom-color: ButtonHighlight;
  -moz-border-end-color: ButtonHighlight;
  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);
}

@media all and (-moz-windows-default-theme) {
  #quick-filter-bar toolbarbutton:not([checked="true"]):hover {
    background: hsla(190, 60%, 70%, .5)
                -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-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%);
    text-shadow: 0 0 3px white;
    -moz-transition: background-color .4s ease-in,
                     border-color .3s ease-in,
                     box-shadow .3s ease-in;
  }

  #quick-filter-bar toolbarbutton:hover:active,
  #quick-filter-bar toolbarbutton[checked="true"] {
    background-color: transparent;
    border-color: rgba(0, 0, 0, .65) rgba(0, 0, 0, .55) rgba(0, 0, 0, .5);
    text-shadow: none;
  }

  #quick-filter-bar toolbarbutton[checked="true"]:hover {
    box-shadow: 0 0 9px rgba(0, 0, 0, .3) inset,
                0 0 3px rgba(0, 0, 0, .2) inset,
                0 1px 0 rgba(255, 255, 255, .3);
    -moz-transition: box-shadow .3s ease-in;
  }
}

#quick-filter-bar-main-bar toolbarbutton {
  min-width: 22px;
  -moz-margin-start: 1px;
  -moz-margin-end: 1px;
  list-style-image: url("chrome://messenger/skin/icons/quick-search-icons.png");
}

/* keep that hideous outline focus ring from showing on the checked buttons */
#quick-filter-bar-main-bar toolbarbutton:focus {
  outline: none;
}

#qfb-filter-label:-moz-system-metric(windows-default-theme) {
  color: GrayText;
}

#qfb-sticky {
  -moz-image-region: rect(0 16px 16px 0);
}

#qfb-sticky[checked] {
  -moz-image-region: rect(0 32px 16px 16px);
}

#qfb-unread {
  -moz-image-region: rect(0 48px 16px 32px);
}

#qfb-starred {
  -moz-image-region: rect(0 64px 16px 48px);
}

#qfb-inaddrbook {
  -moz-image-region: rect(0 80px 16px 64px);
}

#qfb-tags {
  -moz-image-region: rect(0 112px 16px 96px);
}

#qfb-tags[disabled] > .toolbarbutton-icon {
  opacity: .4;
}

#qfb-attachment {
  -moz-image-region: rect(0 96px 16px 80px);
}

#quick-filter-bar[filterActive="matches"] #qfb-results-label {
  color: green;
}

#quick-filter-bar[filterActive="nomatches"] #qfb-results-label {
  color: #f66;
}

.toolbarbutton-icon {
  -moz-margin-end: 0;
}

#quick-filter-bar-collapsible-buttons toolbarbutton label.toolbarbutton-text {
  -moz-margin-start: 3px !important;
}

#quick-filter-bar-expando toolbarbutton,
#quick-filter-bar-expando toolbarbutton:hover:active,
#quick-filter-bar-expando toolbarbutton[checked] {
  padding-top: 1px;
  padding-bottom: 1px;
  -moz-margin-start: 1px;
  -moz-margin-end: 1px;
}

/* :::: Filter Textbox :::: */

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

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