.ChatAT-chat-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    position: relative;
    overflow: hidden;
    /*-webkit-font-smoothing: antialiased;*/
}
.ChatAT-messages-container {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 1rem;
    margin-bottom: 70px; /* Space for input container */
    margin-top: 40px; /* Space for navigation container */
    height: calc(100dvh - 70px); /* Adjust height to account for input container */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.ChatAT-messages-container::-webkit-scrollbar {
    width: 0px;                   /* Chrome/Safari */
    background: transparent;      /* Optional: just in case */
}

.ChatAT-message {
    margin-bottom: 1rem;
    
}

.ChatAT-message-user {
    margin-left: auto;
    max-width: 80%;
    display: inline-block;
    display: flex;
    justify-content: flex-end; 
}

.ChatAT-message-ai {
    margin-right: auto;
    width: 100%;
}

.ChatAT-message-function-blank {
    /*move the rendered function output closer to the following message*/
    visibility: hidden;
    margin-bottom: -35px;
}

.ChatAT-message-content {
    padding: 0.75rem;
    border-radius: 1rem;
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    /* Fix for Safari emoji rendering */
    /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;*/
    word-wrap: break-word !important;
    overflow-wrap: break-word;
    white-space: pre-wrap;    
}

.ChatAT-message-user .ChatAT-message-content {
    background: #3C9A52;
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.ChatAT-message-ai .ChatAT-message-content {
    background: white;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 0.25rem;    
}

.ChatAT-message-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    width: fit-content;
    min-height: 43px;
}

.ChatAT-message-content-block{
    display: block !important;
    width: 100%;
}

.ChatAT-loading-dot {
    width: 8px;
    height: 8px;
    background: #3C9A52;
    border-radius: 50%;
    animation: loading 1s infinite;
}

.ChatAT-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ChatAT-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.ChatAT-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 0.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.ChatAT-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: none;
    font-size: 1rem;
    line-height: 1.5;
}

.ChatAT-send-button {
    padding: 8px 16px;
    background: #3C9A52;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.ChatAT-send-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.ChatAT-message-typing {
    visibility: hidden;
}

.ChatAT-message-typing::after {
    visibility: visible;
    content: attr(data-text);
    position: absolute;
    left: 16px;
    right: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
}

.ChatAT-message-typing.animate::after {
    animation: typeText 2s linear;
    animation-fill-mode: forwards;
}


.ChatAT-loading-container {
    display: flex;
    align-items: center;
    gap: 3px;
}

.ChatAT-loading-text {
    color: var(--chat-at-text-color);    
    margin-left: 5px;
}

@keyframes typeText {
    0% {
        max-width: 0;
    }
    100% {
        max-width: 100%;
    }
}

.ChatAT-typing-char {
    opacity: 0;
    transition: opacity 0.1s ease-in;
}

.ChatAT-typing-char.visible {
    opacity: 1;
}

/* Desktop styles */
@media screen and (min-width: 789px) {
    .ChatAT-input-container {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 30px);
        max-width: 800px;
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .ChatAT-messages-container {
        margin-bottom: 0px; /* Increased space for floating input */
        /*margin-top: 0px;*/
        padding-bottom: 80px;
    }
    .ChatAT-chat-container{        
        height: 100dvh;/*calc(100dvh - 75px); Adjust height for desktop floating input */
    }
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .ChatAT-input-container {
        position: sticky;
        bottom: 0px;
        border-radius: 0px;
        padding: 12px 16px;
        width: calc(100% - 0px);
    }
    
    .ChatAT-messages-container {
        margin-bottom: 0px;
        padding-bottom: 0;
    }
} 
#ChatAT-loading-text-container{
    display: inline-block;
    
}