/* ── App Menu Bar (shared across apps) ── */
.gos-app-menubar {
    display: flex;
    background: #2b2b2b;
    border-bottom: 1px solid #3a3a3a;
    font-family: var(--font-family, 'Segoe UI', system-ui, sans-serif);
    font-size: 0.85rem;
    padding: 0 4px;
    height: 30px;
    align-items: center;
}

.gos-app-menu-item {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    cursor: pointer;
    position: relative;
    color: #eee;
    user-select: none;
}

.gos-app-menu-item:hover,
.gos-app-menu-item.kb-focus {
    background: #3f3f3f;
    color: #fff;
}

.gos-app-menu-item.active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}

.gos-app-menu-item.kb-focus {
    outline: none;
}

.gos-app-dropdown-item.kb-focus {
    background: #3f3f3f;
    color: #fff;
    outline: none;
}

.gos-app-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    background: #2b2b2b;
    border: 1px solid #444;
    box-shadow: var(--menu-shadow);
    z-index: 1000;
    display: none;
    min-width: 180px;
    padding: 2px;
    font-family: var(--font-family);
}

.gos-app-menu-item.active .gos-app-dropdown {
    display: block;
}

.gos-app-dropdown-item {
    padding: 6px 14px;
    white-space: nowrap;
    color: #eee;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.gos-app-dropdown-item:hover {
    background: #3f3f3f;
    color: #fff;
}

.gos-app-dropdown-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.gos-app-dropdown-item .shortcut {
    color: #888;
    font-size: 0.75rem;
    margin-left: 20px;
}

.gos-app-dropdown-item.danger {
    color: #f44336;
}

.gos-app-dropdown-sep {
    height: 1px;
    background: #444;
    margin: 2px 4px;
}

/* ── Menu Fade Out (Win32 Style) ── */
.gos-app-menu-item.item-clicked .gos-app-dropdown {
    display: block !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* Hide all other items in the ghosting menu */
.gos-app-menu-item.item-clicked .gos-app-dropdown>*:not(.gos-dropdown-item-ghost) {
    visibility: hidden;
}

/* The ghost item itself fades out */
.gos-dropdown-item-ghost {
    background: #3f3f3f !important;
    color: #fff !important;
    animation: gos-ghost-fade 300ms forwards;
    pointer-events: none !important;
}

@keyframes gos-ghost-fade {
    to {
        opacity: 0;
    }
}

/* ── Generic Context Menu ── */
.gos-context-menu {
    position: fixed;
    z-index: 99999;
    background: #2b2b2b;
    border: 1px solid #444;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
    padding: 2px;
    min-width: 160px;
    font-family: var(--font-family);
    animation: menu-pop 0.1s ease-out;
}

.gos-context-menu.fade-out {
    animation: menu-fade-out 200ms forwards;
    pointer-events: none !important;
}

.gos-context-menu.item-clicked {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
    animation: none !important;
}

.gos-context-menu.item-clicked>*:not(.gos-dropdown-item-ghost) {
    visibility: hidden;
}

.gos-context-submenu.item-clicked {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
    animation: none !important;
}

.gos-context-submenu.item-clicked>*:not(.gos-dropdown-item-ghost) {
    visibility: hidden;
}

@keyframes menu-pop {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes menu-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.gos-context-menu-item {
    padding: 6px 20px;
    font-size: 0.85rem;
    color: #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gos-context-menu-item:hover {
    background: #3f3f3f;
    color: #fff;
}

.gos-context-menu-item.danger {
    color: #f44336;
}

.gos-context-menu-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.gos-context-menu-sep {
    height: 1px;
    background: #444;
    margin: 2px 4px;
}