/* Basic Reset & Variables injected via JS */
#hfc-widget-container { position: fixed; bottom: 20px; z-index: 9999; font-family: Tahoma, Arial, sans-serif; }
#hfc-widget-container.right { right: 20px; }
#hfc-widget-container.left { left: 20px; }

#hfc-toggle-btn {
    width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
    font-size: 28px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center;
    background: #1a1a1a; color: #fff; transition: transform 0.3s;
}
#hfc-toggle-btn:hover { transform: scale(1.05); }

#hfc-chat-box {
    display: none; width: 350px; height: 500px; border-radius: 10px; overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); flex-direction: column; margin-bottom: 15px;
    background: #fff;
}

/* کلاسی که با جاوا اسکریپت اضافه می‌شود تا فلکس باکس فعال بماند */
#hfc-chat-box.hfc-open {
    display: flex;
}

#hfc-header { padding: 15px; color: #fff; font-weight: bold; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
#hfc-close-btn { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

#hfc-messages { 
    flex: 1; 
    min-height: 0; /* این خط برای فعال شدن اسکرول در فلکس باکس ضروری است */
    padding: 15px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    background: #ffffff; 
}

.hfc-msg { max-width: 75%; padding: 10px 15px; border-radius: 15px; line-height: 1.4; font-size: 14px; word-wrap: break-word; }
.hfc-msg.agent { background: #f1f1f1; align-self: flex-start; border-bottom-left-radius: 0; color: #000; }
.hfc-msg.user { background: #0a0a0a; color: #fff; align-self: flex-end; border-bottom-right-radius: 0; }
.hfc-msg.bot { background: #e6f7ff; align-self: flex-start; border-bottom-left-radius: 0; color: #000; border: 1px solid #91d5ff; }

#hfc-typing-indicator { display: none; font-size: 12px; color: #888; padding: 0 15px 10px; flex-shrink: 0; }

#hfc-input-area { display: flex; padding: 10px; border-top: 1px solid #eee; background: #f9f9f9; flex-shrink: 0; }
#hfc-message-input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 20px; outline: none; font-family: inherit; }
#hfc-send-btn { background: #1a1a1a; color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; margin-right: 10px; cursor: pointer; font-size: 16px; }