/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-image: url('https://res.cloudinary.com/dzngpgki4/image/upload/v1744547919/Screenshot_2025-04-13_at_5.37.33_PM-removebg-preview_hl9gza.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#chatbot-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 90%; /* 90% width for mobile */
    max-width: 350px; /* Maximum width */
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    max-height: 500px;
    overflow: hidden;
}

#chatbot-container.open {
    display: flex;
}

#chatbot-header {
    background: #eff1f2;
    color: #2d2c2a;
    padding: 15px;
    font-size: 16px; /* Adjusted font size */
    font-weight: bold;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    align-items: center;
}

#chatbot-header img {
    width: 25px;
    height: 25px;
    margin-right: 10px;
    border-radius: 50%;
}

#chatbot-messages {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px; /* Adjusted font size */
}

.message-wrapper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.message-wrapper.bot {
    flex-direction: row;
}

.message-wrapper.user {
    flex-direction: row-reverse;
}

.message {
    padding: 12px;
    margin: 5px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
}

.user {
    background: #155528;
    align-self: flex-end;
    text-align: right;
    color: #ffffff;
}

.bot {
    background: #f3f0f0;
    color: #2d2c2a;
}

.message-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 50%;
}

#chatbot-footer {
    display: flex;
    padding: 10px;
    background: #f1f1f1;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

#chatbot-input {
    flex-grow: 1;
    padding: 12px;
    border: 2px solid green;
    outline: none;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

#chatbot-send {
    margin-left: 10px;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    background-image: url('Chat-icon1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#powered-by {
    text-align: center;
    font-size: 12px;
    color: #ffffff;
    padding: 10px;
    font-weight: bold;
}

#chatbot-container::after {
    content: "Powered by Farmnet";
    display: block;
    text-align: center;
    font-size: 12px;
    color: #555;
    padding: 10px;
}

#chatbot-container, #chatbot-toggle {
    position: fixed !important;
    z-index: 999999 !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #chatbot-toggle {
        right: 10px;
        bottom: 20px;
        width: 125px; /* Smaller toggle on mobile */
        height: 40px; /* Smaller toggle on mobile */
    }

    #chatbot-container {
        bottom: 70px;
        height: 50%;
        width: 70%; /* 90% width for mobile */
        max-width: 320px; /* Maximum width */
    }

    #chatbot-header {
        font-size: 14px; /* Smaller header font size */
    }

    #chatbot-messages {
        font-size: 12px; /* Smaller message font size */
    }

    .message-wrapper {
        margin-bottom: 5px; /* Adjusted for mobile */
    }

    .message {
        font-size: 12px; /* Smaller message font size */
        padding: 10px; /* Adjusted padding */
    }

    #chatbot-input {
        font-size: 12px; /* Smaller input font size */
    }

    #chatbot-send {
        width: 35px; /* Smaller send button */
        height: 35px; /* Smaller send button */
    }
}
#chatbot-close:hover {
    color: #155528;
}
