/* Дополнительные стили для CRM */

/* Стили для каналов связи */
.badge.bg-purple {
    background-color: #8e44ad !important;
    color: white !important;
}

.badge i {
    margin-right: 0.25rem;
}

/* Аватары пользователей */
.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
}

/* Стили для чекбоксов каналов связи */
.form-check-label i {
    margin-right: 0.5rem;
}

/* Адаптивность для таблицы пользователей */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .badge {
        font-size: 0.7rem;
    }
}

/* Стили для поиска стран */
.country-selector {
    position: relative;
}

.country-search {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    border-radius: 0.375rem 0.375rem 0 0;
}

.country-select {
    position: relative;
    z-index: 1000;
}

.search-results {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid #ced4da;
    border-radius: 0 0 0.375rem 0.375rem;
    background: white;
    z-index: 1002;
    border-top: none;
}

.search-result-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:active {
    background-color: #e9ecef;
}

/* Анимация появления результатов поиска */
.search-results {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для поля поиска */
.country-search:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Стили для Select2 */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 8px;
}

.select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd;
}

/* Стили для опций стран */
.country-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
}

.country-flag {
    font-size: 1.2em;
    margin-right: 8px;
    width: 24px;
    text-align: center;
}

.country-code {
    font-weight: bold;
    color: #495057;
    margin-right: 8px;
    min-width: 30px;
}

.country-name {
    flex: 1;
    color: #212529;
}

.country-phone-code {
    color: #6c757d;
    font-size: 0.9em;
    margin-left: 8px;
}

/* Стили для выбранной страны */
.country-selection {
    display: flex;
    align-items: center;
}

.country-selection .country-flag {
    font-size: 1.1em;
    margin-right: 6px;
}

.country-selection .country-code {
    font-weight: bold;
    margin-right: 6px;
}

.country-selection .country-phone-code {
    color: #6c757d;
    font-size: 0.9em;
}

/* Адаптивность для Select2 */
@media (max-width: 768px) {
    .select2-container {
        width: 100% !important;
    }
    
    .phone-input-container {
        flex-direction: column;
    }
    
    .phone-input-container .select2-container {
        margin-bottom: 8px;
    }
    
    .phone-input-container .phone-input {
        width: 100% !important;
    }
}

/* Адаптивность для поиска стран */
@media (max-width: 768px) {
    .country-selector {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 8px;
    }
    
    .phone-input {
        width: 100% !important;
        display: block !important;
    }
}
