/*
 * Copyright (c) 2014 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.
 */

:host {
    flex: none;
    padding: 0 2px;
}

.toolbar-shadow {
    position: relative;
    white-space: nowrap;
    height: 26px;
    overflow: hidden;
    z-index: 12;
    display: flex;
    flex: none;
    align-items: center;
}

.toolbar-shadow.wrappable {
    flex-wrap: wrap;
}

.toolbar-shadow.wrappable-reverse {
    flex-direction: row-reverse;
}

.toolbar-shadow.vertical {
    flex-direction: column;
    height: auto;
    width: 26px;
}

.toolbar-item {
    position: relative;
    display: flex;
    background-color: transparent;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 26px;
    border: none;
    color: #5a5a5a;
}

.toolbar-dropdown-arrow {
    background-color: #6D6D6D;
    pointer-events: none;
    margin: auto 0;
    flex: none;
}

/* Toolbar item */

.toolbar-button {
    white-space: nowrap;
    overflow: hidden;
    min-width: 28px;
    background: transparent;
}

.toolbar-text {
    margin: 0 5px;
    flex: none;
    color: #5a5a5a;
}

.toolbar-has-dropdown {
    justify-content: space-between;
}

.toolbar-has-dropdown .toolbar-text {
    margin: 0 4px 0 0;
    text-overflow: ellipsis;
    flex: auto;
    overflow: hidden;
    text-align: right;
    color: #333 !important;
}

.toolbar-button .toolbar-dropdown-arrow {
    background-color: #333 !important;
}

.toolbar-has-glyph .toolbar-text {
    margin-left: 0;
}

.toolbar-button:not(.toolbar-has-glyph):not(.toolbar-has-dropdown):not(.largeicon-menu) {
    font-weight: bold;
}

.toolbar-render-as-links * {
    font-weight: initial;
    color: rgb(17, 85, 204);
    text-decoration: underline;
    cursor: pointer;
}

:not(.toolbar-render-as-links) .toolbar-button:not(.toolbar-has-glyph):not(.toolbar-has-dropdown):not(.largeicon-menu).hover {
    background-color: #f3f3f3;
}

.toolbar-glyph {
    background-color: #5a5a5a;
    flex: none;
    transform: translateX(-2px);
}

/* Button */

.toolbar-button:disabled {
    opacity: 0.5;
}

:not(.toolbar-render-as-links) .toolbar-button:enabled.hover:not(:active) .toolbar-glyph {
    background-color: #333;
}

:not(.toolbar-render-as-links) .toolbar-button:enabled.hover:not(:active) .toolbar-text {
    color: #333;
}

.toolbar-button.toolbar-state-on .toolbar-glyph,
.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled.hover:not(:active),
.-theme-selection-color {
    background-color: hsl(218, 81%, 59%);
}

.toolbar-button.toolbar-state-on .toolbar-text,
.-theme-selection-color {
    color: hsl(218, 81%, 59%);
}

.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled.hover .toolbar-glyph {
    background-color: white;
}

.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled.hover .toolbar-text {
    color: white;
}

.toolbar-button.toolbar-state-on:enabled.hover:not(:active) .toolbar-glyph,
.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled:active.hover,
.-theme-selection-color {
    background-color: hsl(218, 96%, 54%);
}

.toolbar-button.toolbar-state-on:enabled.hover:not(:active) .toolbar-text,
.-theme-selection-color {
    color: hsl(218, 96%, 54%);
}

.toolbar-toggled-gray .toolbar-button.toolbar-state-on {
    background-color: #f3f3f3 !important;
}

.toolbar-button.toolbar-state-on.toolbar-toggle-with-red-color .toolbar-glyph {
    background-color: rgb(216, 0, 0) !important;
}

:host-context(.-theme-with-dark-background) .toolbar-button.toolbar-state-on.toolbar-toggle-with-red-color .toolbar-glyph {
    background-color: hsl(0, 100%, 65%) !important;
}


/* Checkbox */

.toolbar-item.checkbox {
    padding: 0 5px 0 2px;
}

.toolbar-item.checkbox.hover {
    color: #333;
}

/* Select */

.toolbar-select-container {
    display: inline-flex;
    flex-shrink: 0;
    margin-right: 6px;
}

select.toolbar-item {
    min-width: 48px;
    -webkit-appearance: none;
    border: 0;
    border-radius: 0;
    padding: 0 15px 0 5px;
    margin-right: -10px;
    position: relative;
}

/* Input */

input.toolbar-item {
    width: 200px;
    height: 20px;
    padding: 3px;
    margin: 1px 3px;
    background-color: white;
    border: solid 1px #d8d8d8;
}

input.toolbar-item:focus,
input.toolbar-item.hover {
    border: solid 1px rgb(202, 202, 202);
}

/* Separator */

.toolbar-divider {
    background-color: #ccc;
    width: 1px;
    margin: 5px 4px;
    height: 16px;
}

.toolbar-spacer {
    flex: auto;
}

/* Long click */

.long-click-glyph {
    position: absolute;
    background-color: #5a5a5a;
    top: 0;
    left:  0;
}

.toolbar-button.emulate-active {
    background-color: rgb(163, 163, 163);
}

.toolbar-shadow.floating {
    flex-direction: column;
    height: auto;
    background-color: white;
    border: 1px solid #ccc;
    margin-top: -1px;
    width: 28px;
    left: -2px;
}

span.toolbar-select-container.toolbar-item.warning {
    background: #ffd7d7;
    padding: 0 5px 0 0;
    margin-right: 1px;
}
