//
// Workspace Preview
// =================
//

//
// Variables
//
$workspace-topbar-height: 50px;
$workspace-topbar-color: #fff;
$workspace-topbar-line-height: 26px;
$workspace-topbar-bg: #333;
$workspace-topbar-logo-height: 22px;
$workspace-topbar-logo-width: 22px;

//
// General Styling
//
.module {
    overflow: hidden;
}

.module-body {
    padding: 0;
    font-size: 11px;
}

#typo3-topbar {
    color: $workspace-topbar-color;
    background-color: $workspace-topbar-bg;
    min-height: $workspace-topbar-height;
    padding-left: 1em;
    padding-right: 1em;

    &:after {
        clear: both;
        display: table;
        content: '';
    }
}

.typo3-topbar-container {
    position: relative;
    height: 100%;
}

.typo3-topbar-site,
.typo3-topbar-tabs,
.typo3-topbar-workspace-actions,
.workspace-action {
    margin-top: ceil(($workspace-topbar-height - $workspace-topbar-line-height) / 2);
    margin-bottom: ceil(($workspace-topbar-height - $workspace-topbar-line-height) / 2);
}

.typo3-topbar-site {
    line-height: $workspace-topbar-line-height;
    float: left;
    font-size: 12px;
    position: relative;
    margin-right: 2em;
}

.typo3-topbar-site-logo {
    padding-top: 1px;
    padding-right: 0.25em;
    display: inline-block;
    vertical-align: top;

    img {
        display: block;
        height: $workspace-topbar-logo-height;
        width: $workspace-topbar-logo-width;
    }
}

.typo3-topbar-site-name {
    vertical-align: top;
}

.typo3-topbar-tabs {
    margin-right: 2em;
    float: left;
    position: relative;

    .nav-tabs {
        overflow: hidden;
        border-radius: 2px;
        border: none;
        background: none;

        > li {
            + li {
                margin-left: 0;
                border-left: 1px solid rgba(0, 0, 0, 0.5);
            }

            margin-bottom: 0;

            &.active > a {
                background-color: #fff;
            }

            > a {
                padding-top: 0;
                padding-bottom: 0;
                line-height: $workspace-topbar-line-height;
                background-color: #ccc;
                border: none !important;
                border-radius: 0;
            }
        }
    }
}

.typo3-topbar-workspace-actions {
    clear: none;
    float: left;

    .workspace-action {
        margin-top: 0;
        margin-bottom: 0;
        float: left;
        margin-right: 2em;
    }
}

@media (max-width: 920px) {
    .typo3-topbar-workspace-actions {
        clear: left;
        margin-top: 0;

        .workspace-action {
            display: block;
            float: none;
            margin-right: 0;
            height: auto;
            margin-bottom: 0.75em;

            &:after {
                content: '';
                display: table;
            }
        }

        .dropdown-menu-right {
            right: auto;
            left: 0;
        }

        .btn {
            margin-top: 1px;
        }
    }
}

.workspace-action {
    height: $workspace-topbar-height - ceil($workspace-topbar-height - $workspace-topbar-line-height);
    display: block;
    line-height: $workspace-topbar-line-height;

    &:after {
        content: '';
        clear: both;
        display: table;
    }

    .active-preview-mode {
        display: inline-block;
        text-align: left;
    }

    .btn-group {
        vertical-align: top;
    }

    .btn-sm {
        vertical-align: top;
        line-height: $workspace-topbar-line-height;
        padding: 0 0.5em;
        border: none !important;
    }

    .slider-wrapper {
        display: block;

        .slider {
            float: left;
        }

        .slider-horizontal {
            margin-left: 1.5em;
            margin-right: 1.5em;
            height: $workspace-topbar-line-height;
        }

        span {
            display: block;
            float: left;
        }
    }
}

.workspaces {
    position: relative;

    iframe {
        border: 0;
    }
}

.preview-mode- {
    &slider {
        iframe {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 100;
            width: 100%;
            height: calc(#{"100vh -"} #{$workspace-topbar-height});
        }

        #live-view {
            border-bottom: 2px solid #c83c3c;
            z-index: 200;
        }
    }

    &vbox iframe {
        width: 50%;
        height: 100%;
        float: left;
    }

    &hbox iframe {
        width: 100%;
        height: 50%;
    }
}

#list iframe {
    height: calc(#{"100vh -"} #{$workspace-topbar-height}) !important;
    width: 100%;
}
