/* بنیاد آنلاین - دستیار فرم هوشمند */
.ai-form-assistant {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

.assistant-toggle {
    width: 65px;
    height: 65px;
    background: linear-gradient(145deg, #0f0c29, #1a1a3e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: 0.3s;
    border: 1px solid rgba(255,215,0,0.3);
}
.assistant-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,215,0,0.3);
}
.assistant-toggle i {
    font-size: 32px;
    color: #FFD700;
}

.assistant-window {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
    backdrop-filter: blur(0);
    border: 1px solid rgba(48,43,99,0.2);
}
.assistant-window.open {
    display: flex;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.assistant-header {
    background: linear-gradient(135deg, #0f0c29, #302b63);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}
.assistant-header h3 {
    margin: 0;
    font-size: 1.1rem;
}
.assistant-header h3 i {
    margin-left: 8px;
    color: #FFD700;
}
.close-btn {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.assistant-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9ff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.message {
    max-width: 85%;
    padding: 10px 16px;
    border-radius: 20px;
    line-height: 1.45;
    font-size: 0.9rem;
}
.bot-message {
    background: #e9e9ff;
    color: #1a1a3e;
    align-self: flex-start;
    border-bottom-right-radius: 5px;
    border-right: 3px solid #302b63;
}
.user-message {
    background: #302b63;
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 5px;
}
.options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 5px;
}
.option-btn {
    background: white;
    border: 1px solid #302b63;
    padding: 8px 18px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    color: #302b63;
    font-weight: 500;
}
.option-btn:hover {
    background: #302b63;
    color: white;
    transform: scale(1.02);
}
.input-field {
    width: 90%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.9rem;
    margin-top: 5px;
}
.assistant-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.7rem;
    color: #888;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #888;
    border-radius: 50%;
    animation: blink 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
    0%, 60%, 100% { opacity: 0.2; transform: scale(0.8);}
    30% { opacity: 1; transform: scale(1.2);}
}

.assistant-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: linear-gradient(135deg, #0f0c29, #302b63) !important;
    padding: 10px 18px !important;
    border-radius: 50px !important;
    width: fit-content !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
    border: 1px solid #ffd966 !important;
    transition: 0.2s !important;
}
.assistant-toggle i {
    font-size: 26px !important;
    color: #FFD700 !important;
}
.assistant-toggle span {
    font-size: 15px !important;
    font-weight: bold !important;
    color: white !important;
    font-family: inherit !important;
}
.assistant-toggle:hover {
    transform: scale(1.03);
    background: linear-gradient(135deg, #1a1640, #3b3570);
}


/* اصلاح برای موبایل */
@media (max-width: 768px) {
    .assistant-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: auto !important;
        min-width: 180px !important;
        padding: 8px 16px !important;
        border-radius: 40px !important;
        background: linear-gradient(135deg, #0f0c29, #302b63) !important;
        border: 1px solid #ffd966 !important;
    }
    .assistant-toggle i {
        font-size: 24px !important;
        margin: 0 !important;
        line-height: 1 !important;
    }
    .assistant-toggle span {
        font-size: 14px !important;
        white-space: nowrap !important; /* جلوگیری از شکستن متن */
        color: white !important;
    }
}

