/**
 * 自定义下拉框样式
 * 
 * @author Wukong Team
 * @version 1.0.0
 */

/* 自定义下拉框容器 */
.custom-select-container {
    position: relative;
    width: 100%;
}

/* 显示区域 */
.custom-select-display {
    width: 100%;
    padding: 10px 12px;
    padding-right: 36px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    min-height: 20px;
}

.custom-select-display:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-select-container.open .custom-select-display {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 下拉箭头 */
.custom-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
    pointer-events: none;
}

.custom-select-container.open .custom-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* 选项列表 */
.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10001 !important;
    display: none;
    backdrop-filter: blur(10px);
}

.custom-select-container.open .custom-select-options {
    display: block;
}

/* 选项项 */
.custom-select-option {
    padding: 12px 16px;
    color: #fff !important;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    color: #fff !important;
}

.custom-select-option.selected {
    background: rgba(102, 126, 234, 0.5) !important;
    color: #fff !important;
    font-weight: 500;
}

.custom-select-option:active {
    background: rgba(102, 126, 234, 0.4) !important;
}

/* 滚动条样式 */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* 在 ComfyUI 节点中 */
.comfyui-node .custom-select-container,
.comfyui-node-body .custom-select-container {
    margin-bottom: 12px;
}

/* 确保在 ComfyUI 节点中下拉列表显示在最上层 */
.comfyui-node .custom-select-container {
    position: relative;
    z-index: 10;
}

.comfyui-node .custom-select-options {
    z-index: 10002 !important;
    /* 保持绝对定位，相对于容器 */
}

/* 响应式 */
@media (max-width: 768px) {
    .custom-select-options {
        max-height: 200px;
    }
}

