.chat-header {
    display: flex;
    align-items: center;
    background-color: #0D0D0D;
    color: #949494;
    height: 65px;
    padding: 0 15px;
    font-size: 7px;
    font-weight: bold;
    text-align: left;
    flex-shrink: 0;
}
.chat-header h1 {
    font-size: 14px;
    font-weight: 600;
    color: #CFCFCF;
    margin: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.chat-name {
    font-size: 15px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
    padding-left: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: calc(100% - 50px);
}
.chat-status {
    font-size: 13px;
    color: #ffffff;
    margin: 0;
    padding-left: 9px;
    font-weight: 300;
}

.dialog-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0px;
}



/* Область сообщений - прокручивается */
.chat-messages {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 15px;
    background: var(--card);
    border-radius: var(--cat-card-radius);
    /* border-top: 1px solid #1C1C1C; */
    /* min-height: 400px; */
}
/* Псевдоэлемент, занимающий всё свободное пространство сверху */ */
.chat-messages::before {
    content: "";
    flex: 1;
}
/* Базовый стиль сообщения */
.chat-message {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    max-width: 70%;
    padding: 10px;
    margin: 5px 0;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: #CFCFCF;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-word;
}


/* Фиксированная область ввода сообщения */
/* .chat-input-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #101010;
    border-top: 1px solid #1C1C1C;
    z-index: 20;
} */
.chat-input-container textarea {
    flex: 1;
    resize: none;
    overflow: hidden;
    padding: 10px 15px;
    border: none;
    outline: none;
    border-radius: 15px;
    background-color: #1C1C1C;
    color: #FFFFFF;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    min-height: 26px;
    max-height: 120px;
    margin: 0 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.chat-input-container textarea::-webkit-scrollbar {
    display: none;
}
.chat-input-container textarea {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.chat-input-container .attach-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 0;
    transition: opacity 0.3s ease;
}
.chat-input-container .attach-button:hover {
    opacity: 0.7;
}
.chat-input-container .attach-icon {
    width: 30px;
    height: 30px;
}
.chat-input-container .send-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0;
    transition: opacity 0.3s ease;
}
.chat-input-container .send-button:hover {
    opacity: 0.7;
}
.chat-input-container .send-icon {
    width: 30px;
    height: 30px;
}


/* Для прикрепленных файлов */
.file-preview {
    margin-top: 10px;
}

/* === Сбросим фон/паддинги, вернём max-width 70% === */
.chat-message.image {
    background: transparent;
    padding: 0;
    margin: 8px 0;
    max-width: 70%;
}
/* === Сама картинка без рамок, с закруглениями === */
.message-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: none !important;
    border-radius: inherit;
    object-fit: cover;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.file-block {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    background-color: #1C1C1C;
    border-radius: 5px;
    margin-bottom: 5px;
}
.file-block img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}
.file-block span {
    color: #fff;
    font-size: 14px;
}

/* Для сообщений с одним изображением без текста */
.chat-message.single-image {
    position: relative;
    padding: 0;
    background: transparent;
}
.chat-message.single-image .message-content {
    padding: 0;
    background: transparent;
}
.chat-message.single-image .message-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}
.chat-message.single-image .message-time {
    position: absolute;
    bottom: 7px;
    right: 10px;
    background-color: rgba(48,48,48,0.7);
    color: #CFCFCF;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 2;
}

/* Для сообщений с несколькими изображениями или текстом */
.chat-message.has-image .message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    margin: 5px 0;
    object-fit: cover;
}


@media (max-width: 768px) {
    html, body {
        margin: 0;
        padding: 0;
        height: 100vh;
        overflow: hidden;
        background-color: #1c1c1c;
    }

    .background {
        height: 100vh;
        overflow: hidden;
    }

    .mobile-container {
        height: 100vh;
        overflow-y: auto; /* Разрешает вертикальную прокрутку */
        -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
        display: flex;
        flex-direction: column;
        border-radius: 0px;
        margin: 0 auto;
        
    }

    /* Скрываем скроллбар в Firefox и IE/Edge */
    html, body, .mobile-container {
        scrollbar-width: none;        /* Firefox */
        -ms-overflow-style: none;     /* IE 10+ */
    }

    /* Скрываем скроллбар в WebKit-браузерах (Chrome, Safari, Opera) */
    html::-webkit-scrollbar,
    .mobile-container::-webkit-scrollbar {
        display: none;
    }

    /* При этом позволяем прокручивать содержимое */
    html, body {
        overflow: auto;
    }
}


