/* Messages App Layout */
.anima-messages-app {
    display: flex;
    height: 75vh;
    min-height: 500px;
    background-color: var(--color-anima-bg-card);
    border: 1px solid var(--color-anima-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Sidebar */
.messages-sidebar {
    width: 320px;
    border-right: 1px solid var(--color-anima-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-anima-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
}

.threads-list-container {
    flex-grow: 1;
    overflow-y: auto;
}

.thread-item {
    padding: var(--spacing-md);
    display: flex;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.thread-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.thread-item.active {
    background-color: rgba(var(--color-anima-primary-rgb), 0.1);
    border-left: 3px solid var(--color-anima-primary);
}

.thread-avatar img {
    border-radius: 50%;
    object-fit: cover;
}

.thread-info {
    flex-grow: 1;
    overflow: hidden;
}

.thread-participants {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-preview {
    font-size: 13px;
    color: var(--color-anima-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Area */
.messages-main-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.1);
}

#chat-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-area {
    padding: 20px;
    background-color: var(--color-anima-bg-card);
    border-top: 1px solid var(--color-anima-border);
}

#anima-chat-form {
    display: flex;
    gap: 10px;
}

#message_content {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-anima-border);
    border-radius: 20px;
    padding: 12px 15px;
    color: var(--color-anima-text-main);
    resize: none;
    line-height: 1.4;
}

#message_content:focus {
    outline: none;
    border-color: var(--color-anima-primary);
}

.btn-send {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Bubbles */
.chat-bubble-row {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.row-me {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
}

.bubble-me {
    background-color: var(--color-anima-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble-them {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-anima-text-main);
    border-bottom-left-radius: 4px;
}

.bubble-meta {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

.chat-placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-anima-text-muted);
}

.chat-placeholder-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}