// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0

.view-preview {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
    align-items: center;
    justify-content: center;

    &.view-preview-markdown {
        align-items: start;
        justify-content: start;
        overflow: auto;

        .markdown .content {
            padding: 5px 15px 10px 15px;
        }
    }

    &.view-preview-text {
        align-items: start;
        justify-content: start;
        overflow: auto;

        pre {
            font: var(--fixed-font);
        }
    }

    &.view-preview-video,
    &.view-preview-audio {
        video,
        audio {
            width: 100%;
            height: 100%;
            padding: 10px;
            object-fit: contain;
        }
    }

    &.view-preview-image {
        position: relative;
        .tools {
            position: absolute;
            display: flex;
            flex-direction: row;
            z-index: 2;
            top: 0;
            right: 0;
            padding: 5px;
            gap: 4px;
            button {
                padding: 4px 5px;
            }
        }
        img {
            z-index: 1;
        }
        .react-transform-wrapper {
            height: 100%;
            width: 100%;
        }
    }
    &.view-preview-pdf {
        padding: 5px;
    }
}

.full-preview {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

.view-nav {
    display: flex;
    flex-shrink: 0;
    padding: 0.2rem 0 0.2rem 0;

    .view-nav-item {
        border-radius: 3px;
        padding: 0.2rem 0;

        &.clickable {
            cursor: pointer;

            &:hover {
                background-color: var(--highlight-bg-color);
            }
        }

        &.current-file {
            background-color: transparent;
            cursor: default;
            font-weight: bold;
        }
    }
}

.full-preview-content {
    flex-grow: 1;
    overflow: hidden;
}
