
#chat-app {
    width: 100%;
    font-family: Arial, sans-serif;
}

.messaging-history {
    display: flex;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
}

.messaging-history__list {
    width: 30%;
    min-width: 220px;
    background-color: #f7f7f7;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.messaging-history__list-top {
    border-bottom: 1px solid #ddd;
    padding: 10px;
}
.search-form__wrapper {
    position: relative;
}
.search-form__field {
    width: 100%;
    padding: 10px 42px 10px 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    box-sizing: border-box;
    font-size: 14px;
    height: 40px;
}
.search-form__button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 36px;
    height: 36px;
    border: none;
    background-color: #ccc;
    cursor: pointer;
    border-radius: 50%;
    outline: none;
}


.messaging-history__list-bottom {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 10px;
}
ul.messages-history {
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.messages-history li {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}
ul.messages-history li:hover {
    background-color: #e6e6e6;
}


.messaging-history__messages {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}


.messaging-history__messages-top {
    border-bottom: 1px solid #ddd;
    padding: 10px;
    display: flex;
    align-items: center;
    background-color: #fafafa;
}
.messaging-history__messages-top #first-letters {
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


.messages-list {
    flex-grow: 1;
    overflow-y: auto;
    margin: 0;
    padding: 10px;
    list-style: none;
    background-color: #fff;
    box-sizing: border-box;
    min-height: 300px;
}


.messages-list li {
    max-width: 60%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    word-wrap: break-word;
    line-height: 1.4;
}
.sent-message {
    background-color: #DCF8C6;
    text-align: right;
    margin-left: auto;
}
.received-message {
    background-color: #EAEAEA;
    text-align: left;
    margin-right: auto;
}


.message-form {
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #fafafa;
}
.message-form__file {
    margin-right: 10px;
}

.visually-hidden {
    display: none;
}
.message-form__text {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    height: 40px;
    box-sizing: border-box;
    margin-right: 10px;
}
.message-form__send {
    padding: 10px 16px;
    background-color: #2f74c0;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.message-form__send:hover {
    background-color: #2f60a0;
}


.unread_dot::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: chocolate;
    position: absolute;
    right: 0;
}



.search-form__button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 36px;
    height: 36px;
    border: none;
    background-color: #ccc;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}


.search-form__button:hover {
    background-color: #bbb;
}


.search-form__button span {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}


.search-form__button::before {
    content: "\1F50D"; 
    font-size: 18px;
    line-height: 1;
}



#searchResults {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
}


.search_result {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: #333;
}


.search_result:hover {
    background-color: #f5f5f5;
}

.search_result:last-child {
    border-bottom: none;
}


.messages-list__item {
    max-width: 70%;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.messages-list__item--own {
    background-color: #DCF8C6;
    text-align: right;
    margin-left: auto;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.received-online {
    background-color: #EAEAEA;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.message-form {
    display: flex;
    padding: 10px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
}

.message-form__text {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    height: 40px;
    box-sizing: border-box;
}

.message-form__send {
    margin-left: 10px;
    padding: 10px 16px;
    background-color: #2f74c0;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.message-form__send:hover {
    background-color: #1e5fa6;
}


.messages-list {
    flex-grow: 1;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.read-message {
    background-color: #f5f5f5 !important;
    color: #333;
    transition: background-color 0.3s ease-in-out;
}

.messages-history__unread {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: red;
    border-radius: 50%;
    font-size: 10px;
    color: white;
    text-align: center;
    line-height: 12px;
    font-weight: bold;
    margin-left: 6px;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
}

.current-room-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

#current-room {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.delete-room-btn-top {
    background-color: #ff4d4f;
    border: none;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    padding: 4px 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-room-btn-top:hover {
    background-color: #d9363e;
}

.message-status.read-status {
    color: green;
    font-size: 12px;
    margin-left: 5px;
    font-weight: bold;
}

