/* static/css/chat-and-discussions.css */

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-bubble-wrapper {
    display: flex;
    gap: 0.75rem;
    max-width: 75%;
    align-items: flex-end;
}

.message-bubble-wrapper.sent {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
    max-width: 100%;
}

.message-bubble.received {
    background-color: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 4px;
}

.message-bubble.sent {
    background-color: #0d6efd;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-meta {
    font-size: 0.75rem;
    color: #6c757d;
    padding: 0 0.25rem;
}

.message-bubble-wrapper.sent .message-meta {
    text-align: right;
}

/* Responsive styles for the discussion form */
@media (max-width: 768px) {
    .chat-input-area {
        flex-wrap: wrap; /* Allows items to wrap onto the next line */
    }

    .chat-input-area .flex-grow-1 {
        flex-basis: 100%; /* Makes the textarea take the full width */
        margin-bottom: 0.5rem; /* Adds some space below the textarea */
    }

    .chat-input-area button {
        flex-grow: 1; /* Allows buttons to share the remaining space */
    }
}