/* Основной макет чата (Telegram-стиль) */
.chat-container {
    display: flex;
    height: 100%;
    background-color: var(--chat-bg);
}

/* Левая панель (список чатов) */
.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    background-color: white;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-header h3 { font-size: 18px; }

.chat-list {
    flex: 1;
    overflow-y: auto;
}
.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.chat-item:hover { background: #f4f4f5; }
.chat-item.active { background: #e3f2fd; }
.chat-item-avatar { margin-right: 12px; }
.chat-item-info { flex: 1; }
.chat-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}
.chat-item-last {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 12px;
    color: var(--text-secondary);
}
.unread-badge {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    margin-top: 4px;
}

/* Правая панель (сообщения) */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
}
.chat-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    background: white;
}
.chat-header-info { margin-left: 12px; }
.chat-header-name { font-weight: 600; }
.chat-header-status {
    font-size: 13px;
    color: var(--text-secondary);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.message {
    display: flex;
    max-width: 70%;
}
.message-out {
    align-self: flex-end;
}
.message-in {
    align-self: flex-start;
}
.message-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--message-in-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}
.message-out .message-bubble {
    background: var(--message-out-bg);
}
.message-text { word-wrap: break-word; }
.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.message-status {
    display: inline-block;
    width: 14px;
    height: 14px;
}

.chat-input-area {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    resize: none;
    font-size: 14px;
}
