/**
 * Phone Country Code Styling
 * 
 * Styles for the country code dropdown and phone input integration
 */

/* Phone wrapper container */
.phone-with-country-code .phone-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* Country code select styling */
.phone-country-code-select {
    flex: 0 0 120px;
    min-width: 120px;
    height: 50px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.phone-country-code-select:hover {
    border-color: #66676b;
}

.phone-country-code-select:focus {
    outline: none;
    border-color: #66676b;
    box-shadow: 0 0 0 2px rgba(102, 103, 107, 0.1);
}

.phone-country-code-select:required:invalid {
    border-color: #e74c3c;
}

/* Phone number input styling */
.phone-with-country-code .phone-number-input {
    flex: 1;
    min-width: 0;
}

/* Adjust icon position */
.phone-with-country-code > i {
    right: 15px;
    pointer-events: none;
}

/* Select2 integration (if available) */
.phone-with-country-code .select2-container {
    flex: 0 0 120px;
    min-width: 120px;
}

.phone-with-country-code .select2-container .select2-selection--single {
    height: 50px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.phone-with-country-code .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 48px;
    padding-left: 12px;
    color: #333;
}

.phone-with-country-code .select2-container .select2-selection--single .select2-selection__arrow {
    height: 48px;
}

.phone-with-country-code .select2-container--focus .select2-selection--single {
    border-color: #66676b;
}

/* Error state styling */
.phone-with-country-code.has-error .phone-country-code-select,
.phone-with-country-code.has-error .phone-number-input {
    border-color: #e74c3c;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .phone-with-country-code .phone-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .phone-country-code-select,
    .phone-with-country-code .select2-container {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
    }
}

/* Ensure proper spacing within the form */
.phone-with-country-code {
    position: relative;
}

/* Make sure the wrapper takes full width */
.phone-with-country-code .phone-input-wrapper {
    width: 100%;
}

/* Optional: Add a subtle animation on focus */
.phone-country-code-select:focus,
.phone-with-country-code .phone-number-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
