#ai-chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 16px 8px 16px;
    overflow-y: hidden;
}

#ai-chat-layout-wrapper {
    position: fixed;
    display: flex;
    top: var(--nav_height);
    bottom: 0;
    left: 0;
    right: 0;
}

#obrazavr-ai-chat-container {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#obrazavr-chat-messages {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 48px 0;
}

#obrazavr-chat-user-input {
    resize: none;
    overflow-y: hidden;
    background-color: transparent;
    border: none;
    flex-grow: 1;
    padding: 0 0 0 10px;
}

.ww-bw{
    word-wrap: anywhere;
}


.ai-chat-bubble.user-message {
    background-color: var(--secondary_background);
    padding: 12px 18px;
    border-radius: var(--radius);
}

.ai-chat-bubble .rating-container {
    margin-top: 10px;
}

.typing-indicator {
    display: flex;
    align-items: center;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: var(--secondary);
    border-radius: 50%;
    display: inline-block;
}

#ai-chat-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--secondary_background);
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: var(--border);
}

#ai-chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.history-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background-color: var(--secondary_background);
    border: 2px solid transparent;
}

.history-link:hover {
    background-color: var(--secondary_background1);
    color: var(--main);
}

.history-link.active {
    background-color: var(--lightblue);
    border-color: var(--blue_border);
    color: var(--blue_text);
}

.history-link.active .history-date {
    color: var(--blue_text);
}

.history-title {
    font-size: 16px;
    font-weight: var(--main_bold_weight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.history-date {
    font-size: 14px;
}

.history-delete-btn {
    font-size: 24px;
    font-weight: var(--main_bold_weight);
    color: var(--lightgray_2);
    padding: 0 5px;
    border-radius: 5px;
    line-height: 1;
}

.history-link:hover .history-delete-btn {
    color: var(--secondary);
}

.history-link.active .history-delete-btn {
    color: var(--blue_text);
}


#obrazavr-chat-image-preview-container {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

#obrazavr-chat-image-preview {
    max-width: 100px;
    max-height: 100px;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

#obrazavr-chat-remove-image-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    position: absolute;
    top: -8px;
    right: -8px;
}

.ai-chat-bubble.user-message .message-image-container {
    margin-bottom: 10px;
}

.chat-uploaded-image {
    max-width: 100%;
    border-radius: var(--radius);
}

#obrazavr-ai-chat-container.drag-over {
    border: 2px dashed var(--accent);
}

.ai-chat-history-header .ai-chat-accordion-toggle {
    display: none;
}

.ai-chat-history-content {
    display: block;
}

#obrazavr-chat-send-btn {
    appearance: none;
    outline: none;
    border: none;
    border-radius: 50%;
    background-color: var(--accent);
    min-width: 36px;
    height: 36px;
    transition: 0.1s linear background-color;
}

#obrazavr-chat-send-btn:disabled {
    background-color: var(--secondary_background_2);
}

#obrazavr-chat-send-btn img {
    width: 15px;
    height: 15px;
}

#obrazavr-chat-attach-btn {
    border-radius: 50%;
    background-color: var(--secondary_background);
    min-width: 36px;
    height: 36px;
}

#obrazavr-chat-attach-btn img {
     width: 15px;
    height: 15px;
} 

#obrazavr-chat-input-area {
    border-radius: 999px;
    border: 1px solid var(--lightgray);
    gap: 5px;
    padding: 10px;
    transition: border-radius 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

#obrazavr-chat-input-area.tall {
    border-radius: var(--radius);
}

#mobile_ai_sidebar_opener {
    display: none;
    position: absolute;
    top: 10px;
    right: 0;
    left: 0;
    width: 120px;
    margin: auto;
    background-color: var(--secondary_background);
    padding: 6px 15px;
    border-radius: 1000px;
    font-size: 14px;
    gap: 8px;
}

#mobile_ai_sidebar_opener img {
    width: 16px;
    height: 16px;
}

.ai-chat-history-content {
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#ai-chat-history-list {
    max-height: none;
    flex-grow: 1;
}

@media (max-width: 765px) {
    #ai-chat-layout-wrapper {
        flex-direction: column;
    }
    #mobile_ai_sidebar_opener {
        background-color: var(--secondary_background_2);
    }
    #ai-chat-sidebar {
        position: absolute;
        width: 100%;
        top: 0;
        height: 100%;
        padding: 52px 24px 24px;
    }

    #mobile_ai_sidebar_opener {
        display: flex;
    }

    #ai-chat-sidebar:not(.opened) {
        display: none;
    }

    .ai-chat-bubble {
        padding: 8px 12px;
        max-width: 92%;
    }

}

@media (min-width: 765px) {
    body.page-template-template-ai-chat {
        overflow: hidden;
    }

    #obrazavr-chat-messages {
        padding-top: 60px;
    }
}