@import url('../assets/css/common.css');

.chat-container {
    display: flex;
    height: 100vh;
    background: #fff;
}

/* Сайдбар */
.sidebar {
    width: 300px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.user-info {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-info span {
    font-weight: 600;
}

.search-container {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.search-container input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-list h3 {
    padding: 10px 20px;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
}

.chat-item {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f5f5f5;
}

.chat-item.active {
    background: #e3f2fd;
}

.chat-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.chat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.last-message {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Область чата */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    font-weight: 600;
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.message.own-message {
    align-items: flex-end;
}

.message.other-message {
    align-items: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.own-message .message-content {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.other-message .message-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.file-attachment {
    margin-top: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    font-size: 14px;
}

.own-message .file-attachment {
    background: rgba(255,255,255,0.2);
}

.message-input-container {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    display: flex;
    align-items: flex-end;
}

.message-input-container textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    resize: none;
    height: 44px;
    max-height: 120px;
    font-size: 14px;
}

.message-input-container button {
    margin-left: 10px;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border-radius: 20px;
    font-weight: 600;
    transition: background 0.2s;
}

.message-input-container button:hover {
    background: #0056b3;
}

#attachButton {
    background: #6c757d;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

#attachButton:hover {
    background: #545b62;
}

/* Индикатор набора сообщения */
.typing-indicator {
    padding: 0 20px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    height: 20px;
}
