/* AI Chat Styles - Fixed Version */
.ai-chat {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Кнопка AI-ассистента - наследует стили от fixed-btn */
.ai-chat__trigger {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none;
    position: relative;
}

.ai-chat__trigger svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Окно чата */
.ai-chat__window {
    position: fixed;
    bottom: 20px;
    right: 90px; /* Смещение от кнопок */
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
}

.ai-chat__window.open {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

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

.ai-chat__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat__header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat__avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ai-chat__header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chat__header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.ai-chat__close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat__messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-chat__message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.ai-chat__message--user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.ai-chat__message--ai {
    background: #f1f3f4;
    color: #333;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
}

.ai-chat__message--ai.typing {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat__typing-indicator {
    display: flex;
    gap: 4px;
}

.ai-chat__typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.5s infinite;
}

.ai-chat__typing-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.ai-chat__typing-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.ai-chat__input-area {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.ai-chat__input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chat__input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    min-height: 20px;
    max-height: 80px;
    outline: none;
    transition: border-color 0.3s ease;
}

.ai-chat__input:focus {
    border-color: #667eea;
}

.ai-chat__send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-chat__send:hover {
    transform: scale(1.1);
}

.ai-chat__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ai-chat__send svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.ai-chat__welcome {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px;
}

.ai-chat__welcome h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.ai-chat__welcome p {
    margin: 0;
    line-height: 1.4;
}

.ai-chat__suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.ai-chat__suggestion {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.ai-chat__suggestion:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

/* Адаптивность */
@media (max-width: 768px) {
    .ai-chat__window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: 10px;
        left: 10px;
    }
}