/* chat-widget.css — تصميم بوت تكامل الذكي المطور */

:root {
    --chat-primary: #7c3aed;
    --chat-secondary: #4f46e5;
    --chat-glass: rgba(255, 255, 255, 0.9);
    --chat-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
    --chat-bg-gradient: linear-gradient(135deg, #7c3aed, #4f46e5);
}

/* زر إطلاق البوت */
#takamule-chat-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--chat-bg-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.35);
    cursor: pointer;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
}

#takamule-chat-launcher:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 20px 45px rgba(124, 58, 237, 0.5);
}

/* نافذة الدردشة */
#takamule-chat-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: var(--chat-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    direction: rtl;
    overflow: hidden;
}

#takamule-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* رأس النافذة */
.chat-window-header {
    padding: 20px 25px;
    background: var(--chat-bg-gradient);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-bot-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-bot-info h3 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.chat-bot-status {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-bot-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

/* منطقة الرسائل */
#chat-messages-container {
    flex: 1;
    padding: 25px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(248, 250, 252, 0.4);
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 600;
    animation: messageIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.message.bot {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
}

.message.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.15);
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 20px;
    display: none;
    align-self: flex-start;
    gap: 5px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--chat-primary);
    border-radius: 50%;
    opacity: 0.4;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* منطقة الإدخال */
.chat-window-input {
    padding: 15px 20px 30px;
    display: flex;
    gap: 10px;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.chat-input-field {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    font-weight: 600;
    font-family: inherit;
    background: #f8fafc;
}

.chat-input-field:focus {
    border-color: var(--chat-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    background: var(--chat-primary);
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    transform: scale(1.05) rotate(-5deg);
    background: var(--chat-secondary);
}

/* التنسيق للجوال */
@media (max-width: 480px) {
    #takamule-chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        z-index: 100000;
    }
    
    .chat-window-header {
        padding: 30px 20px 15px;
    }
    
    #takamule-chat-launcher.active {
        display: none;
    }
}

