/* ============================================
   Context Menu - Modern UI/UX Styles
   ============================================ */

body.pc .contextMenuContainer{
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    margin: 0;
    position: fixed;
    overflow: visible;
    outline: none;
    min-width: 180px;
    
    /* Entrance animation */
    animation: contextMenuFadeIn 0.15s ease-out;
    transform-origin: top left;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.contextMenuContainer::backdrop {
    background-color: transparent;
    cursor: default;
    backdrop-filter: blur(1px);
}

.contextMenuContainer .menuItems{
    margin: 0;
    padding: 0;
    list-style: none;
}

.contextMenuContainer .menuItems > li{
    color: #374151;
    padding: 8px 14px;
    padding-right: 28px;
    transition: background-color 0.12s ease, color 0.12s ease;
    position: relative;
    cursor: pointer;
    border: none;
    text-align: left;
    font-size: 13px;
    font-weight: 450;
    letter-spacing: 0.01em;

    display: flex;
    gap: 10px;
    align-items: center;

    /* First and last item border radius to match container */
    &:first-child {
        border-radius: 4px 4px 0 0;
    }
    &:last-child {
        border-radius: 0 0 4px 4px;
    }
    &:only-child {
        border-radius: 4px;
    }

    & .option_icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        flex-shrink: 0;
    }

    & .option_icon > svg{
        height: 17px;
        width: 17px;
        opacity: 0.7;
        transition: opacity 0.12s ease;
    }

    & .option_text {
        flex: 1;
        white-space: nowrap;
    }
}

.contextMenuContainer .menuItems > li:hover{
    background: #f3f4f6;
    color: #111827;

    & .option_icon > svg {
        opacity: 1;
    }
}

.contextMenuContainer .menuItems > li:active{
    background: #e5e7eb;
}

/* Focus state for keyboard navigation */
.contextMenuContainer .menuItems > li:focus{
    background: #f3f4f6;
    outline: none;
    /*box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.3);*/
}

/* Separator support - add class "separator" to li for a divider */
.contextMenuContainer .menuItems > li.separator{
    height: 1px;
    padding: 0;
    margin: 4px 10px;
    background: #e5e7eb;
    pointer-events: none;
    border-radius: 0;
}

/* Section header support - add class "section_header" */
.contextMenuContainer .menuItems > li.section_header{
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 14px 4px 14px;
    cursor: default;
    pointer-events: none;
}
.contextMenuContainer .menuItems > li.section_header:hover{
    background: transparent;
}

/* Danger option styling */
.contextMenuContainer .menuItems > li.danger_option{
    color: #dc2626;
}

.contextMenuContainer .menuItems > li.danger_option:hover{
    background: #fef2f2;
    color: #b91c1c;
}

.contextMenuContainer .menuItems > li.danger_option:active{
    background: #fee2e2;
}

.contextMenuContainer .menuItems > li.danger_option .option_icon > svg{
    color: #dc2626;
}

.contextMenuContainer .menuItems > li.danger_option:hover .option_icon > svg{
    color: #b91c1c;
    opacity: 1;
}

/* Disabled option styling */
.contextMenuContainer .menuItems > li.disabled_option{
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}
.contextMenuContainer .menuItems > li.disabled_option .option_icon > svg{
    opacity: 0.4;
}

/* Submenu arrow indicator - using Lucide chevron via ::after */
.contextMenuContainer .menuItems > li.hasSubMenu{
    padding-right: 32px;
}

.contextMenuContainer .menuItems > li.hasSubMenu:after{
    content: '';
    display: inline-block;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #9ca3af;
    transition: border-color 0.12s ease;
}

.contextMenuContainer .menuItems > li.hasSubMenu:hover:after{
    border-left-color: #6b7280;
}

/* Submenu styling - consistent with main menu */
.contextMenuContainer .subMenu{
    display: block;
    position: absolute;
    top: -5px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    min-width: 180px;
    padding: 4px 0;
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    
    /* Submenu entrance animation */
    animation: subMenuFadeIn 0.12s ease-out;
}

@keyframes subMenuFadeIn {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.contextMenuContainer .subMenu > li{
    color: #374151;
    padding: 8px 14px;
    background: #ffffff;
    transition: background-color 0.12s ease, color 0.12s ease;
    position: relative;
    cursor: pointer;
    border: none;
    font-size: 13px;
    font-weight: 450;

    display: flex;
    gap: 10px;
    align-items: center;

    &:first-child {
        border-radius: 4px 4px 0 0;
    }
    &:last-child {
        border-radius: 0 0 4px 4px;
    }

    & .option_icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        flex-shrink: 0;
    }

    & .option_icon > svg{
        height: 17px;
        width: 17px;
        opacity: 0.7;
        transition: opacity 0.12s ease;
    }
}

.contextMenuContainer .subMenu > li:hover{
    background: #f3f4f6;
    color: #111827;

    & .option_icon > svg {
        opacity: 1;
    }
}

.contextMenuContainer .subMenu > li:active{
    background: #e5e7eb;
}