/**
 * Searchable Country Select Dropdown Styles with Country Flags
 * Scoped & Theme-Proof: 100% immune to theme UL/LI bullets, background colors, and borders.
 */

.uts-country-select-container {
    position: relative !important;
    width: 100% !important;
    user-select: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.uts-country-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    line-height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid transparent !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

.uts-country-trigger:focus,
.uts-country-select-container.is-open .uts-country-trigger {
    border-bottom-color: #0f172a !important;
}

.uts-trigger-selected {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    overflow: hidden !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.uts-flag-preview {
    font-size: 20px !important;
    line-height: 1 !important;
    display: none;
    flex-shrink: 0 !important;
}

.uts-code-preview {
    font-size: 15px !important;
    color: #8a94a6 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-family: inherit !important;
    font-weight: 400 !important;
    margin: 0 !important;
    padding: 0 !important;
}

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

.uts-country-caret {
    display: inline-block !important;
    width: 7px !important;
    height: 7px !important;
    border: none !important;
    border-right: 2px solid #64748b !important;
    border-bottom: 2px solid #64748b !important;
    transform: rotate(45deg) !important;
    margin-right: 4px !important;
    transition: transform 0.2s ease !important;
    flex-shrink: 0 !important;
    background: transparent !important;
}

.uts-country-select-container.is-open .uts-country-caret {
    transform: rotate(-135deg) translateY(-2px) !important;
}

/* ==========================================================================
   Country Dropdown Panel (High Z-Index & Overflow Safe)
   ========================================================================== */

.uts-country-dropdown {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 0 !important;
    width: 320px !important;
    max-width: calc(100vw - 32px) !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    z-index: 999999 !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: utsSlideDown 0.2s ease-out !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

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

/* Search input box */
.uts-country-search-box {
    display: flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #f8fafc !important;
    gap: 8px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

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

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

.uts-country-search-input::placeholder {
    color: #94a3b8 !important;
    font-size: 13px !important;
}

/* Country List (Strict Theme Reset against theme UL/LI bullets) */
.uts-country-list {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 6px 0 !important;
    max-height: 240px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

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

/* Country List Item */
.uts-country-item {
    display: flex !important;
    align-items: center !important;
    padding: 10px 16px !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    gap: 12px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #1e293b !important;
    background: #ffffff !important;
    border: none !important;
    list-style: none !important;
    list-style-type: none !important;
    text-align: left !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.uts-country-item:hover,
.uts-country-item.is-highlighted {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

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

.uts-country-flag {
    font-size: 20px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.uts-country-name {
    flex: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 14px !important;
    color: inherit !important;
    text-align: left !important;
}

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

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

.uts-country-empty {
    padding: 20px 16px !important;
    text-align: center !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    cursor: default !important;
    background: #ffffff !important;
    list-style: none !important;
}
