/*
 * Copyright (C) 2017 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.
 */

.spreadsheet-css-declaration {
    margin: 0;
    padding: 0 0 var(--css-declaration-vertical-padding);
    font-family: Menlo, monospace;
    color: hsl(0, 0%, 70%);
    background: white;
    border-bottom: 0.5px solid hsla(0, 0%, 0%, 0.2);
    -webkit-user-select: text;

    --css-declaration-vertical-padding: 4px;
    --css-declaration-horizontal-padding: 6px;
}

.spreadsheet-css-declaration :matches(.header, .header-media) {
    padding: 0 var(--css-declaration-horizontal-padding);
}

.spreadsheet-css-declaration :matches(.header, .header-media):first-child {
    padding-top: var(--css-declaration-vertical-padding);
}

.spreadsheet-css-declaration .header.editing-selector .origin {
    position: absolute;
    right: var(--css-declaration-horizontal-padding);
}

.spreadsheet-css-declaration .media-label {
    color: black;
}

.spreadsheet-css-declaration .origin {
    float: right;
    max-width: 100%;
    font: 11px sans-serif;
    color: hsl(0, 0%, 50%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spreadsheet-css-declaration.locked .origin::after {
    display: inline-block;
    position: relative;
    top: 1px;
    width: 8px;
    height: 10px;
    margin-left: 4px;
    content: url(../Images/Locked.svg);
}

.spreadsheet-css-declaration .origin .go-to-link {
    color: hsl(0, 0%, 50%);
}

.spreadsheet-css-declaration .origin .go-to-link:hover {
    color: hsl(0, 0%, 33%);
}

.spreadsheet-css-declaration .styles-source {
    float: right;
}

.spreadsheet-css-declaration .selector {
    position: relative;
    z-index: 1;
}

.spreadsheet-css-declaration .selector.style-attribute {
    font: 12px sans-serif;
    color: hsl(0, 0%, 30%);
    -webkit-user-modify: read-only;
}

.spreadsheet-css-declaration .selector > span {
    color: hsl(0, 0%, 50%);
}

.spreadsheet-css-declaration .selector:focus,
.spreadsheet-css-declaration .selector > .matched {
    color: black;
}

.spreadsheet-css-declaration.locked {
    background-color: hsl(0, 0%, 97%)
}

.spreadsheet-css-declaration .locked-icon {
    width: 8px;
    height: 10px;
    content: url(../Images/Locked.svg);
}

.spreadsheet-css-declaration .selector.spreadsheet-selector-field {
    outline-offset: -3px;
}

.spreadsheet-css-declaration .selector.spreadsheet-selector-field.editing {
    display: inline-block;
    box-shadow: hsla(0, 0%, 0%, 0.5) 0 1px 3px;
    outline: none !important;
}

.spreadsheet-css-declaration .close-brace {
    display: inline-block;
    padding-left: var(--css-declaration-horizontal-padding);
}
