/* Chatbox container */
#ai-chatbot-agent-box {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 320px;
    max-width: 92vw;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 9999;
    font-family: 'Poppins', 'Lato', 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    margin: 0;
    transition: box-shadow 0.2s;
}

#ai-chatbot-agent-box .chat-header {
    background: #fff;
    color: #18181a;
    padding: 14px 18px 8px 18px;
    font-weight: 600;
    text-align: left;
    font-size: 1.02rem;
    letter-spacing: 0.2px;
    border-bottom: none;
    display: flex;
    align-items: center;
    min-height: 44px;
    height: 44px;
    margin-bottom: 0;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
    font-family: 'Poppins', 'Lato', 'Segoe UI', Arial, sans-serif;
}

#ai-chatbot-agent-box .chat-header .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-right: 8px;
}

#ai-chatbot-agent-box .chat-header .status {
    color: #1bbf4c;
    font-size: 0.95em;
    margin-left: 2px;
}

#ai-chatbot-agent-box .chat-header .end-chat {
    color: #e74c3c;
    font-size: 0.98em;
    margin-left: auto;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}
#ai-chatbot-agent-box .chat-header .end-chat:hover {
    color: #b93222;
}

#ai-chatbot-agent-box .chat-header .close-btn {
    background: none;
    border: none;
    color: #18181a;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    margin-left: 8px;
}
#ai-chatbot-agent-box .chat-header .close-btn:hover {
    background: #f3f3f3;
    color: #e74c3c;
}

#ai-chatbot-agent-box .chat-messages {
    flex: 1 1 auto;
    padding: 12px 8px 8px 10px;
    overflow-y: auto;
    background: #fafbfc;
    font-size: 1rem;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 96%;
    margin: 0 auto;
    max-height: 50vh;
    min-height: 120px;
    height: 320px;
}

#ai-chatbot-agent-box .chat-message {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    margin-bottom: 0;
}

#ai-chatbot-agent-box .chat-message.user {
    justify-content: flex-end;
}
#ai-chatbot-agent-box .chat-message.agent {
    justify-content: flex-start;
}

#ai-chatbot-agent-box .chat-bubble {
    padding: 8px 14px;
    border-radius: 16px 16px 4px 16px;
    max-width: 80%;
    font-size: 0.97rem;
    line-height: 1.35;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 2px;
    word-break: break-word;
}
#ai-chatbot-agent-box .chat-message.user .chat-bubble {
    background: #23232b;
    color: #fff;
    border-radius: 16px 16px 16px 4px;
    align-self: flex-end;
    font-family: 'Poppins', 'Lato', 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
}
#ai-chatbot-agent-box .chat-message.agent .chat-bubble {
    background: #f3f3f3;
    color: #23232b;
    border-radius: 16px 16px 4px 16px;
    align-self: flex-start;
    font-family: 'Poppins', 'Lato', 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
}

#ai-chatbot-agent-box .chat-input {
    display: flex;
    background: #fff;
    padding: 8px 16px 10px 16px;
    border-top: 1.5px solid #f3f3f3;
    align-items: center;
    gap: 10px;
    border-radius: 0 0 20px 20px;
}

#ai-chatbot-agent-box .chat-input textarea {
    flex: 1;
    border: 1.2px solid #ececec;
    padding: 3px 10px;
    resize: none;
    font-size: 1rem;
    border-radius: 12px;
    background: #fafbfc;
    color: #18181a;
    margin-right: 0;
    transition: border 0.2s, box-shadow 0.2s;
    min-height: 22px;
    max-height: 28px;
    outline: none;
    box-shadow: none;
    line-height: 1.3;
    font-family: 'Poppins', 'Lato', 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
}
#ai-chatbot-agent-box .chat-input textarea:focus {
    outline: none;
    border-color: #18181a;
    background: #fff;
    box-shadow: 0 0 0 2px #23232b22;
}

#ai-chatbot-agent-box .chat-input textarea::placeholder {
    color: #bdbdbd;
    opacity: 1;
    font-size: 1rem;
    font-style: italic;
    letter-spacing: 0.1px;
}

#ai-chatbot-agent-box .chat-input button {
    border: none;
    background: #18181a;
    color: #fff;
    padding: 0 18px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 600;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    font-family: 'Poppins', 'Lato', 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
}
#ai-chatbot-agent-box .chat-input button:hover {
    background: #23232b;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
#ai-chatbot-agent-box .chat-input button .send-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

/* Placeholder style for input */
#ai-chatbot-agent-box .chat-input textarea::placeholder {
    color: #bdbdbd;
    opacity: 1;
    font-size: 1rem;
}

/* Scrollbar styling */
#ai-chatbot-agent-box .chat-messages::-webkit-scrollbar {
    width: 8px;
    background: #f3f3f3;
    border-radius: 8px;
}
#ai-chatbot-agent-box .chat-messages::-webkit-scrollbar-thumb {
    background: #ececec;
    border-radius: 8px;
}

/* Floating help button */
#ai-chatbot-agent-help-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 54px;
    height: 54px;
    background: #18181a;
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 9998;
    border: none;
    transition: background 0.2s, box-shadow 0.2s;
}
#ai-chatbot-agent-help-btn:hover {
    background: #23232b;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

@media (max-width: 600px) {
  #ai-chatbot-agent-box {
    width: 98vw;
    right: 1vw;
    left: 1vw;
    min-width: unset;
    max-width: 99vw;
  }
  #ai-chatbot-agent-box .chat-messages {
    max-height: 38vh;
    height: 180px;
  }
}
