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

.log-scope-bar > li.unread::before {
    content: '';
    display: inline-block;
    vertical-align: baseline;

    margin-left: -10px;
    margin-right: 2px;
    width: 8px;
    height: 8px;

    -webkit-clip-path: circle(50% at 50% 50%);
    animation: unread-background-pulse 1.5s ease-in-out infinite alternate-reverse;

    --unread-indicator-margin-start: -10px;
    --unread-indicator-margin-end: 2px;
}

body[dir=ltr] .log-scope-bar > li.unread::before {
    margin-left: var(--unread-indicator-margin-start);
    margin-right: var(--unread-indicator-margin-end);
}

body[dir=rtl] .log-scope-bar > li.unread::before {
    margin-left: var(--unread-indicator-margin-end);
    margin-right: var(--unread-indicator-margin-start);
}

.log-scope-bar > li.unread:hover::before {
    visibility: hidden;
}

.log-scope-bar > li.unread.errors::before {
    background-color: hsl(0, 95%, 72%);
}

.log-scope-bar > li.unread.warnings::before {
    background-color: hsl(48, 98%, 51%);
}

.log-scope-bar > li.unread.logs::before {
    background-color: hsl(213, 92%, 77%);
}

@keyframes unread-background-pulse {
    from { background-color: transparent; }
}

.content-view.log {
    overflow-y: auto;
    overflow-x: hidden;
}

.console-messages {
    display: flex;
    flex-direction: column;

    word-wrap: break-word;

    font-family: -apple-system, sans-serif;
    font-size: 12px;

    min-height: 100%;

    outline: none;
}

.console-messages > :first-child {
    margin-top: auto;
}

.console-item {
    border-top: 1px solid hsl(0, 0%, 94%);
}

.console-error-level:not(.filtered-out, .filtered-out-by-search),
.console-error-level:not(.filtered-out, .filtered-out-by-search) + .console-item {
    border-top-color: hsl(0, 100%, 92%);
}

.console-warning-level:not(.filtered-out, .filtered-out-by-search),
.console-warning-level:not(.filtered-out, .filtered-out-by-search) + .console-item {
    border-top-color: hsl(40, 100%, 90%);
}

.console-item::before {
    position: absolute;
    left: 4px;
    height: 12px;
    width: 12px;
}

.console-item.selected::after {
    position: absolute;
    display: block;
    content: "";
    left: 0;
    top: -1px;
    bottom: 0;
    background: hsl(0, 0%, 60%);
    width: 2px;
    z-index: 10;
}

.console-messages:focus .console-item.selected .data-grid tr.selected {
    background-color: hsl(210, 90%, 90%) !important;
}

.console-item .data-grid tr.selected {
    background-color: hsl(210, 0%, 90%) !important;
}

.console-messages:focus .console-item.selected {
    background-color: hsl(210, 98%, 96%);
    border-color: hsl(210, 90%, 93%);
}

.console-messages:focus .console-item.selected + .console-item {
    border-top-color: hsl(210, 90%, 93%);
}

.console-messages:focus .console-item.selected::after {
    background: hsl(210, 100%, 49%);
}

.console-messages:focus .console-item.selected .go-to-link {
    color: hsl(210, 100%, 33%);
}

.console-group-title {
    font-weight: bold;
}

.console-group-title::before {
    content: "";
    background-image: url(../Images/DisclosureTriangles.svg#open-normal);
    background-size: 13px 13px;
    top: 4px;
    left: 4px;
    width: 13px;
    height: 13px;
}

.console-group.collapsed .console-group-title::before {
    background-image: url(../Images/DisclosureTriangles.svg#closed-normal);
}

.console-group.collapsed > .console-group-messages {
    display: none;
}

.console-group {
    position: relative;
}

.console-session-header {
    text-align: center;
    padding: 6px 0;
}

.console-session:first-of-type .console-session-header {
    color: hsl(0, 0%, 60%);
}

.console-session:not(:first-of-type) {
    border-top: 0.5px dashed var(--border-color);
}

.console-session:not(:first-of-type) .console-session-header {
    color: hsl(0, 0%, 30%);
    background-color: hsl(0, 0%, 95%);
}

.console-messages a {
    color: hsl(0, 0%, 32%);
    cursor: pointer;
}

.console-messages a:hover {
    color: hsl(0, 0%, 14%);
}

.console-messages .data-grid {
    clear: both;
}

.console-item.filtered-out {
    display: none;
}

.search-in-progress .console-item.filtered-out-by-search {
    display: none;
}

.search-in-progress .console-item:not(.filtered-out-by-search) .highlighted {
    color: black;
    background-color: hsla(53, 83%, 53%, 0.2);
    border-bottom: 1px solid hsl(47, 82%, 60%);
}

.search-in-progress .console-item:not(.filtered-out-by-search) .highlighted.selected {
    background-color: hsla(53, 83%, 53%, 0.75);
}

.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-text .highlighted {
    color: var(--selected-foreground-color);
    background-color: var(--selected-background-color-highlight);

    border-bottom: none;
    text-decoration: underline;
}

.console-user-command::before,
.console-messages:focus .console-item.selected .console-user-command::before,
.console-user-command-result.console-log-level::before,
.console-messages:focus .console-item.selected .console-user-command-result.console-log-level::before {
        /* Accessible label alternative for icon indicating console input/output/warning/error, etc. */
        alt: attr(data-labelprefix);
}
