/* HFC Elite Assistant - Professional Stylesheet 
   Gradient: linear-gradient(66deg, rgb(63 94 251) 0%, rgb(0 188 212) 100%)
*/

:root {
    --main-gradient: linear-gradient(66deg, rgb(63 94 251) 0%, rgb(0 188 212) 100%);
    --accent-blue: rgb(63, 94, 251);
    --bot-bg: #f2f5f9;
    --shadow-deep: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* 1. أيقونة الشات مع تأثير النبض */
#chat-icon { 
    position: fixed; bottom: 25px; left: 25px; z-index: 99999;
    background: var(--main-gradient);
    color: #fff; border-radius: 50%; width: 65px; height: 65px; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; font-size: 28px; box-shadow: var(--shadow-deep); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

#chat-icon::before {
    content: ''; position: absolute; width: 100%; height: 100%;
    background: var(--main-gradient); border-radius: 50%; z-index: -1;
    animation: pulseBorder 2s infinite; opacity: 0.6;
}

@keyframes pulseBorder {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* 2. نافذة الشات والأنيميشن الجذاب */
#chat-window { 
    position: fixed; bottom: 105px; left: 25px; width: 380px; 
    height: 70vh; max-height: 580px; background: #fff; 
    border-radius: 24px; display: none; flex-direction: column; 
    box-shadow: var(--shadow-deep); overflow: hidden; z-index: 99998;
    border: 1px solid rgba(0,0,0,0.05);
}

/* أنيميشن الدخول (النافذة + المحتوى) */
#chat-window.active {
    display: flex !important;
    animation: entranceAnim 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#chat-window.active #chat-box, 
#chat-window.active #chat-header,
#chat-window.active #chat-input {
    animation: contentReveal 0.8s ease-out 0.2s both;
}

@keyframes entranceAnim {
    0% { opacity: 0; transform: scale(0.5) translateY(100px) rotate(-5deg); filter: blur(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0) rotate(0); filter: blur(0); }
}

@keyframes contentReveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 3. الهيدر */
#chat-header { 
    background: var(--main-gradient); color: #fff !important; 
    padding: 20px; font-weight: 800; display: flex; 
    justify-content: space-between; align-items: center; font-size: 17px;
}

#chat-header button { 
    border: none; background: rgba(255,255,255,0.2); 
    color: #fff !important; width: 35px; height: 35px; 
    border-radius: 12px; cursor: pointer; transition: 0.3s;
}

/* 4. صندوق الرسائل */
#chat-box { flex: 1; padding: 20px; overflow-y: auto; background: #fff; display: flex; flex-direction: column; gap: 15px; }

.bot-message, .user-message { 
    padding: 12px 18px; border-radius: 18px; max-width: 85%; 
    font-size: 14.5px; line-height: 1.6; position: relative;
    animation: messagePop 0.3s ease-out;
}

@keyframes messagePop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.bot-message { background: var(--bot-bg); color: #2c3e50; align-self: flex-start; border-bottom-left-radius: 4px; }
.user-message { background: var(--main-gradient); color: #fff !important; align-self: flex-end; border-bottom-right-radius: 4px; }

/* 5. زر Go to Source المحسن */
.source-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 20px;
    background: rgba(63, 94, 251, 0.08);
    color: var(--accent-blue) !important;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    border: 1.5px solid var(--accent-blue);
    cursor: pointer !important; /* التأكد من ظهور شكل اليد */
    transition: all 0.3s ease;
}

.source-link:hover {
    background: var(--main-gradient);
    color: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(63, 94, 251, 0.3);
}

/* 6. أزرار الاقتراحات (حل مشكلة الالتصاق) */
.suggestions { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; /* مسافة أفقية ورأسية بين الأزرار */
    margin-top: 15px;
    padding: 5px;
}

.suggestions button {
    padding: 10px 18px;
    border: 1.5px solid var(--accent-blue);
    border-radius: 25px;
    background: #fff;
    color: var(--accent-blue) !important;
    cursor: pointer !important;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
    white-space: nowrap; /* منع انقسام النص داخل الزر */
}

.suggestions button:hover {
    background: var(--main-gradient);
    color: #fff !important;
    border-color: transparent;
    transform: scale(1.05);
}

/* 7. منطقة الإدخال */
#chat-input { padding: 15px; background: #fff; border-top: 1px solid #eee; display: flex; gap: 10px; }
#chat-input input { 
    flex: 1; padding: 12px 18px; border: 2px solid #f0f0f0; 
    outline: none; border-radius: 14px; transition: 0.3s;
}
#chat-input input:focus { border-color: var(--accent-blue); }

#chat-input button { 
    background: var(--main-gradient); color: #fff !important; 
    width: 48px; height: 48px; border: none; border-radius: 14px; 
    cursor: pointer !important; transition: 0.3s;
}

/* محو الألوان الإضافية */
#wc { background: transparent !important; color: inherit !important; }
.status-dot { width: 10px; height: 10px; background: #00e676; border-radius: 50%; margin-right: 8px; }