/* Generic */
.comfyui-button {
  display: flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  box-sizing: border-box;
  margin: 0;
  transition: box-shadow 0.1s;
}

.comfyui-button:active {
  box-shadow: inset 1px 1px 10px rgb(0 0 0 / 0.5);
}

.comfyui-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.primary .comfyui-button,
.primary.comfyui-button {
  background-color: var(--primary-bg) !important;
  color: var(--primary-fg) !important;
}

.primary .comfyui-button:not(:disabled):hover,
.primary.comfyui-button:not(:disabled):hover {
  background-color: var(--primary-hover-bg) !important;
  color: var(--primary-hover-fg) !important;
}

/* Popup */
.comfyui-popup {
  position: absolute;
  top: var(--top);
  right: var(--right);
  bottom: var(--bottom);
  left: var(--left);
  z-index: 2000;
  max-height: calc(100vh - var(--limit) - 10px);
  box-shadow: 3px 3px 5px 0 rgb(0 0 0 / 0.3);
}

.comfyui-popup:not(.open) {
  display: none;
}

.comfyui-popup.right.open {
  border-top-left-radius: 4px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
  overflow: hidden;
}
/* Split button */
.comfyui-split-button {
  position: relative;
  display: flex;
}

.comfyui-split-primary {
  flex: auto;
}

.comfyui-split-primary .comfyui-button {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 1px solid var(--comfy-menu-bg);
  width: 100%;
}

.comfyui-split-arrow .comfyui-button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 2px;
  padding-right: 2px;
}

.comfyui-split-button-popup {
  white-space: nowrap;
  background-color: var(--content-bg);
  color: var(--content-fg);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.comfyui-split-button-popup.hover {
  z-index: 2001;
}
.comfyui-split-button-popup > .comfyui-button {
  border: none;
  background-color: transparent;
  color: var(--fg-color);
  padding: 8px 12px 8px 8px;
}

.comfyui-split-button-popup > .comfyui-button:not(:disabled):hover {
  background-color: var(--comfy-input-bg);
}

/* Button group */
.comfyui-button-group {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
}

.comfyui-button-group:empty {
  display: none;
}
.comfyui-button-group > .comfyui-button,
.comfyui-button-group > .comfyui-button-wrapper > .comfyui-button {
  padding: 4px 10px;
  border-radius: 0;
}
