/*
 * Copyright 2015 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

* {
    /* This is required for correct sizing of flex items because we rely
     * on an old version of the flexbox spec.
     * Longer-term we should remove this, see crbug.com/473625 */
    min-width: 0;
    min-height: 0;
}

:host-context(.platform-mac) .monospace,
:host-context(.platform-mac) .source-code,
.platform-mac .monospace,
.platform-mac .source-code {
    font-size: 11px !important;
    font-family: Menlo, monospace;
}

:host-context(.platform-windows) .monospace,
:host-context(.platform-windows) .source-code,
.platform-windows .monospace,
.platform-windows .source-code {
    font-size: 12px !important;
    font-family: Consolas, Lucida Console, monospace;
}

:host-context(.platform-linux) .monospace,
:host-context(.platform-linux) .source-code,
.platform-linux .monospace,
.platform-linux .source-code {
    font-size: 11px !important;
    font-family: dejavu sans mono, monospace;
}

.source-code {
    font-family: monospace;
    font-size: 11px !important;
    white-space: pre-wrap;
}

* {
    box-sizing: border-box;
}

:focus {
    outline: none;
}

img {
    -webkit-user-drag: none;
}

iframe,
a img {
    border: none;
}

.fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

iframe.fill {
    width: 100%;
    height: 100%;
}

.widget {
    position: relative;
    flex: auto;
}

.hbox {
    display: flex;
    flex-direction: row !important;
    position: relative;
}

.vbox {
    display: flex;
    flex-direction: column !important;
    position: relative;
}

.flex-auto {
    flex: auto;
}

.flex-auto-important {
    flex: auto !important;
}

.flex-none {
    flex: none;
}

.flex-centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

iframe.widget {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.hidden {
    display: none !important;
}

.monospace {
    font-size: 10px !important;
    font-family: monospace;
}

.highlighted-search-result {
    border-radius: 1px;
    padding: 1px;
    margin: -1px;
    background-color: rgba(255, 255, 0, 0.8);
}

.-theme-with-dark-background .highlighted-search-result,
:host-context(.-theme-with-dark-background) .highlighted-search-result {
    background-color: hsl(133, 100%, 30%);
    color: #333;
}

.link {
    cursor: pointer;
    text-decoration: underline;
    color: rgb(17, 85, 204);
}

button,
input,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

input {
    background-color: white;
}

:host-context(.-theme-with-dark-background) input[type="checkbox"] {
    -webkit-filter: invert(80%);
}

input[type="search"]:focus,
input[type="text"]:focus {
    outline: auto 5px -webkit-focus-ring-color;
}


.highlighted-search-result.current-search-result {
    border-radius: 1px;
    padding: 1px;
    margin: -1px;
    background-color: rgba(255, 127, 0, 0.8);
}

.dimmed {
    opacity: 0.6;
}

.editing {
    -webkit-user-select: text;
    box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;
    outline: 1px solid rgb(66%, 66%, 66%) !important;
    background-color: white;
    -webkit-user-modify: read-write-plaintext-only;
    text-overflow: clip !important;
    padding-left: 2px;
    margin-left: -2px;
    padding-right: 2px;
    margin-right: -2px;
    margin-bottom: -1px;
    padding-bottom: 1px;
    opacity: 1.0 !important;
}

.editing,
.editing * {
    color: #222 !important;
    text-decoration: none !important;
}

.error-input {
    outline: auto 2px red !important;
}

.chrome-select {
    -webkit-appearance: none;
    -webkit-user-select: none;
    border: 1px solid rgb(160, 160, 160);
    border-radius: 2px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.75);
    color: #444;
    font: inherit;
    margin: 0 1px 0 0;
    outline: none;
    text-shadow: 0 1px 0 rgb(240, 240, 240);
    padding-right: 20px;
    padding-left: 6px;
    background-image: -webkit-image-set(url(Images/chromeSelect.png) 1x, url(Images/chromeSelect_2x.png) 2x), linear-gradient(#ededed, #ededed 38%, #dedede);
    background-position: right center;
    background-repeat: no-repeat;
    min-height: 24px;
}

.chrome-select:enabled:hover {
    background-image: -webkit-image-set(url(Images/chromeSelect.png) 1x, url(Images/chromeSelect_2x.png) 2x), linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
    color: black;
}

.chrome-select:enabled:active {
    background-image: -webkit-image-set(url(Images/chromeSelect.png) 1x, url(Images/chromeSelect_2x.png) 2x), linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
    box-shadow: none;
    text-shadow: none;
}

.chrome-select:enabled:focus {
    /* OVERRIDE */
    -webkit-transition: border-color 200ms;
    /* We use border color because it follows the border radius (unlike outline).
     * This is particularly noticeable on mac. */
    border-color: rgb(77, 144, 254);
    outline: none;
}

body.inactive select.chrome-select,
.chrome-select:disabled {
    background-image: -webkit-image-set(url(Images/chromeDisabledSelect.png) 1x, url(Images/chromeDisabledSelect_2x.png) 2x), linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
    border-color: rgba(80, 80, 80, 0.2);
    box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.75);
    color: #aaa;
}

:not(.platform-mac).-theme-with-dark-background ::-webkit-scrollbar,
:host-context(:not(.platform-mac).-theme-with-dark-background) ::-webkit-scrollbar {
    width: 14px;
}

:not(.platform-mac).-theme-with-dark-background ::-webkit-scrollbar-track,
:host-context(:not(.platform-mac).-theme-with-dark-background) ::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 1px rgba(255,255,255,0.3);
}

:not(.platform-mac).-theme-with-dark-background ::-webkit-scrollbar-thumb,
:host-context(:not(.platform-mac).-theme-with-dark-background) .-theme-with-dark-background ::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background-color: #333;
    -webkit-box-shadow: inset 0 0 1px rgba(255,255,255,0.5);
}
