/**
 * Красивые индикаторы загрузки для чата CarMatch
 * Для фронтенда dzh0n
 */

/* Анимация печатающихся точек */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(103, 126, 234, 0.1);
    border-radius: 18px;
    margin: 8px 0;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Спиннер для поиска */
.search-spinner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(103, 126, 234, 0.05);
    border-radius: 18px;
    margin: 8px 0;
}

.spinner-circle {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(103, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-spinner-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Индикатор проверки */
.checking-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

/* Плавная анимация появления */
.fade-in-message {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Интеграция с существующими стилями чата */
.chat_item.loading {
    background: transparent;
    padding: 0;
}

.chat_item.loading .typing-indicator,
.chat_item.loading .search-spinner,
.chat_item.loading .checking-indicator {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
