:root {
    --header-height-desktop: 75px;
    --header-height-mobile: 56px;
}
.messaging-wrapper .row {
    height: calc(100vh - var(--header-height-desktop));
    min-height: 500px;
}
.messaging-wrapper .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: none;
    background-color: #fff;
}
.conversation-list {
    border-right: 1px solid #e9edef;
}
.card-header,
.card-footer {
    background-color: #f0f2f5;
    padding: 0.6rem 1rem;
    flex-shrink: 0;
    border: none;
}
.conversation-list .list-group {
    overflow-y: auto;
    flex-grow: 1;
}
.conversation-list .list-group-item {
    border-radius: 0 !important;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #f0f2f5;
}
.conversation-list .list-group-item.active {
    background-color: #0d6efd;
    color: white;
}
.conversation-list .list-group-item.active .text-muted {
    color: #e0e0e0 !important;
}
.conversation-item {
    position: relative;
}
.archive-btn {
    position: absolute;
    top: 5px;
    right: 8px;
    display: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: #6c757d;
    line-height: 1;
}
.conversation-item:hover .archive-btn {
    display: block;
}
.message-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background-color: #e5ddd5;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
}
.message-row {
    display: flex;
    max-width: 75%;
    gap: 10px;
}
.message-row.sent {
    align-self: flex-end;
}
.message-row.received {
    align-self: flex-start;
}
.avatar-bubble {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: flex-end;
}
.message-bubble {
    position: relative;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.message-bubble.sent {
    background-color: #dcf8c6;
    border-top-right-radius: 0;
}
.message-bubble.received {
    background-color: #fff;
    border-top-left-radius: 0;
}
.message-content.has-image-attachment {
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
}
.message-content img {
    display: block;
    width: 100%;
}
.message-content .file-attachment {
    padding: 1rem;
}
.message-content p {
    margin: 0;
    padding: 8px 12px;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.message-content p.caption-text {
    padding-top: 0.5rem;
}
.message-meta {
    font-size: 0.7rem;
    color: #999;
    text-align: right;
    margin-top: 4px;
    padding: 0 8px 4px;
}
#read-receipt-container {
    height: 1.2em;
}
.read-receipt {
    align-self: flex-end;
    font-size: 0.75rem;
    color: #6c757d;
    float: right;
}
.card-footer textarea {
    resize: none;
    border-radius: 18px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}
.reaction-btn {
    display: none;
}
.message-row:hover .reaction-btn {
    display: inline-block;
    position: absolute;
    top: -15px;
    right: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.reactions-container {
    position: absolute;
    bottom: -10px;
    left: 5px;
    display: flex;
    gap: 2px;
}
.reaction {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 0.7rem;
    cursor: pointer;
}
#emoji-picker {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}
#emoji-picker span {
    cursor: pointer;
    font-size: 1.4rem;
    margin: 0 3px;
}
.online-status {
    position: absolute;
    bottom: 2px;
    right: 12px;
    width: 12px;
    height: 12px;
    background-color: #28a745;
    border-radius: 50%;
    border: 2px solid white;
}
@media (max-width: 767.98px) {
    .messaging-wrapper {
        width: 100vw;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }
    .messaging-wrapper .row {
        height: calc(100vh - var(--header-height-mobile));
    }
    .messaging-wrapper .message-view {
        display: none;
    }
    .messaging-wrapper.chat-active .conversation-list {
        display: none;
    }
    .messaging-wrapper.chat-active .message-view {
        display: flex;
    }
    .conversation-list {
        border-right: none;
    }
}