
input.udap-chatbot-input {
    max-height: 49px;
    height: 20px;
}

/* --- NEW Styles for Chatbot Layout --- */

/* The main container provided by the shortcode */
.studysprout-chatbot-container {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Header area containing the 'Save for Later' button */
.chatbot-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    text-align: right;
}

/* The scrolling message area - UPDATED */
#chatbot {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 500px; /* Adjust as needed */
    overflow-y: auto; /* Allows vertical scrolling for messages */
    overflow-x: hidden; /* Hides the horizontal scrollbar */
    background-color: #ffffff;
}

/* --- Original Styles (with minor adjustments) --- */

/* Universal Chat Bubble Styling */
.udap-chat-message {
    padding: 12px 18px;
    margin: 8px 0;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 1rem;
    max-width: 90%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in;
    white-space: pre-wrap;
}

/* AI Bubble (bot) */
.udap-chat-message.ai {
    background: #f1f1f1;
    color: #212529;
    align-self: flex-start;
}

/* User Bubble */
.udap-chat-message.user {
    background: #d1e7ff;
    color: #212529;
    align-self: flex-end;
    text-align: right;
    position: relative;
}

/* Edit Button */
.edit-answer-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 11px;
    line-height: 1;
    padding: 5px;
    width: 26px;
    height: 26px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

.edit-answer-btn:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

/* Chat Input Field */
#chatbot .udap-chatbot-input {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 15px;
    margin-top: 10px;
    font-size: 1rem;
    font-family: inherit;
    border-radius: 18px;
    border: 1px solid #ccc;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 48px !important;
    min-height: 48px !important;
    resize: none !important;
    line-height: 1.5 !important;
}


#chatbot .udap-chatbot-input:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15) !important;
}

/* Save For Later Button */
.udap-save-btn {
    background-color: #0d6efd;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s, opacity 0.3s;
    margin: 0;
}

.udap-save-btn:hover {
    background-color: #0b5ed7;
}

.udap-save-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Bubble Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}