.phone-number-field {
    position: relative;
}

.phone-number-field .input-group {
    display: flex;
    align-items: stretch;
}

.phone-number-field .input-group-prepend {
    margin-right: 0;
}
.phone-country-dropdown {
    position: relative;
    min-width: 80px;
    width: 100%;
}

.phone-country-selected {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-right: none;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

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

.phone-country-selected.active {
    background-color: #e9ecef;
}

.country-flag {
    width: 20px;
    height: 15px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 2px;
    margin-right: 8px;
    border: 1px solid #dee2e6;
}

.country-prefix {
    font-weight: 600;
    color: #495057;
    margin-right: 8px;
}

.dropdown-arrow {
    color: #6c757d;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.phone-country-selected.active .dropdown-arrow {
    transform: rotate(180deg);
}

.phone-country-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    width: 100%;
    min-width: 300px;
}

.phone-country-list.show {
    display: block;
}

.phone-country-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

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

.phone-country-option.selected {
    background-color: #e3f2fd;
}

.phone-country-option .country-name {
    flex: 1;
    margin-left: 8px;
    color: #495057;
}

.phone-number-field .phone-number-input {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    flex: 1;
}

.phone-number-field .phone-prefix-text {
    display: inline-block;
}

.phone-number-field .phone-prefix-text::after {
    content: ' ';
    display: inline-block;
    width: 8px;
}


.phone-number-field .phone-country-selector:focus,
.phone-number-field .phone-number-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.phone-number-field.is-invalid .phone-country-selector,
.phone-number-field.is-invalid .phone-number-input {
    border-color: #dc3545;
}

.phone-number-field.is-invalid .phone-country-selector:focus,
.phone-number-field.is-invalid .phone-number-input:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

@media (max-width: 576px) {
    .phone-number-field .phone-country-selector {
        min-width: 70px;
        font-size: 0.8rem;
    }
    
    .phone-number-field .phone-prefix-display {
        left: 75px;
        font-size: 0.8rem;
    }
}

.theme-orange .phone-number-field .phone-country-selector {
    background-color: #fff3e0;
}

.theme-kla .phone-number-field .phone-country-selector {
    background-color: #f5f5f5;
}

.phone-number-field .phone-country-selector option {
    padding: 5px;
}

.phone-number-field .phone-prefix-text {
    transition: all 0.2s ease;
}

.phone-number-field .phone-prefix-text.changing {
    color: #007bff;
    transform: scale(1.1);
}

.enter-profile-phone-field .phone-country-dropdown {
    min-width: 60px;
    max-width: 80px;
}

.enter-profile-phone-field .phone-country-selected {
    padding: 6px 8px;
    font-size: 0.875rem;
}

.enter-profile-phone-field .country-flag {
    width: 20px;
    height: 15px;
    margin-right: 0;
}

.enter-profile-phone-field .country-prefix {
    font-size: 0.875rem;
    margin-right: 4px;
}

.enter-profile-phone-field .dropdown-arrow {
    font-size: 0.7rem;
}

.enter-profile-phone-field .phone-country-list {
    min-width: 200px;
    max-height: 150px;
}

.enter-profile-phone-field .phone-country-option {
    padding: 6px 8px;
    font-size: 0.875rem;
}

.enter-profile-phone-field .phone-country-option .country-flag {
    width: 20px;
    height: 15px;
}

@media (max-width: 576px) {
    .phone-country-dropdown {
        min-width: 65px;
    }
    
    .phone-country-list {
        min-width: 250px;
    }
    
    .phone-country-selected {
        padding: 6px 10px;
        font-size: 0.875rem;
    }
    
    .country-flag {
        width: 18px;
        height: 13px;
    }
}
