@import 'inc/bootstrap';

/* tooltip */
.resourcemgr {

    $activeColor:  whiten($uiClickableHoverBg, 0.9);
    $rmBrowserWidth: 260;
    $rmPreviewWidth: 300;
    $rmMaxContainerWidth: 1400;
    $rmSideMargin: 40;

    width: 90%;
    height: 100%;
    max-width: $rmMaxContainerWidth * 1px;

    #mediaManager &.modal {
        max-height: 700px;
        top: 40px !important;
        bottom: 40px;
        padding: 0;
    }

    & > h2 {
        @include font-size(15);
        margin: 20px 40px 10px;
        height: 40px;
    }

    .file-wrapper {
        overflow-y: auto;
        margin: 0 #{$rmSideMargin * 1px};
        height: calc(100% - 40px - 40px - 40px); // full height - h2.padding - h2.height - modal.bottom-padding
        @include flex-container();
    }

    .file-browser {
        @include simple-flex-box($rmBrowserWidth * 1px);
    }

    .file-preview {
        @include simple-flex-box($rmPreviewWidth * 1px);
    }

    .file-selector {
        @include simple-flex-box(auto);
        max-width: calc(100% - #{($rmBrowserWidth + $rmPreviewWidth) *1px});
    }

   .file-browser, .file-selector, .file-preview {
        position: relative;
        vertical-align: top;
        height: 100% !important;
        color: $textColor;

        h1 {
            @include font-size(16);
            line-height: 1.6;

            color: $textColor;
            margin-top: 1px;
            padding: 5px;
        }
        h2 {
            @include font-size(13);
            line-height: 1.3;
            background-color: $uiHeaderBg;
            color: $textColor;
            margin-top: 1px;
            padding: 6px;
            position: relative;
            clear: both;

            &.toggler{
                cursor: pointer;
                &:after{
                    position: absolute;
                    right: 15px;
                    top: 3px;
                }
            }
        }
    }

    .file-browser{
        background-color: $uiClickableDefaultBg;
        & > h1 {
            background-color: $uiHeaderBg;
        }

        & .file-browser-wrapper {
            overflow: auto;
            height: calc(100% - 50px);
        }

        ul {
            list-style-type: none;
            padding-left: 5px;
            ul {
                padding-left: 18px;
            }
            li {
                a {
                    color: $textColor;
                    white-space: nowrap;
                    &:before {
                        @include tao-icon-setup;
                        @include icon-folder;
                        margin: 0 3px;
                    }
                }

                a.opened:before {
                    font-style: italic;
                    @include tao-icon-setup;
                    @include icon-folder-open;
                }

                &.active > a {
                    background-color: $activeColor;

                }
            }
        }
    }

    .file-preview{
        background-color: $uiClickableDefaultBg;
        & > h1 {
            background-color: $uiHeaderBg;
        }

        .file-properties{
            padding: 0 5px;
        }

        .previewer {
            height: 300px;
            overflow: hidden;
        }

        .actions {
            text-align: center;
            margin-bottom: 10px;
        }
    }

    .file-selector{
        position: relative;
        border: solid 1px #fff;
        border-top: none;
        border-bottom: none;
        display: flex;
        flex-direction: column;

        background-color: $uiGeneralContentBg;
        & > h1 {
            position: relative;
            background-color: $uiClickableDefaultBg;

            .title {
                margin-right: 10px;
            }

            .upload-switcher {
                a {
                    display: inline-block;
                }
                .listing {
                    display:none;
                }
            }
        }

        .empty {
            color: #666;
            font-style: italic;
            @include font-size(18);
            text-align: center;
        }

        ul.files {
            position: relative;
            margin-bottom: 0;
            padding: 0;
            list-style-type: none;
            flex-grow: 1;
            overflow-y: auto;
            li {
                height: 35px;
                line-height: 35px;
                margin-bottom: 0;
                padding: 0 0 0 5px;
                position: relative;

                &:before {
                    @include tao-icon-setup;
                    @include icon-document;
                    @include font-size(16);
                    vertical-align: top;
                    line-height: 2.2;
                    position: absolute;
                    left: 8px;
                }
                &[data-type='image']:before{
                    @include icon-image;
                }
                &[data-type='audio']:before{
                    @include icon-media;
                }
                &[data-type='video']:before{
                    @include icon-video;
                }

                &.active, &:hover {
                    background-color: $activeColor;
                    cursor: pointer;
                }

                .desc {
                    display: inline-block;
                    max-width: calc(100% - 130px);// 130 = icon left + toolbar right + some air
                    margin-left: 25px;
                }

                .actions {
                    top: 0;
                    right: 0;
                    position: absolute;
                    height: 35px;
                    width: 100px;
                    .tlb {
                        display: inline-block;
                        background: none;
                        @include font-size(14);
                        .tlb-top {
                            background: none !important;
                            border-width: 0 !important;
                            @include box-shadow(0, 0, 0);
                        }
                    }
                }
            }
        }
        .file-upload-container {
            display: none;
            padding: 0 5px;
        }
        .pagination-bottom {  
            align-self: flex-end;
            width: 100%;
            padding: 5px 10px 0;
        }
    }
}
