/*
 * SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";

.contextmenu_main() {
    --LessLoader_require: LessLoader_currentFile();
};
& {
    .cp-contextmenu {
        display: none;
        position: absolute !important;
        z-index: 50000;
        & > ul {
            border: 1px solid @cp_context-border;
            background-color: @cp_context-bg;
            border-radius: @variables_radius;
            .dropdown-divider {
                border-top: 1px solid @cp_context-border;
            }
        }
        .dropdown-menu {
            padding: 6px 0px;
        }
        li {
            padding: 0;
            font-size: @colortheme_app-font-size;
            &.dropdown-submenu {
                position: relative;
                &> a {
                    cursor: default;
                    // reset bootstrap active style
                    &:active {
                        background: inherit;
                        color: inherit;
                    }
                }
                .dropdown-toggle {
                    transform: rotate(270deg);
                    margin-left: 1rem;
                    float: right;
                }
                .dropdown-menu {
                    top: -0.7rem;
                    left: 100%;
                    background-color: @cp_context-bg;
                    border-radius: @variables_radius;
                    border: 1px solid @cp_context-border;
                }
            }
            a {
                cursor: pointer;
                color: @cp_context-fg;
                padding-left: 10px;
                border-radius: @variables_radius;
                &:hover {
                    background-color: @cp_context-bg-hover;
                    color: @cp_context-fg;
                }
                &:active {
                    background-color: @cp_context-bg-active;
                    color: @cp_context-fg;
                }
                .fa, .cptools {
                    &:first-child {
                        margin-right: 10px;
                    }
                    &.cptools:not(:first-child) {
                        vertical-align: middle;
                    }
                    color: @cp_context-icon;
                    width: 16px;
                }
                &.cp-app-disabled {
                    cursor: not-allowed !important;
                    opacity: 0.5;
                }
            }
        }
        .cp-app-drive-context-noAction {
            font-style: italic;
            color: @cp_context-disabled;
            cursor: default;
            display: none;
        }
    }
}
