@import "../../../GSMyAdmin/WebRoot/CSS/Colors";
@import "../../../GSMyAdmin/WebRoot/CSS/Sizes";
@import "../../../GSMyAdmin/WebRoot/CSS/Queries";

#tab_FileManagerPlugin_FileManager {
    overflow: initial;
    display: flex;
    flex-direction: column;
}

#TargetDirectoryList {
    height: 500px;
    overflow: auto;
    margin-bottom: 16px;
}

.ace_search {
    button {
        color: black;
        border-radius: 0;
        box-shadow: none;
        min-width: 0;
    }
}

#editorFileWarning {
    display: flex;
    flex-direction: row;
    align-items: center;
    grid-gap: 8px;
    background-color: @EditedAttention;
    padding: 4px 10px;

    &.canImport {
        background-color: @panelActive;
    }
}

#fileManagerHeader {
    z-index: 10;
    overflow: hidden;
}

.fmPathSegment {
    display: inline-block;
    cursor: pointer;
    font-size: 12pt;
    background-color: @panelsBack;
    padding-left: 20px;
    line-height: 32px;
    margin-left: -4px;

    &#editorFilename {
        pointer-events: none;
        display: none;
        background-color: @ItemSelected;
        color: white;

        &::after {
            border-left-color: @ItemSelected;
        }

        &.dirty {
            background-color: @EditedAttention;
            color: white;
        }

        &.dirty::after {
            border-left-color: @EditedAttention
        }
    }

    &::after {
        width: 0;
        height: 0;
        border-top: 16px solid transparent;
        border-bottom: 16px solid transparent;
        border-left: 10px solid @panelsBack;
        content: ' ';
        display: inline-block;
        float: right;
        position: relative;
        left: 10px;
    }

    &:nth-child(even) {
        background-color: @panelsBack + 15%;
    }

    &:nth-child(even)::after {
        border-left-color: @panelsBack + 15%;
    }

    &:hover {
        background-color: @accent;
    }

    &:hover::after {
        border-left-color: @accent;
    }

    &:active {
        background-color: @panelsBack;
    }

    &:active::after {
        border-left-color: @panelsBack;
    }

    &.disabled {
        cursor: default;
        background-color: dimgray;

        &::after {
            border-left-color: dimgray;
        }

        &:nth-child(even) {
            background-color: #444;
        }

        &:nth-child(even)::after {
            border-left-color: #444;
        }

        &:hover {
            background-color: dimgray;
        }

        &:hover::after {
            border-left-color: dimgray;
        }

        &:active {
            background-color: dimgray;
        }

        &:active::after {
            border-left-color: dimgray;
        }
    }
}

#fileManagerList {
    top: 32px;

    &.standard, &.compact {
        &:nth-child(even) {
            background-color: @hintWhite;
        }
    }

    &.compact {
        .fileManagerEntry {
            display: flex;

            .mat-icon {
                font-size: 18px;
                padding: 0;
            }

            .subIcon {
                display: none;
            }

            .fileEntryTitle {
                display: inline-block;
                margin-left: 6px;
                flex-grow: 1;
            }

            .fileEntrySubtitle {
                display: inline-block;
                margin-right: 16px;

                .subModified {
                    display: none;
                }
            }

            .fileEntryKebab {
                font-size: initial;
            }
        }
    }

    &.gridView {
        grid-template-columns: repeat(auto-fill, minmax(320px, 2fr));
        display: grid;
        align-content: start;

        .fileManagerEntry {
            border-bottom: none;
            height: 50px;
        }
    }
}

.fileManagerEntry {
    border-bottom: 1px solid @semiWhite;
    padding: 4px;
    cursor: pointer;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    position: relative;

    .iconContainer {
        position: relative;
        float: left;
        margin-right: @halfMargin;
    }

    .mat-icon {
        font-size: 32px;
        padding: 2px;
    }

    .subIcon {
        position: absolute;
        bottom: 7px;
        right: 8px;
        font-size: 16px;

        &.folder {
            bottom: 9px;
        }
    }

    div {
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .fileEntryKebab {
        font-size: 21pt;
        margin: 1px 0 0 4px;
        padding: 0;
        position: absolute;
        top: 4px;
        right: 0px;
    }

    &:hover {
        background: @panelHover;
    }

    &:active {
        background: @panelActive;
    }

    .fileEntrySubtitle {
        font-size: 10pt;
        color: @subtitleText;
    }

    &.selected {
        background-color: @ItemSelected;
    }
}

#fileManagerInfo {
    top: 32px;

    .mat-icon {
        float: left;
        margin: 12px 8px 0px 8px;
    }

    h3 {
        margin-top: 10px;
        line-break: anywhere;
    }

    th {
        padding-left: 8px;
    }

    td {
        padding-right: 8px;
    }
}


#editorFilenameChanges {
    display: none;
    background-color: @EditedAttention;
    color: white;
    border-radius: 8px;
    padding: 2px 4px 2px 4px;
    margin-left: 16px;
    font-size: 10pt;
    margin-top: 6px;
}

#editorButtons {
    position: absolute;
    top: 0px;
    right: 0px;
    display: none;

    button {
        margin-right: 0;
        float: right;
        box-shadow: none;
        border-radius: 0;
    }
}

#fmDisplaySwitcher {
    float: right;
}

#editorContainer {
    display: none;
    flex-grow: 1;

    #editor {
        height: 100%;
    }
}

.uploadArrow, .uploadOK, .uploadFail {
    font-size: 50pt;
    height: 64px;
    width: 64px;
    text-align: center;
}

.uploadOK {
    color: #00ee00;
}

.uploadFail {
    color: #ee0000;
}

.uploadArrow {
    transform: rotate(-90deg) translate(-4px,-14px);
    animation-duration: 0.5s;
    animation-name: bounce;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.uploadAnim {
    border-top: 4px solid white;
    height: 66px;
    width: 66px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 32px;
}

@keyframes bounce {
    from {
        transform: rotate(-90deg) translate(-4px,-14px);
    }

    to {
        transform: rotate(-90deg) translate(-18px,-14px);
    }
}

#fileManagerDropNotice {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #555;
    width: 50%;
    height: 256px;
    text-align: center;
    box-shadow: @darkSemiBlack 0px 8px 8px;
    pointer-events: none;
}
