/*
 * Copyright (C) 2013 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.timeline > .navigation-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.sidebar > .panel.timeline > .title-bar {
    position: absolute;
    left: 0;
    right: 0;

    height: 22px;

    border-bottom: 1px solid rgb(179, 179, 179);
    background-image: -webkit-linear-gradient(top, rgb(238, 240, 244), rgb(224, 226, 230));

    color: rgb(57, 57, 57);
    text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    font-size: 10px;
    font-family: "Lucida Grande", sans-serif;
    font-weight: bold;

    padding: 4px 6px;

    white-space: nowrap;
    overflow: hidden;
}

.sidebar > .panel.timeline > .title-bar.timelines {
    top: 22px;
}

.sidebar > .panel.timeline > .title-bar.timeline-events {
    height: 23px;
    border-top: 1px solid rgb(179, 179, 179);
    top: 152px;
}

.sidebar > .panel.timeline > .timelines-content {
    position: absolute;
    top: 44px;
    height: 108px;
    left: 0;
    right: 0;

    overflow: hidden;
}

.sidebar > .panel.timeline > .timelines-content .close-button {
    margin-top: 2px;
    width: 12px;
    height: 12px;

    content: -webkit-image-set(url(Images/CloseTimeline.png) 1x, url(Images/CloseTimeline@2x.png) 2x);

    visibility: hidden;
}

.sidebar > .panel.timeline > .timelines-content li.item .icon {
    width: 24px;
    height: 24px;
    margin-top: 5px;
}

.sidebar > .panel.timeline > .timelines-content li.item.selected .close-button {
    visibility: visible;
}

.sidebar > .panel.timeline > .timelines-content li.item:not(.selected):nth-child(even) {
    background-color: rgba(0, 0, 0, 0.03);
    background-clip: padding-box;
}

.sidebar > .panel.timeline > .timelines-content li.item:not(.selected):not(:first-child) {
    border-top: 1px solid rgba(0, 0, 0, 0.09);
}

.sidebar > .panel.timeline > .timelines-content li.item.selected + li.item {
    border-top-color: rgb(120, 139, 168);
}

.sidebar > .panel.timeline > .timelines-content :focus li.item.selected + li.item {
    border-top-color: rgb(107, 130, 164);
}

.sidebar > .panel.timeline > .timelines-content .close-button:active {
    opacity: 0.8;
}

.sidebar > .panel.timeline > .content {
    top: 175px;
}

.sidebar > .panel.timeline.timeline-content-view-showing > .content {
 /* This hides the scrollbar. The view shows a scrollbar, we don't need two. */
    padding-right: 16px;
    right: -16px;
}

.sidebar > .panel.timeline > .content > .stripe-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100%;

    background-image: -webkit-linear-gradient(top, transparent, transparent 50%, rgba(0, 0, 0, 0.03) 50%, rgba(0, 0, 0, 0.03));
    background-size: 100% 40px;

    pointer-events: none;
    display: none;
}

.sidebar > .panel.timeline.timeline-content-view-showing > .content > .stripe-background {
    display: block;
}
