/* DataFirefly International Phone Input - front styles
 * Compatible with PS 8 / 9 (Classic theme + Bootstrap 4/5).
 */

.df-phone-intl {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.df-phone-intl__selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    margin: 0;
    background: #f5f5f5;
    border: 1px solid #ced4da;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    color: #495057;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    height: auto;
    min-height: 40px;
    white-space: nowrap;
    transition: background-color .15s ease;
}

.df-phone-intl__selector:hover,
.df-phone-intl__selector:focus {
    background: #e9ecef;
    outline: none;
}

.df-phone-intl__selector[aria-expanded="true"] {
    background: #e9ecef;
    border-color: #80bdff;
}

.df-phone-intl__flag {
    font-size: 18px;
    line-height: 1;
    /* iOS / older Win don't render Regional Indicator emoji; system fallback shows letters */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

.df-phone-intl__dial {
    color: #6c757d;
    font-weight: 500;
}

.df-phone-intl__arrow {
    color: #adb5bd;
    font-size: 10px;
    margin-left: 2px;
}

.df-phone-intl .df-phone-intl__input {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    flex: 1 1 auto;
    min-width: 0;
}

.df-phone-intl__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1060;
    width: min(340px, 100%);
    max-width: 95vw;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 360px;
}

.df-phone-intl__dropdown[hidden] {
    display: none;
}

.df-phone-intl__search {
    border: 0;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}

.df-phone-intl__search:focus {
    background: #f8f9fa;
}

.df-phone-intl__list {
    overflow-y: auto;
    max-height: 280px;
}

.df-phone-intl__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #212529;
    line-height: 1.3;
}

.df-phone-intl__item:hover {
    background: #f1f3f5;
}

.df-phone-intl__item .df-phone-intl__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-phone-intl__item .df-phone-intl__dial {
    color: #6c757d;
    font-size: 13px;
}

.df-phone-intl__sep {
    height: 1px;
    background: #e9ecef;
    margin: 4px 0;
}

.df-phone-intl__empty {
    padding: 16px 12px;
    color: #6c757d;
    font-size: 13px;
    text-align: center;
}

/* Inside Bootstrap input-group: avoid double borders */
.input-group .df-phone-intl {
    width: 100%;
}

/* When the input has the "is-invalid" class from PS validation */
.df-phone-intl .df-phone-intl__input.is-invalid {
    border-color: #dc3545;
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .df-phone-intl__selector {
        padding: 0 8px;
        font-size: 13px;
    }
    .df-phone-intl__dropdown {
        width: 100%;
    }
}
