/* 自定义下拉框组件 - 解决原生select白色背景问题 */

/* 隐藏原生select */
.custom-select-wrapper select {
  display: none;
}

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

/* 自定义下拉框显示区域 */
.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 14px 52px 14px 20px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.8;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

/* 占位符文字 */
.custom-select-trigger.placeholder {
  color: var(--text-tertiary);
  opacity: 0.7;
}

/* 下拉箭头 */
.custom-select-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--color-primary);
  transition: transform 0.3s ease;
}

/* 展开时箭头旋转 */
.custom-select-wrapper.active .custom-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* 悬停效果 */
.custom-select-trigger:hover {
  border-color: var(--color-primary);
  background: var(--bg-input-focus);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.15);
}

/* 聚焦效果 */
.custom-select-wrapper.active .custom-select-trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

/* 下拉选项列表容器 */
.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 320px;
  background: var(--color-bg-secondary, #1e293b);  /* 暗色背景 */
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* 展开状态 */
.custom-select-wrapper.active .custom-select-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* 下拉选项 */
.custom-select-option {
  padding: 14px 20px;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: 1.8;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

/* 选项悬停 */
.custom-select-option:hover {
  background: rgba(102, 126, 234, 0.2);  /* 主色调半透明背景 */
  color: var(--color-primary-light);
  padding-left: 24px;  /* 悬停时轻微缩进 */
}

/* 选中的选项 */
.custom-select-option.selected {
  background: rgba(102, 126, 234, 0.3);
  color: var(--color-primary-light);
  font-weight: 600;
  position: relative;
}

/* 选中标记 */
.custom-select-option.selected::before {
  content: '✓';
  position: absolute;
  left: 8px;
  color: var(--color-primary);
  font-weight: bold;
}

.custom-select-option.selected {
  padding-left: 32px;  /* 为勾选标记留空间 */
}

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

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

.custom-select-dropdown::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-light);
}

/* 禁用状态 */
.custom-select-wrapper.disabled .custom-select-trigger {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 错误状态 */
.custom-select-wrapper.error .custom-select-trigger {
  border-color: var(--color-error);
}

/* 响应式 */
@media (max-width: 768px) {
  .custom-select-dropdown {
    max-height: 240px;
  }
  
  .custom-select-option {
    padding: 12px 16px;
  }
}

/* 动画 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-select-wrapper.active .custom-select-dropdown {
  animation: slideDown 0.3s ease;
}

