/* Chat Container Layout */
.chat-container {
    display: flex;
    height: calc(100vh - 3.25rem); /* Subtract navbar height */
    position: relative;
}

/* Participants Sidebar */
.participants-sidebar {
    width: 250px;
    background-color: #f5f5f5;
    border-right: 1px solid #dbdbdb;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #dbdbdb;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #dbdbdb;
}

.participant {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.participant:hover {
    background-color: #eeeeee;
}

.participant-avatar {
    margin-right: 0.75rem;
}

.participant-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.participant-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile Participants Bar */
.mobile-participants-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #fff;
    padding: 0.5rem;
    border-bottom: 1px solid #dbdbdb;
    width: 100%;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid #dbdbdb;
    background-color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f9f9f9;
}

/* Chat Input Area */
.chat-input-container {
    padding: 1rem;
    border-top: 1px solid #dbdbdb;
    background-color: #fff;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
}

.file-upload-button {
    margin-right: 0.5rem;
}

.message-input {
    flex: 1;
}

.send-button {
    margin-left: 0.5rem;
}

/* Message Styling */
.message-container {
    display: flex;
    margin-bottom: 1rem;
    width: 100%;
}

.message-avatar {
    margin-right: 0.75rem;
    align-self: flex-start;
}

.message-avatar .avatar-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-container.is-agent .message-content {
    background-color: #f0f0f0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.message-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.message-time {
    font-size: 0.75rem;
    color: #777;
}

.message-body {
    word-break: break-word;
}

.message-body p:last-child {
    margin-bottom: 0;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .chat-main {
        height: calc(100vh - 3.25rem - 50px); /* Subtract navbar and mobile participants bar */
    }
}