/* v6.1.7 — استایل ویجت چت‌بات ایجنت - سه‌سوتی */
.ai-chat-toggle {
    position: fixed;
    bottom: 90px;
    left: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.3s ease;
    animation: aiPulse 2s infinite;
}

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

@keyframes aiPulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.ai-chat-window {
    position: fixed;
    bottom: 160px;
    left: 24px;
    width: 350px;
    height: 530px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Vazirmatn', sans-serif;
}

.ai-chat-window.active { display: flex; }

/* استایل دارک مود */
.dark .ai-chat-window {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.ai-chat-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-header .avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

.ai-chat-header .info h4 { font-size: 14px; font-weight: bold; margin: 0; }
.ai-chat-header .info span {
    font-size: 11px; opacity: 0.8;
    display: flex; align-items: center; gap: 4px;
}
.ai-chat-header .info span::before {
    content: ''; width: 8px; height: 8px;
    background: #10b981; border-radius: 50%; display: inline-block;
}

.ai-chat-messages {
    flex: 1; padding: 15px; overflow-y: auto;
    background: #f8fafc;
    display: flex; flex-direction: column; gap: 10px;
}

.dark .ai-chat-messages {
    background: #0f172a;
}

.ai-msg {
    max-width: 80%; padding: 10px 14px;
    border-radius: 12px; font-size: 13px; line-height: 1.5;
    word-wrap: break-word;
}

.ai-msg.bot {
    background: white; border: 1px solid #e2e8f0;
    color: #1e293b;
    align-self: flex-start; border-bottom-right-radius: 4px;
}

.dark .ai-msg.bot {
    background: #334155; border-color: #475569; color: #f1f5f9;
}

.ai-msg.user {
    background: #6366f1; color: white;
    align-self: flex-end; border-bottom-left-radius: 4px;
}

.ai-typing {
    display: flex; gap: 4px; padding: 10px;
    background: white; border: 1px solid #e2e8f0;
    border-radius: 12px; width: fit-content;
}

.dark .ai-typing {
    background: #334155; border-color: #475569;
}

.ai-typing span {
    width: 8px; height: 8px; background: #cbd5e1;
    border-radius: 50%; animation: typing 1s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

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

.ai-chat-suggestions {
    padding: 6px 10px; background: white;
    border-top: 1px solid #f1f5f9;
}

.dark .ai-chat-suggestions {
    background: #1e293b; border-color: #334155;
}

.ai-mic-hint {
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #6366f1;
    background: #eef2ff;
    padding: 4px;
    border-radius: 8px;
}

.dark .ai-mic-hint {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

.ai-chat-input {
    padding: 10px; background: white;
    border-top: 1px solid #e2e8f0;
    display: flex; gap: 8px; align-items: center;
}

.dark .ai-chat-input {
    background: #1e293b; border-color: #334155;
}

.ai-chat-input input {
    flex: 1; border: 1px solid #e2e8f0;
    border-radius: 8px; padding: 10px;
    font-size: 13px; font-family: inherit; outline: none;
    background: white; color: #1e293b;
}

.dark .ai-chat-input input {
    background: #0f172a; border-color: #475569; color: #f1f5f9;
}

.ai-chat-input input:focus { border-color: #6366f1; }

.ai-chat-input button {
    background: #6366f1; color: white; border: none;
    border-radius: 8px; padding: 0 15px; cursor: pointer;
    transition: background 0.2s; height: 40px;
}

.ai-chat-input button:hover { background: #4f46e5; }

.ai-mic-btn {
    background: #f1f5f9 !important; color: #475569 !important;
    width: 40px; height: 40px; padding: 0 !important;
    border-radius: 50% !important; display: flex;
    align-items: center; justify-content: center;
    border: 1px solid #e2e8f0 !important;
}

.dark .ai-mic-btn {
    background: #334155 !important; color: #cbd5e1 !important; border-color: #475569 !important;
}

.ai-mic-btn.recording {
    background: #ef4444 !important; color: white !important;
    animation: micPulse 1s infinite;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (max-width: 768px) {
    .ai-chat-window {
        left: 10px; right: 10px; width: auto;
        bottom: 150px; height: 70vh;
    }
}
