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

.sidebar > .panel.changes-panel {
    white-space: pre-wrap;
    overflow-y: auto;
}

.sidebar > .panel.changes-panel .css-rule {
    padding: var(--css-declaration-vertical-padding) 0;
    font: 11px Menlo, monospace;
    color: var(--text-color-secondary);
    background-color: var(--background-color-content);
    user-select: text;
}

.sidebar > .panel.changes-panel .css-rule + .css-rule {
    border-top: 0.5px solid var(--text-color-quaternary);
}

.sidebar > .panel.selected.changes-panel.empty {
    display: flex;
    justify-content: center;
    align-items: center;
}

.changes-panel .resource-section {
    border-bottom: 0.5px solid var(--text-color-quaternary);
}

.changes-panel .resource-section > .header {
    position: sticky;
    top: 0;
    z-index: var(--z-index-header);
    padding: 4px 8px;
    background-color: var(--panel-background-color);
    border-bottom: 0.5px solid var(--text-color-quaternary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.changes-panel .resource-section > .header > a:hover {
    color: var(--text-color);
}

.sidebar > .panel.changes-panel .selector-line,
.sidebar > .panel.changes-panel .close-brace {
    padding-left: var(--css-declaration-horizontal-padding);
}

.changes-panel .selector.style-attribute {
    font: 12px sans-serif;
}

.changes-panel .selector:not(.style-attribute) {
    color: var(--text-color);
}

.changes-panel .css-property-line > .property {
    display: inline;
}

.changes-panel .css-property-line.added {
    color: var(--diff-addition-text-color);
    background-color: var(--diff-addition-background-color);
}

.changes-panel .css-property-line.removed {
    color: var(--diff-deletion-text-color);
    background-color: var(--diff-deletion-background-color);
}

.changes-panel .css-property-line.removed::before {
    content: "-";
    position: absolute;
    left: var(--css-declaration-horizontal-padding);
    pointer-events: none;
}

.changes-panel .css-property-line.added::before {
    content: "+";
    position: absolute;
    left: var(--css-declaration-horizontal-padding);
    pointer-events: none;
}
