#chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 9999;
}

#chatbot-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #5a7ce2, #6f8df5);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: 0.3s ease;
    position: relative;
}

#chatbot-btn:hover {
    transform: scale(1.1);
    background: #28375f;  
    border-color:  #303d61;
    box-shadow: 0 0 0 0.2rem rgba(114, 145, 233, 0.5) !important;
}

.fab-tooltip {
    position: absolute;
    right: 66px;
    background: #28375f;    
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-family: 'Open Sans', sans-serif;
}

#chatbot-btn:hover .fab-tooltip { opacity: 1; }

#chatbot-box {
    width: 320px;
    height: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: absolute;
    bottom: 75px;
    right: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #5a7ce2, #8a9de4);
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

#close-chat {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f7f9fc;
}

.msg-wrapper {
    display: flex;
    margin: 6px 10px;
    animation: fadeSlide 0.2s ease;
}

.msg-user-wrap { justify-content: flex-end; }
.msg-bot-wrap  { justify-content: flex-start; }

.user-msg,
.bot-msg {
    padding: 9px 13px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    max-width: 80%;
}

.user-msg {
    background: linear-gradient(135deg, #5a7ce2, #6f8df5);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    text-align: left;
}

.bot-msg {
    background: #e9f0ff;
    color: #1a2540;
    border-radius: 18px 18px 18px 4px;
    display: inline-block;
}

.bot-msg strong {
    font-weight: 700;
    color: #1a2540;
}

/* urdu conversion direction */
.bot-msg:has([lang="ur"]),
.bot-msg[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.chat-list-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 4px 0;
    line-height: 1.5;
}

.chat-num {
    font-weight: 700;
    color: #5a7ce2;
    min-width: 20px;
    flex-shrink: 0;
}

.chat-text {
    flex: 1;
    color: #1a2540;
}

.chat-footer {
    display: flex;
    border-top: 1px solid #eee;
}

.chat-footer input {
    flex: 1;
    border: none;
    padding: 10px;
    outline: none;
}

.chat-footer button {
    background: #5a7ce2;
    border: none;
    color: #fff;
    padding: 0 15px;
    cursor: pointer;
}

#chat-input {
    resize: none;
    border: none;
    outline: none;
    padding: 10px;
    width: 100%;
    max-height: 80px;
    overflow-y: auto;
}

#chat-input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    min-width: 60px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5a7ce2;
    display: inline-block;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* Animations  */
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-6px); opacity: 1; }
}

/* Scrollbar */
.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f0f4ff;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #b0c0f0;
    border-radius: 10px;
}

@media (max-width: 480px) {
    #chatbot-box {
        width: 90vw;
        right: 5%;
    }
}

