/* ai_chat.css - Виджет ИИ-чата (правый нижний угол) */

.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    font-family: 'Inter', 'Roboto', 'Arial', sans-serif;
}

.ai-chat-button {
    width: 60px;
    height: 60px;
    background: #2C5F8A;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
}

.ai-chat-button:hover {
    background: #1D3E5C;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ai-chat-button svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #E5E7EB;
}

.ai-chat-window.open {
    display: flex;
}

.ai-chat-header {
    background: #2C5F8A;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F5F7FA;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    max-width: 85%;
    align-self: flex-start;
    font-size: 14px;
    line-height: 1.4;
    color: #1A1A1A;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.user-message {
    background: #2C5F8A;
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-right-radius: 4px;
    max-width: 85%;
    align-self: flex-end;
    font-size: 14px;
    line-height: 1.4;
}

.ai-chat-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #E5E7EB;
    background: white;
    gap: 8px;
}

.ai-chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    height: 40px;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #2C5F8A;
}

.ai-chat-send {
    background: #2C5F8A;
    border: none;
    color: white;
    padding: 0 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.ai-chat-send:hover {
    background: #1D3E5C;
}

.ai-typing {
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    max-width: 85%;
    align-self: flex-start;
    font-size: 14px;
    color: #6B7280;
}

.ai-chat-contact-form {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background: #F5F7FA;
}

.ai-chat-contact-form input {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    font-size: 13px;
}

.ai-chat-contact-form button {
    width: 100%;
    background: #2C5F8A;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 48px);
        right: 0;
        bottom: 70px;
    }

    .ai-chat-button {
        width: 50px;
        height: 50px;
    }
}

.floating-help-button {
    position: fixed;
    bottom: 50px;
    right: 20px;
    background: #dc2626;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    z-index: 1000;
    transition: transform 0.2s, background 0.2s;
}

.floating-help-button:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

.floating-help-button svg {
    width: 20px;
    height: 20px;
}
/* Добавьте в ваш styles.css */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 18px;
    width: fit-content;
    margin: 8px 0;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.ai-typing span:nth-child(1) {
    animation-delay: 0s;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Стили для окна чата */
.ai-chat-window {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    flex-direction: column;
    z-index: 10000;
}

.ai-chat-window.open {
    display: flex !important;
}

/* Стили для сообщений */
.user-message {
    background: #1e3a5f;
    color: white;
    padding: 10px 15px;
    border-radius: 18px;
    margin: 8px 0;
    margin-left: auto;
    max-width: 80%;
    width: fit-content;
}

.ai-message {
    background: #f0f0f0;
    color: #333;
    padding: 10px 15px;
    border-radius: 18px;
    margin: 8px 0;
    max-width: 80%;
    width: fit-content;
}

@media (max-width: 768px) {
    .floating-help-button {
        bottom: 10px;
        right: 10px;
    }
}