/* 国家选择器样式 */
.country-selector {
    position: relative;
    width: 100%;
    min-width: 200px;
    flex-shrink: 0;
}

/* 在表单中的特殊样式 */
.col-md-4 .country-selector {
    min-width: 150px;
}

/* 选择器输入框 */
.selector-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.selector-input:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1);
}

.selector-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.selector-input.open {
    border-color: #2196f3;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* 选中显示区域 */
.selected-display {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.selected-text {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-text.selected {
    color: #495057;
    font-weight: 500;
}

/* 箭头图标 */
.selector-arrow {
    color: #6c757d;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

/* 下拉框 */
.selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #2196f3;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow: hidden;
}

.selector-dropdown.dropup {
    top: auto;
    bottom: 100%;
    border-top: 1px solid #2196f3;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

/* 搜索区域 */
.dropdown-search {
    padding: 8px;
    border-bottom: 1px solid #e0e6ed;
    background: #f8f9fa;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: #6c757d;
    font-size: 0.9rem;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.search-clear:hover {
    background: #e9ecef;
    color: #495057;
}

/* 下拉列表 */
.dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}

/* 国家项 */
.country-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.country-item:hover {
    background: #f8f9fa;
}

.country-item.selected {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.country-name {
    color: #495057;
    margin-right: 8px;
    flex: 1;
    min-width: 0;
}

.country-name-en {
    color: #6c757d;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* 加载和错误状态 */
.loading-placeholder,
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.error-message {
    color: #dc3545;
}

.empty-message {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

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

.dropdown-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .country-selector {
        min-width: 150px;
    }
    
    .selector-input {
        padding: 8px 10px;
        min-height: 40px;
    }
    
    .selected-text {
        font-size: 0.85rem;
    }
    
    .country-item {
        padding: 8px 10px;
        min-height: 40px;
    }
    
    .country-name {
        font-size: 0.85rem;
    }
    
    .country-name-en {
        font-size: 0.8rem;
    }
    
    .search-input {
        font-size: 0.85rem;
        padding: 6px 10px 6px 28px;
    }
    
    .dropdown-list {
        max-height: 200px;
    }
    
    .dropdown-list::-webkit-scrollbar {
        width: 4px;
    }
    
    .dropdown-list {
        scrollbar-width: thin;
    }
}

@media (max-width: 480px) {
    .country-selector {
        min-width: 120px;
    }
    
    .selector-input {
        padding: 6px 8px;
        min-height: 36px;
    }
    
    .selected-text {
        font-size: 0.8rem;
    }
    
    .country-item {
        padding: 6px 8px;
        min-height: 36px;
    }
    
    .country-name {
        font-size: 0.8rem;
    }
    
    .country-name-en {
        font-size: 0.75rem;
        display: none; /* 在小屏幕上隐藏英文名 */
    }
    
    .search-input {
        font-size: 0.8rem;
        padding: 5px 8px 5px 24px;
    }
    
    .search-icon {
        font-size: 0.8rem;
        left: 8px;
    }
    
    .search-clear {
        right: 6px;
        padding: 2px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .selector-input {
        border-color: #000;
    }
    
    .selector-input:focus,
    .selector-input:hover {
        border-color: #0066cc;
        box-shadow: 0 0 0 2px #0066cc;
    }
    
    .country-item.selected {
        background: #0066cc;
        color: #fff;
    }
}

/* 减少动画效果 */
@media (prefers-reduced-motion: reduce) {
    .selector-input,
    .selector-arrow,
    .country-item,
    .search-input,
    .search-clear {
        transition: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .country-selector {
        color: #e9ecef;
    }
    
    .selector-input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e9ecef;
    }
    
    .selector-input:hover {
        border-color: #63b3ed;
        box-shadow: 0 2px 4px rgba(99, 179, 237, 0.2);
    }
    
    .selector-input:focus,
    .selector-input.open {
        border-color: #63b3ed;
        box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.3);
    }
    
    .selected-text {
        color: #a0aec0;
    }
    
    .selected-text.selected {
        color: #e9ecef;
    }
    
    .selector-arrow {
        color: #a0aec0;
    }
    
    .selector-dropdown {
        background: #2d3748;
        border-color: #63b3ed;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .dropdown-search {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .search-input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e9ecef;
    }
    
    .search-input:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.3);
    }
    
    .search-icon {
        color: #a0aec0;
    }
    
    .search-clear {
        color: #a0aec0;
    }
    
    .search-clear:hover {
        background: #4a5568;
        color: #e9ecef;
    }
    
    .country-item {
        color: #e9ecef;
    }
    
    .country-item:hover {
        background: #4a5568;
    }
    
    .country-item.selected {
        background: #2b6cb0;
        color: #e9ecef;
    }
    
    .country-name {
        color: #e9ecef;
    }
    
    .country-name-en {
        color: #a0aec0;
    }
    
    .loading-placeholder,
    .error-message,
    .empty-message {
        color: #a0aec0;
    }
    
    .dropdown-list::-webkit-scrollbar-track {
        background: #1a202c;
    }
    
    .dropdown-list::-webkit-scrollbar-thumb {
        background: #4a5568;
    }
    
    .dropdown-list::-webkit-scrollbar-thumb:hover {
        background: #718096;
    }
} 