/* Chat System Styles */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 360px;
    height: 500px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: #4A90E2;
    color: #FFFFFF;
}

.back-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    margin-right: 12px;
    cursor: pointer;
    font-size: 16px;
}

.chat-user-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid #FFFFFF;
}

.chat-user-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.chat-user-status {
    font-size: 12px;
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-received {
    align-self: flex-start;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-bottom-left-radius: 4px;
}

.message-sent {
    align-self: flex-end;
    background-color: #4A90E2;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-input-container {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #FFFFFF;
    border-top: 1px solid #E2E8F0;
}

.chat-input {
    flex: 1;
    border: none;
    background-color: #F1F5F9;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

.send-btn {
    background-color: #4A90E2;
    color: #FFFFFF;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.send-btn:hover {
    background-color: #3A80D2;
}

/* Chat overview styles */
.messenger-overview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.messenger-container {
    width: 360px;
    height: 500px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messenger-header {
    padding: 16px;
    background-color: #4A90E2;
    color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messenger-title {
    font-size: 18px;
    font-weight: 600;
}

.close-messenger-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    font-size: 16px;
}

.messenger-search {
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
}

.messenger-search-input {
    width: 100%;
    padding: 8px 12px;
    border: none;
    background-color: #F1F5F9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.contact-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.contact-item:hover {
    background-color: #F8FAFC;
}

.contact-avatar-container {
    position: relative;
    margin-right: 12px;
}

.unread-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #10B981;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
}

.contact-details {
    flex: 1;
}

.contact-name-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.contact-name {
    font-weight: 500;
}

.message-time {
    font-size: 12px;
    color: #94A3B8;
}

.last-message {
    font-size: 13px;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

/* Teams & Community Section Styles */