/**
 * 自定义下拉框样式
 */

.custom-dropdown-container {
    position: relative;
    display: inline-block;
    min-width: 170px;
}

/* 当下拉菜单打开时，提升容器的z-index */
.custom-dropdown-container.open {
    z-index: 10000;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 20px;
    box-sizing: border-box;
}

.custom-dropdown-trigger:hover {
    border-color: #999;
    background-color: #f9f9f9;
}

.custom-dropdown-container.open .custom-dropdown-trigger {
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.custom-dropdown-selected {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
}

/* ✅ 多图标容器样式 */
.custom-dropdown-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.custom-dropdown-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    background-color: #a1a1a1;
    border-radius: 4px;
    padding: 2px;
}

/* ✅ 多图标模式下的图标尺寸调整 */
.custom-dropdown-icons-wrapper .custom-dropdown-icon {
    width: 28px;
    height: 28px;
    padding: 1px;
}

.custom-dropdown-text {
    font-size: 16px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-dropdown-container.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 450px;
    overflow-y: auto;
    z-index: 9999; /* 提高z-index确保在所有元素上方 */
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.custom-dropdown-option {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* ✅ 选项中的多图标容器 */
.custom-dropdown-option .custom-dropdown-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

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

.custom-dropdown-option:hover {
    background-color: #f5f5f5;
}

.custom-dropdown-option.selected {
    background-color: #e7f3ff;
    color: #007cba;
}

.custom-dropdown-option-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    background-color: #a1a1a1;
    border-radius: 4px;
    padding: 2px;
}

.custom-dropdown-option-text {
    font-size: 16px;
    color: #333;
    flex: 1;
}

.custom-dropdown-option.selected .custom-dropdown-option-text {
    color: #007cba;
    font-weight: 500;
}

/* 针对做装模拟器的特殊样式调整 */
.simulator-content .custom-dropdown-container {
    min-width: 140px;
}

/* 方法下拉框（第二个下拉框）特殊宽度设置 */
.method-dropdown + .custom-dropdown-container {
    min-width: 280px;
}

.simulator-content .method-dropdown + .custom-dropdown-container {
    min-width: 260px;
}

.simulator-content .custom-dropdown-trigger {
    padding: 5px 8px;
    font-size: 15px;
    min-height: 18px;
}

.simulator-content .custom-dropdown-icon,
.simulator-content .custom-dropdown-option-icon {
    width: 28px;
    height: 28px;
    background-color: #a1a1a1;
    border-radius: 3px;
    padding: 2px;
}

.simulator-content .custom-dropdown-text,
.simulator-content .custom-dropdown-option-text {
    font-size: 13px;
}

.simulator-content .custom-dropdown-option {
    padding: 5px 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .custom-dropdown-container {
        min-width: 100px;
    }
    
    .custom-dropdown-trigger {
        padding: 6px 8px;
    }
    
    .custom-dropdown-options {
        max-height: 280px;
    }
    
    .custom-dropdown-icon,
    .custom-dropdown-option-icon {
        width: 18px;
        height: 18px;
        background-color: #4a4a4a;
        border-radius: 2px;
        padding: 1px;
    }
    
    .custom-dropdown-text,
    .custom-dropdown-option-text {
        font-size: 12px;
    }
}

/* 确保下拉框在模拟器布局中正确显示 */
.crafting-step-description .custom-dropdown-container {
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
}

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

.custom-dropdown-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载状态样式 */
.custom-dropdown-loading .custom-dropdown-text {
    color: #999;
    font-style: italic;
}

/* 禁用状态样式 */
.custom-dropdown-container.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.custom-dropdown-container.disabled .custom-dropdown-trigger {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 错误状态样式 */
.custom-dropdown-container.error .custom-dropdown-trigger {
    border-color: #dc3545;
}

.custom-dropdown-container.error .custom-dropdown-trigger:focus {
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

/* 动画效果 */
.custom-dropdown-options {
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 确保与原有样式兼容 */
.inline-dropdown.currency-dropdown,
.inline-dropdown.method-dropdown {
    /* 原始select被隐藏，但保持在DOM中以维持功能 */
    position: relative;
}

/* 特殊情况：当图片加载失败时的处理 */
.custom-dropdown-icon[src=""],
.custom-dropdown-option-icon[src=""] {
    display: none !important;
}

img.custom-dropdown-icon:not([src]),
img.custom-dropdown-option-icon:not([src]) {
    display: none !important;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .custom-dropdown-trigger {
        border-width: 2px;
    }
    
    .custom-dropdown-option.selected {
        background-color: #000;
        color: #fff;
    }
}

/* 深色主题支持（如果需要） */
@media (prefers-color-scheme: dark) {
    .custom-dropdown-trigger {
        background-color: #2d2d2d;
        border-color: #555;
        color: #fff;
    }
    
    .custom-dropdown-options {
        background-color: #2d2d2d;
        border-color: #555;
    }
    
    .custom-dropdown-option {
        color: #fff;
        border-bottom-color: #444;
    }
    
    .custom-dropdown-option:hover {
        background-color: #3d3d3d;
    }
    
    .custom-dropdown-option.selected {
        background-color: #0d4f7a;
        color: #fff;
    }
    
    .custom-dropdown-icon,
    .custom-dropdown-option-icon {
        background-color: #8b8b8b;
    }
}









