.time-machine {
    display: flex;
    flex-direction: column;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    position: absolute;
    z-index: @modalFullscreenZIndex + 1;
    background-color: var(--pxt-neutral-background1);
    color: var(--pxt-neutral-foreground1);
}

.time-machine-header {
    height: @mainMenuHeight;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    background-color: var(--pxt-colors-teal-background);
    color: var(--pxt-colors-teal-foreground);
    flex-shrink: 0;

    .common-button {
        min-width: 9rem;
    }

    .common-button.menu-button {
        .common-button-label {
            font-size: 16px;
        }

        i.fas {
            font-size: 1em;
        }
    }
}

.time-machine-actions-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-machine-actions {
    display: flex;
    flex-direction: row;
    align-items: center;

    .time-machine-label {
        color: var(--pxt-colors-teal-foreground);
        margin-right: 1rem;
        text-wrap: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
}

.time-machine-content {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
}

.time-machine-preview {
    position: relative;
    flex-grow: 1;
    overflow: hidden;

    & > iframe {
        position: relative;
        height: 100%;
        width: 100%;
        transition: opacity 0.25s;
        z-index: 1;
    }

    // Loading div that appears while projects are importing
    & > div {
        position: absolute;
        top: 0;
        background: var(--pxt-primary-background);
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        width: 100%;

        .common-spinner {
            width: 5rem;
            height: 5rem;
        }
    }
}

.time-machine-timeline {
    width: 20rem;
    height: 100%;
    position: relative;

    border-left: solid 2px var(--pxt-target-stencil3);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    .time-machine-timeline-slider {
        flex-grow: 1;
    }

    .common-treeitem {
        border-left: solid 2px var(--pxt-neutral-background1);
        user-select: none;
    }

    .common-treeitem.selected {
        border-left: solid 2px var(--pxt-primary-background);
        filter: grayscale(.15) brightness(.85) contrast(1.3);
    }

    .time-machine-tree-container {
        flex-grow: 1;
        overflow-y: auto;
        padding-right: 1rem;
        padding-left: 1rem;
        padding-bottom: 1rem;
    }

    h3 {
        padding-right: 1rem;
        padding-left: 1rem;
        padding-top: 1rem;
        flex-shrink: 0;
    }
}

@media @tabletAndBelow {
    .time-machine-header {
        display: flex;
        flex-direction: row;

        .time-machine-back-button {
            flex-grow: 1;
            flex-shrink: 0;
        }
    }

    .time-machine-timeline {
        width: 15rem;
    }
}

@media @mobileAndBelow {
    .time-machine-header {
        height: @mobileMenuHeight;
    }
}
