/*
 * Copyright (C) 2013 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */

.find-banner {
    border-bottom: 1px solid var(--border-color);

    position: absolute;
    top: -22px;
    left: 0;
    right: 0;
    height: 22px;

    text-align: right;

    white-space: nowrap;
    overflow: hidden;

    transition-property: top;
    transition-duration: 200ms;
    transition-timing-function: ease-in;

    z-index: var(--z-index-header);
}

.find-banner.showing {
    top: 0;
    transition-timing-function: ease-out;
}

.no-find-banner-transition:matches(.find-banner, .supports-find-banner) {
    transition-duration: 0 !important;
}

.supports-find-banner {
    transition-property: top;
    transition-duration: 200ms;
    transition-timing-function: ease-in;
}

.supports-find-banner.showing-find-banner {
    top: 22px !important;
    transition-timing-function: ease-out;
}

.find-banner > :first-child {
    margin-left: 8px !important;
}

.find-banner > :last-child {
    margin-right: 8px !important;
}

.find-banner > input[type="search"] {
    margin: 1px 4px;

    width: 30vw;
    min-width: 143px;
    max-width: 210px;
    height: 19px;

    vertical-align: top;

    -webkit-appearance: none;

    outline: none;

    border: 1px solid hsl(0, 0%, 57%);
    border-radius: 4px;
    background-color: white;
}

.find-banner > button {
    margin: 1px 4px;

    padding-left: 6px;
    padding-right: 6px;

    -webkit-appearance: none;

    border-radius: 4px;
    border: 1px solid hsl(0, 0%, 57%);

    background-color: white;
    background-image: none;
    box-shadow: none;

    line-height: 11px;

    height: 19px;

    text-align: center;
    vertical-align: top;

    outline-offset: -2px;
}

.find-banner > button > .glyph {
    display: inline-block;

    width: 7px;
    height: 11px;
}

.find-banner > button:disabled > .glyph {
    opacity: 0.65;
}

.find-banner > button:active:not(:disabled) {
    border: 1px solid hsl(0, 0%, 55%);
    background-image: linear-gradient(to bottom, hsl(0, 0%, 78%), hsl(0, 0%, 85%));
    box-shadow: hsla(0, 0%, 100%, 0.33) 0 1px 0, inset hsl(0, 0%, 64%) 0 1px 1px;
}

.find-banner > button:disabled {
    border: 1px solid hsl(0, 0%, 76%);
    background-image: none;
}

.find-banner > button.segmented.left {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 0;
}

.find-banner > button.segmented.left > .glyph {
    background-image: url(../Images/BackForwardArrows.svg#back-arrow-normal);
}

.find-banner > button.segmented.left:active:not(:disabled) > .glyph {
    background-image: url(../Images/BackForwardArrows.svg#back-arrow-active);
}

.find-banner > button.segmented.right {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.find-banner > button.segmented.right > .glyph {
    background-image: url(../Images/BackForwardArrows.svg#forward-arrow-normal);
    margin-left: 1px;
}

.find-banner > button.segmented.right:active:not(:disabled) > .glyph {
    background-image: url(../Images/BackForwardArrows.svg#forward-arrow-active);
}

.find-banner > button.segmented {
    min-width: 22px;
    padding: 3px 6px 2px;
}

.find-banner > button.segmented > .glyph {
    background-size: 7px 11px;
    background-repeat: no-repeat;
}

.find-banner > button.segmented:active {
    z-index: var(--z-index-header);
    position: relative;
}

.find-banner > label {
    margin: 0 6px;
    line-height: 21px;
}

.find-banner.console-find-banner {
    position: relative;
    top: auto;
    border: 0;
}

body .find-banner.console-find-banner {
    flex-wrap: nowrap;
}

.find-banner.console-find-banner > input[type="search"] {
    padding-top: 0;
    margin: 1px 6px;
    outline: none;
    -webkit-appearance: none;
    border: 1px solid hsla(0, 0%, 0%, 0.35);
    border-radius: 3px;
    background-color: hsla(0, 0%, 100%, 0.2);
    background-clip: padding-box;
    height: 22px;    
}

.find-banner.console-find-banner > input[type="search"]::-webkit-input-placeholder {
    color: hsla(0, 0%, 0%, 0.35);
}

.find-banner.console-find-banner > input[type="search"]::-webkit-textfield-decoration-container {
    margin-left: 4px;
}

.find-banner.console-find-banner > input[type="search"]:focus {
    background-color: white;
}

/* Make the search field's background white when it is not focused and has content.
   Needs to be a separate rule. See http://webkit.org/b/118162 */
.find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown) {
    background-color: white;
}
