/* 手机区号选择器样式 */
.phone-country-code-selector {
    position: relative;
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    flex-shrink: 0;
    margin-right: 10px;
}

/* 选择器输入框 */
.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-code {
    color: #2196f3;
    font-weight: 600;
    margin-right: 8px;
    flex-shrink: 0;
    min-width: 50px;
}

.country-name {
    color: #495057;
    margin-right: 6px;
    flex-shrink: 0;
    white-space: nowrap; /* 防止换行 */
}

.country-name-en {
    color: #6c757d;
    font-size: 0.85em;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 状态消息 */
.loading-placeholder,
.error-message,
.empty-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
}

.error-message {
    color: #dc3545;
}

.empty-message {
    color: #adb5bd;
}

/* 滚动条样式 */
.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) {
    .phone-country-code-selector {
        min-width: 150px;
    }
    

    
    .selector-input {
        padding: 12px 10px;
        min-height: 48px;
    }
    
    .selected-text {
        font-size: 0.85rem;
    }
    
    .country-item {
        padding: 12px 10px;
        min-height: 48px;
    }
    
    .country-code {
        min-width: 45px;
        font-size: 0.85rem;
    }
    
    .country-name {
        font-size: 0.85rem;
    }
    
    .country-name-en {
        font-size: 0.8rem;
    }
    
    .search-input {
        padding: 10px 12px 10px 32px;
        font-size: 0.85rem;
    }
    
    .dropdown-list {
        max-height: 200px;
    }
    
    /* 隐藏滚动条在移动端 */
    .dropdown-list::-webkit-scrollbar {
        width: 0;
        background: transparent;
    }
    
    .dropdown-list {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

@media (max-width: 480px) {
    .phone-country-code-selector {
        min-width: 120px;
    }
    

    
    .selector-input {
        padding: 10px 8px;
    }
    

    
    .selected-text {
        font-size: 0.8rem;
    }
    
    .country-item {
        padding: 10px 8px;
    }
    

    
    .country-code {
        min-width: 40px;
        font-size: 0.8rem;
        margin-right: 6px;
    }
    
    .country-name {
        font-size: 0.8rem;
        margin-right: 4px;
    }
    
    .country-name-en {
        font-size: 0.75rem;
    }
    
    .search-input {
        padding: 8px 10px 8px 28px;
        font-size: 0.8rem;
    }
    
    .search-icon {
        left: 8px;
        font-size: 0.8rem;
    }
    
    .search-clear {
        right: 6px;
        padding: 2px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .selector-input {
        border-width: 2px;
    }
    
    .selector-input:focus,
    .selector-input.open {
        box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
    }
    
    .country-item.selected {
        background: #1976d2;
        color: #fff;
    }
}

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

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .phone-country-code-selector {
        color: #e9ecef;
    }
    
    .selector-input {
        background: #343a40;
        border-color: #495057;
        color: #e9ecef;
    }
    
    .selector-input:hover {
        border-color: #64b5f6;
    }
    
    .selector-input:focus,
    .selector-input.open {
        border-color: #64b5f6;
        box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
    }
    
    .selected-text {
        color: #adb5bd;
    }
    
    .selected-text.selected {
        color: #e9ecef;
    }
    
    .selector-arrow {
        color: #adb5bd;
    }
    
    .selector-dropdown {
        background: #343a40;
        border-color: #64b5f6;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .dropdown-search {
        background: #495057;
        border-color: #495057;
    }
    
    .search-input {
        background: #343a40;
        border-color: #495057;
        color: #e9ecef;
    }
    
    .search-input:focus {
        border-color: #64b5f6;
        box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
    }
    
    .search-icon {
        color: #adb5bd;
    }
    
    .search-clear {
        color: #adb5bd;
    }
    
    .search-clear:hover {
        background: #495057;
        color: #e9ecef;
    }
    
    .country-item {
        color: #e9ecef;
    }
    
    .country-item:hover {
        background: #495057;
    }
    
    .country-item.selected {
        background: #1e3a8a;
        color: #bfdbfe;
    }
    
    .country-code {
        color: #64b5f6;
    }
    
    .country-name {
        color: #e9ecef;
    }
    
    .country-name-en {
        color: #adb5bd;
    }
    
    .loading-placeholder,
    .empty-message {
        color: #adb5bd;
    }
    
    .error-message {
        color: #f87171;
    }
    
    .dropdown-list::-webkit-scrollbar-track {
        background: #495057;
    }
    
    .dropdown-list::-webkit-scrollbar-thumb {
        background: #6c757d;
    }
    
    .dropdown-list::-webkit-scrollbar-thumb:hover {
        background: #adb5bd;
    }
} 