/**
 * Searchable Country Select Dropdown Styles with Country Flags
 */

.uts-country-select-container {
    position: relative;
    width: 100%;
    user-select: none;
}

.uts-country-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 8px 0;
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    outline: none;
}

.uts-trigger-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.uts-flag-preview {
    font-size: 20px;
    line-height: 1;
    display: none;
}

.uts-code-preview {
    font-size: 15px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uts-code-preview.has-value {
    color: #0f172a;
    font-weight: 500;
}

.uts-country-caret {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    margin-right: 4px;
    transition: transform 0.2s ease;
}

.uts-country-select-container.is-open .uts-country-caret {
    transform: rotate(-135deg);
}

/* Country Dropdown Panel */
.uts-country-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 320px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
    z-index: 99999;
    flex-direction: column;
    overflow: hidden;
    animation: utsSlideDown 0.2s ease-out;
}

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

/* Search input box */
.uts-country-search-box {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    gap: 8px;
}

.uts-search-icon {
    color: #64748b;
    flex-shrink: 0;
}

.uts-country-search-input {
    width: 100% !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 14px !important;
    color: #0f172a !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.uts-country-search-input::placeholder {
    color: #94a3b8;
}

/* Country List */
.uts-country-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 6px 0 !important;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Country List */
.uts-country-list::-webkit-scrollbar {
    width: 6px;
}
.uts-country-list::-webkit-scrollbar-track {
    background: #f8fafc;
}
.uts-country-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.uts-country-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Country List Item */
.uts-country-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    gap: 12px;
    font-size: 14px;
    color: #1e293b;
}

.uts-country-item:hover,
.uts-country-item.is-highlighted {
    background: #f1f5f9;
}

.uts-country-item.is-selected {
    background: #eef2ff;
    color: #3730a3;
    font-weight: 600;
}

.uts-country-flag {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.uts-country-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uts-country-dial {
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.uts-country-item.is-selected .uts-country-dial {
    color: #4f46e5;
}

.uts-country-empty {
    padding: 20px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    cursor: default;
}
