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

.timeline-view.memory {
    overflow: scroll;
}

.timeline-view.memory > .content {
    width: 970px;
    margin: 10px auto;
}

.timeline-view.memory > .content > .overview {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-view.memory > .content .subtitle {
    font-family: '-webkit-system-font';
    font-size: 14px;
}

.timeline-view.memory > .content > .details {
    position: relative;
}

.timeline-view.memory > .content > .details > .timeline-ruler {
    position: absolute;
    top: 5px;
    bottom: 0;
    right: 0;
    left: 0;

    --memory-timeline-view-details-timeline-ruler-offset-start: 150px;
}

body[dir=ltr] .timeline-view.memory > .content > .details > .timeline-ruler {
    left: var(--memory-timeline-view-details-timeline-ruler-offset-start);
}

body[dir=rtl] .timeline-view.memory > .content > .details > .timeline-ruler {
    right: var(--memory-timeline-view-details-timeline-ruler-offset-start);
}

.timeline-view.memory > .content > .details > .subtitle {
    padding: 0 10px 10px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-view.memory > .content > .overview {
    display: flex;
    justify-content: center;
}

.timeline-view.memory > .content > .overview > .chart {
    width: 420px;
    text-align: center;
}

.timeline-view.memory > .content > .overview > .chart > .subtitle {
    margin-bottom: 1em;
}

.timeline-view.memory > .content > .overview > .chart > .container {
    display: flex;
    justify-content: center;
}

.timeline-view.memory > .content > .overview > .divider {
    margin-left: 10px;
    margin-right: 10px;

    --memory-timeline-view-overview-divider-border-end: 1px solid var(--border-color);
}

body[dir=ltr] .timeline-view.memory > .content > .overview > .divider {
    border-right: var(--memory-timeline-view-overview-divider-border-end);
}

body[dir=rtl] .timeline-view.memory > .content > .overview > .divider {
    border-left: var(--memory-timeline-view-overview-divider-border-end);
}

.timeline-view.memory > .content > .overview .total-usage,
.timeline-view.memory > .content > .overview .max-percentage {
    margin: auto;
    color: hsl(0, 0%, 70%);
}

.timeline-view.memory .legend {
    text-align: start;

    --memory-timeline-view-legent-padding-start: 20px;
}

body[dir=ltr] .timeline-view.memory .legend {
    padding-left: var(--memory-timeline-view-legent-padding-start);
}

body[dir=rtl] .timeline-view.memory .legend {
    padding-right: var(--memory-timeline-view-legent-padding-start);
}

.timeline-view.memory .legend > .row {
    position: relative;
    width: 100px;
    height: 27px;

    --memory-timeline-view-legend-row-offset-start: 20px;
}

.timeline-view.memory .legend > .row > .swatch {
    position: absolute;
    top: 1px;
    width: 1em;
    height: 1em;
}

body[dir=ltr] .timeline-view.memory .legend > .row > .swatch {
    left: 0;
}

body[dir=rtl] .timeline-view.memory .legend > .row > .swatch {
    right: 0;
}

.timeline-view.memory .legend > .row > p {
    margin: 0;
}

body[dir=ltr] .timeline-view.memory .legend > .row > :matches(.label, .size) {
    left: var(--memory-timeline-view-legend-row-offset-start);
}

body[dir=rtl] .timeline-view.memory .legend > .row > :matches(.label, .size) {
    right: var(--memory-timeline-view-legend-row-offset-start);
}

.timeline-view.memory .legend > .row > .label {
    position: absolute;
    top: 0;
}

.timeline-view.memory .legend > .row > .size {
    position: absolute;
    top: 12px;
    color: hsl(0, 0%, 70%);
}

.timeline-view.memory .legend > .row > .swatch.javascript {
    border: 1px solid var(--memory-javascript-stroke-color);
    background: var(--memory-javascript-fill-color);
}

.timeline-view.memory .legend > .row > .swatch.images {
    border: 1px solid var(--memory-images-stroke-color);
    background: var(--memory-images-fill-color);
}

.timeline-view.memory .legend > .row > .swatch.layers {
    border: 1px solid var(--memory-layers-stroke-color);
    background: var(--memory-layers-fill-color);
}

.timeline-view.memory .legend > .row > .swatch.page {
    border: 1px solid var(--memory-page-stroke-color);
    background: var(--memory-page-fill-color);
}


.timeline-view.memory .circle-chart > svg > path.javascript,
.memory-category-view.javascript .line-chart > svg > path {
    stroke: var(--memory-javascript-stroke-color);
    fill: var(--memory-javascript-fill-color);
}

.timeline-view.memory .circle-chart > svg > path.images,
.memory-category-view.images .line-chart > svg > path {
    stroke: var(--memory-images-stroke-color);
    fill: var(--memory-images-fill-color);
}

.timeline-view.memory .circle-chart > svg > path.layers,
.memory-category-view.layers .line-chart > svg > path {
    stroke: var(--memory-layers-stroke-color);
    fill: var(--memory-layers-fill-color);
}

.timeline-view.memory .circle-chart > svg > path.page,
.memory-category-view.page .line-chart > svg > path {
    stroke: var(--memory-page-stroke-color);
    fill: var(--memory-page-fill-color);
}

.timeline-view.memory .legend > .row > .swatch.current {
    border: 1px solid var(--memory-max-comparison-stroke-color);
    background: var(--memory-max-comparison-fill-color);
}

.timeline-view.memory .circle-chart > svg > path.current {
    stroke: var(--memory-max-comparison-stroke-color);
    fill: var(--memory-max-comparison-fill-color);
}

.timeline-view.memory .circle-chart > svg > path.remainder {
    stroke: none;
    fill: none;
}
