﻿.phone-input-container {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    overflow: visible;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    position: relative;
}

    .phone-input-container:focus-within {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

.country-code-dropdown {
    position: static;
    min-width: 120px;
}

.country-code-button {
    width: 100%;
    padding: 0.375rem 0.75rem;
    background-color: #f8f9fa;
    border: none;
    border-radius: 0;
    border-right: 1px solid #ced4da;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

    .country-code-button:hover {
        background-color: #e9ecef;
    }

    .country-code-button:focus {
        outline: none;
        background-color: #e9ecef;
    }

    /* Validation states for country button */
    .country-code-button.is-valid {
        border-color: #198754;
        background-color: #d1e7dd;
    }

    .country-code-button.is-invalid {
        border-color: #dc3545;
        background-color: #f8d7da;
    }

.flag-icon {
    width: 20px;
    height: 15px;
    margin-right: 5px;
    border-radius: 2px;
    object-fit: cover;
}

.selected-country {
    display: flex;
    align-items: center;
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: #6c757d;
    transition: transform 0.15s ease-in-out;
}

.country-code-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: none;
}

.country-code-dropdown.open .dropdown-menu {
    display: block;
}

.search-container {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.search-input {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

    .search-input:focus {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

.countries-list {
    max-height: 250px;
    overflow-y: auto;
}

.country-option {
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    border-bottom: 1px solid #f8f9fa;
}

    .country-option:hover {
        background-color: #f8f9fa;
    }

    .country-option.selected {
        background-color: #e7f3ff;
        color: #0d6efd;
    }

    .country-option.hidden {
        display: none;
    }

.phone-number-input {
    border: none;
    border-radius: 0;
    flex: 1;
}

    .phone-number-input:focus {
        box-shadow: none;
        border-color: transparent;
    }

    /* Validation states for phone input */
    .phone-number-input.is-valid {
        background-color: #d1e7dd;
    }

    .phone-number-input.is-invalid {
        background-color: #f8d7da;
    }

/* Standalone Country Selector */
.country-selector-container {
    position: relative;
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

    .country-selector-container .country-code-dropdown {
        position: static;
        min-width: 120px;
    }

    .country-selector-container .country-code-button {
        width: 100%;
        padding: 0.375rem 0.75rem;
        background-color: #f8f9fa;
        border: none;
        border-radius: 0.375rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        transition: background-color 0.15s ease-in-out;
    }

        .country-selector-container .country-code-button:hover {
            background-color: #e9ecef;
        }

        .country-selector-container .country-code-button:focus {
            outline: none;
            background-color: #e9ecef;
        }

    .country-selector-container .search-container {
        padding: 0.5rem;
        border-bottom: 1px solid #dee2e6;
    }

    .country-selector-container .search-input {
        border: 1px solid #ced4da;
        border-radius: 0.25rem;
        font-size: 0.875rem;
        width: 100%;
        padding: 0.375rem 0.75rem;
    }

        .country-selector-container .search-input:focus {
            border-color: #86b7fe;
            box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
        }

    .country-selector-container .countries-list {
        max-height: 250px;
        overflow-y: auto;
    }

    .country-selector-container .country-option {
        padding: 0.5rem;
        cursor: pointer;
        transition: background-color 0.15s ease-in-out;
        border-bottom: 1px solid #f8f9fa;
    }

        .country-selector-container .country-option:hover {
            background-color: #f8f9fa;
        }

        .country-selector-container .country-option.selected {
            background-color: #e7f3ff;
            color: #0d6efd;
        }

        .country-selector-container .country-option.hidden {
            display: none;
        }

    .country-selector-container .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        background: white;
        border: 1px solid #ced4da;
        border-radius: 0.375rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        max-height: 300px;
        overflow-y: auto;
        display: none;
    }

    .country-selector-container .country-code-dropdown.open .dropdown-menu {
        display: block;
    }

/* Responsive adjustments */
@media (max-width: 576px) {
    .country-code-dropdown {
        min-width: 100px;
    }
}

/* Readonly states */
.country-code-button[readonly] {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

    .country-code-button[readonly]:hover {
        background-color: #e9ecef;
    }

    .country-code-button[readonly]:focus {
        background-color: #e9ecef;
        outline: none;
    }

    .country-code-button[readonly] .dropdown-arrow {
        opacity: 0.5;
    }