body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #15124dbb;
    color: #62c79f;
    height: 100vh;
    overflow: hidden;
}

/* ===== Сайдбар ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100%;
    background: #100e37bb;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #100e37bb;
}

.top-bar h2 {
    margin: 0;
    font-size: 22px;
}

.settings-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

/* ===== Список чатов ===== */
#chatList {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 12px;
    margin: 5px;
    background: #100e37bb;
    cursor: pointer;
    transition: 0.2s;
}

.chat-item:hover {
    background: #7289da;
}

.chat-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.chat-info {
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-weight: bold;
}

.chat-last {
    font-size: 13px;
    color: #b9bbbe;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

/* ===== Чат контейнер ===== */
.chat-container {
    margin-left: 260px;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: #36393f;
}

.messages {
    display: flex;
    flex-direction: column-reverse;
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 10px;
    padding-right: 5px;
}

/* ===== Сообщения ===== */
.message {
    background: linear-gradient(90deg, #7289da, #99aab5);
    margin: 5px 0;
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 70%;
    align-self: flex-start;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
}

.message.self {
    background: linear-gradient(90deg, #99aab5, #7289da);
    align-self: flex-end;
}

.message button {
    position: absolute;
    top: 5px;
    right: 8px;
    border: none;
    background: transparent;
    color: #ff5555;
    cursor: pointer;
    font-size: 16px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

/* ===== Поле ввода ===== */
.send-message {
    display: flex;
    gap: 10px;
    background: #2f3136;
    padding: 10px;
    border-radius: 15px;
}

.send-message input[type="text"] {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 12px;
    border: none;
    outline: none;
    background: #40444b;
    color: #fff;
    font-size: 16px;
}

.send-message button {
    padding: 10px 15px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(90deg, #7289da, #99aab5);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.send-message button:hover {
    background: linear-gradient(90deg, #99aab5, #7289da);
}