.phone-input-container {
    position: relative;
    width: 100%;
    display: flex;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    align-items: stretch;
    min-height: 38px;
    overflow: visible;
}

.phone-input-container:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.country-selector {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-right: 1px solid #ced4da;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    min-width: 80px;
    transition: background-color 0.15s ease-in-out;
    flex-shrink: 0;
    overflow: visible;
}

.country-selector:hover {
    background-color: #e9ecef;
}

.selected-country {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    gap: 0.5rem;
    height: 100%;
}

.flag-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.country-flag-img {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.country-flag-emoji {
    font-size: 1.2em;
    line-height: 1;
    vertical-align: middle;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "EmojiOne Mozilla", "Twemoji Mozilla", "Segoe UI Symbol", "Noto Emoji", sans-serif;
}

.country-code {
    font-weight: 500;
    color: #495057;
}

.dropdown-arrow {
    font-size: 0.8em;
    color: #6c757d;
    transition: transform 0.15s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-arrow svg {
    color: inherit;
    transition: transform 0.15s ease-in-out;
}

.country-selector.open .dropdown-arrow svg {
    transform: rotate(180deg);
}

.phone-number-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: transparent;
    height: 100%;
    display: flex;
    align-items: center;
}

.phone-number-input::placeholder {
    color: #6c757d;
    opacity: 1;
}

.phone-input-container.is-invalid .phone-input-wrapper {
    border-color: #dc3545;
}

.phone-input-container.is-invalid .phone-input-wrapper:focus-within {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.phone-input-container.is-valid .phone-input-wrapper {
    border-color: #198754;
}

.phone-input-container.is-valid .phone-input-wrapper:focus-within {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

.country-flag-img {
    transition: opacity 0.2s ease-in-out;
}

.country-flag-img:hover {
    opacity: 0.8;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.search-container {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    box-sizing: border-box;
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.search-input-wrapper:hover {
    border-color: #9ca3af;
}

.search-input-wrapper.focused {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    color: #6b7280;
    margin-right: 8px;
    flex-shrink: 0;
}

.country-search {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #374151;
    font-family: inherit;
    min-width: 0;
    width: 100%;
}

.country-search::placeholder {
    color: #9ca3af;
}

.clear-search {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.clear-search:hover {
    background: #f3f4f6;
    color: #374151;
}

.clear-search:active {
    background: #e5e7eb;
}

.country-list {
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Webkit scrollbar styling */
.country-list::-webkit-scrollbar {
    width: 6px;
}

.country-list::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.country-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    border-bottom: 1px solid #f8f9fa;
    gap: 0.75rem;
    flex-shrink: 0;
}

.country-option:hover,
.country-option.focused {
    background-color: #f8f9fa;
}

.country-option.focused {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.country-option:last-child {
    border-bottom: none;
}

.country-option .country-name {
    flex: 1;
    color: #212529;
    font-weight: 400;
}

.country-option .country-code {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    flex-shrink: 0;
}

.no-results-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.no-results-text {
    font-weight: 500;
    margin-bottom: 4px;
}

.no-results-hint {
    font-size: 12px;
    color: #9ca3af;
}

mark {
    background-color: #3b82f6;
    color: white;
    padding: 0 4px;
    border-radius: 2px;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}