/* ===== CHAT WIDGET - СТИЛИ В СООТВЕТСТВИИ С ТЕМОЙ САЙТА ===== */

/* Кнопка открытия чата */
.chat-widget-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color, #00d4ff);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    color: #0a1628;
    font-size: 24px;
    line-height: 1;
}

.chat-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.6);
}

.chat-widget-toggle.active {
    background: var(--error-color, #ff6b6b);
}

/* Контейнер чата */
.chat-widget-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: var(--card-bg, rgba(20, 35, 50, 0.95));
    border: 1px solid var(--border-color, rgba(0, 255, 255, 0.2));
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-widget-container.active {
    display: flex;
}

/* Заголовок чата */
.chat-header {
    padding: 20px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid var(--border-color, rgba(0, 255, 255, 0.2));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    color: var(--primary-color, #00d4ff);
    font-size: 1.2em;
    font-weight: 600;
}

.chat-widget-close {
    background: none;
    border: none;
    color: var(--text-color, #e0e6ed);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.chat-widget-close:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--error-color, #ff6b6b);
}

/* Область сообщений */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color, #00d4ff);
    border-radius: 3px;
}

/* Сообщения */
.chat-message {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-message-user {
    align-items: flex-end;
}

.chat-message-bot {
    align-items: flex-start;
}

.chat-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-user .chat-message-content {
    background: var(--primary-color, #00d4ff);
    color: #0a1628;
    border-bottom-right-radius: 4px;
}

.chat-message-bot .chat-message-content {
    background: var(--card-bg, rgba(20, 35, 50, 0.5));
    border: 1px solid var(--border-color, rgba(0, 255, 255, 0.2));
    color: var(--text-color, #e0e6ed);
    border-bottom-left-radius: 4px;
}

.chat-message-loading .chat-message-content {
    background: var(--card-bg, rgba(20, 35, 50, 0.5));
    border: 1px solid var(--border-color, rgba(0, 255, 255, 0.2));
    color: var(--text-secondary, #7ea8c8);
}

.chat-loading-dots {
    display: inline-block;
}

.chat-loading-dots span {
    animation: chat-pulse 1.4s infinite;
    display: inline-block;
}

.chat-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chat-pulse {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

.chat-cached-badge {
    font-size: 0.75em;
    color: var(--text-secondary, #7ea8c8);
    opacity: 0.7;
}

/* Форма ввода */
.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--border-color, rgba(0, 255, 255, 0.2));
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    background: var(--card-bg, rgba(20, 35, 50, 0.5));
    border: 1px solid var(--border-color, rgba(0, 255, 255, 0.2));
    border-radius: 20px;
    color: var(--text-color, #e0e6ed);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input:focus {
    border-color: var(--primary-color, #00d4ff);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

.chat-send-btn {
    padding: 10px 20px;
    background: var(--primary-color, #00d4ff);
    border: none;
    border-radius: 20px;
    color: #0a1628;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-send-btn:hover {
    background: #00b8e6;
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-widget-container {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 90px;
        height: calc(100vh - 120px);
    }
    
    .chat-widget-toggle {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

