// Menu for new file and directory
.menubar{
    font-size: 15px;
    line-height: 15px;
    height: 15px;
    margin-top: 5px;
    color: var(--light);
    margin: 5px 0 10px 0;

    > div, > span{cursor: pointer; margin-right: 15px;}
    .view{
        float: right;
        padding: 2px;
        transition: 0.15s ease-out background;
        margin-right: 0px;
        margin-left: 0px;
        &.list-grid, > .dropdown_button, > label > img{
            min-width: inherit;
            border-radius: 2px;
            padding: 5px;
            margin: 2px 0 2px 0;
            &:hover, &:focus{
                background: white;
                border-color: var(--bg-color);
                box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
            }
        }
        &.active > .dropdown_button{
            background: white;
            border-color: var(--bg-color);
            box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
        }
        .dropdown_container .component_icon{
            box-sizing: border-box;
            border: 2px solid rgba(0,0,0,0);
        }
        &.list-grid{margin-top: -5px!important;}
        &.component_dropdown { margin-top: -10px; }
    }
    .search{
        float: right;
        margin-right: 0;
        label{
            margin-top: -5px;
            display: block;
            img{
                padding: 5px;
                vertical-align: bottom;
                &:hover, &:focus{
                    background: white;
                    border-color: var(--bg-color);
                    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
                }
            }
            input{
                border: none;
                float: left;
                font-size: 1em;
            }
        }
    }
    .component_icon{
        height: 15px;
        width: 15px;
    }
}

.component_thing{
    clear: both;
    &:hover .box, .highlight.box{
        background: var(--super-light);
        border-color: var(--super-light);
    }
    &:hover .box:not(.loading){
        .component_datetime{display: none;}
        .component_action{display: block;}
    }
    .component_action{display: none;}


    .file-is-hover{
        background: var(--emphasis-primary);
    }
    .file-is-dragging{
        opacity: 0.15;
    }


    .file-details{
        padding: 0 5px;
        line-height: 22px;
        white-space: nowrap;
        > span{
            display: inline-block;
            width: calc(100% - 130px);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            vertical-align: bottom;
            color: inherit;
        }
    }
    form{
        display: inline-block;
        input{
            font-size: 1em;
            border-width: 0px;
            padding: 0 2px 0 2px;
            background: inherit;
            border-bottom: 2px solid var(--emphasis-primary);
            color: var(--color);
        }
    }

    .component_icon{
        width: 25px;
        height: 25px;
    }

    .component_filesize{
        span{
            color: var(--light);
            font-size: 0.85em;
        }
    }

    .component_message{
        color: var(--light);
        font-size: 0.9em;
        padding-left: 10px;
    }

    .component_datetime{
        float: right;
        color: var(--light);
        line-height: 25px;
        margin: 0 -10px;
        padding: 0 10px;
        position: relative;
    }

    .component_action{
        float: right;
        color: #6f6f6f;
        line-height: 25px;
        margin: 0 -10px;
        padding: 0 10px;
        position: relative;
        .component_icon{
            padding: 1px 0;
            box-sizing: border-box;
        }
    }

}


/* GRID & LIST VIEW */
.list > span{
    display: flex;
    flex-wrap: wrap;
    > .component_thing{
        width: 100%;
        .box{margin: 0px 0 2px 0;}
    }

    // GRID VIEW
    > .component_thing.view-grid{
        width: 25%; .box{ height: 160px;}
        @media (max-width: 800px){width: 33.33%; .box{height: 200px} }
        @media (max-width: 670px){.box{height: 170px}}
        @media (max-width: 550px){width: 50%; .box{height: 200px} }
        @media (max-width: 480px){.box{height: 170px}}
        @media (max-width: 400px){.box{height: 140px; .info_extension{font-size: 0.85em; padding: 3px 10px;}}}
        @media (max-width: 340px){.box{height: 130px}}
        text-align: center;
        .box{
            margin: 2px;
            padding: 0;
            position: relative;
            > span > img{
                padding: 0;
                margin: 0;
                display: block;
            }
            > span > img.component_icon{
                padding: 30px;
                box-sizing: border-box;
                width: auto;
                height: 100%;
                margin: 0 auto;
                z-index: 0;
            }
            > span > img.thumbnail{
                width: 100%;
                height: 100%;
                object-fit: cover;
                object-position: 50% 50%;
                background: var(--dark);
                z-index: 0;
            }
            .info_extension{
                position: absolute;
                top: 50%;
                text-align: right;
                left: 0; right: 20%;
                margin: 0 auto;
                span{
                    background: var(--color);
                    color: var(--bg-color);
                    border-radius: 4px;
                    padding: 4px 12px;
                }
            }
            .component_filename{
                letter-spacing: -0.5px;
                z-index: 2;
                position: absolute;
                bottom: 2px;
                left: 2px;
                right: 2px;
                border-radius: 2px;
                padding: 3px 0px;
                .file-details{
                    width: calc(100% - 10px);
                    display: block;
                    > span{
                        width: 100%;
                        form input{
                            letter-spacing: -0.5px;
                            text-align: center;
                            width: 100%;
                            padding: 0;
                        }
                    }
                }
            }
            .image_layer{
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 1;
                background: rgba(0,0,0,0);
                transition: 0.2s ease-out background;
            }
            &:hover{
                .component_action{
                    transition-delay: 0.1s;
                    opacity: 1;
                    transform: translateX(0);
                }
                img.thumbnail{
                    transform: scale(0.6);
                }
                .image_layer{
                    background: rgba(242, 242, 242, 0.7);
                }
            }
            &.preview{
                &:hover{
                    .component_filename{
                        opacity: 1;
                    }
                }
                .component_filename{
                    transition: 0.2s ease-out opacity;
                    opacity: 0;
                }
            }
            .component_filesize, .component_datetime{ display: none; }
            .component_action{
                opacity: 0;
                transform: translateX(5px);
                transition: 0.15s ease-out all;
                z-index: 2;
                display: block;
                position: absolute;
                top: 5px;
                right: 5px;
                border-radius: 5px;
                margin-right: 0px;
                padding: 0px;
            }
            img.thumbnail{transition: 0.2s ease-out transform;}
        }
    }
}
