/* Messaging Styles */
.messaging-container {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Conversations List */
.conversations-list {
    width: 300px;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation-item:hover {
    background-color: #f9fafb;
}

.conversation-item.active {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.unread-badge {
    background-color: #3b82f6;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

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

.chat-header-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.chat-header-info span {
    font-size: 0.875rem;
    color: #6b7280;
}

.online-indicator {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    margin-left: 8px;
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
}

.message {
    display: flex;
    margin-bottom: 16px;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message.sent .message-content {
    background-color: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background-color: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-text {
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    margin-top: 4px;
    opacity: 0.7;
}

.message.sent .message-time {
    text-align: right;
}

/* Message Input */
.message-input-container {
    display: flex;
    align-items: center;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    outline: none;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.message-input:focus {
    border-color: #3b82f6;
}

.send-button {
    width: 44px;
    height: 44px;
    margin-left: 12px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-button:hover {
    background-color: #2563eb;
}

.send-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Attachment Button */
.attachment-button {
    width: 44px;
    height: 44px;
    margin-right: 12px;
    background: transparent;
    color: #6b7280;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.attachment-button:hover {
    color: #3b82f6;
}

/* Empty State */
.no-conversation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
}

.no-conversation i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .conversations-list {
        width: 100%;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        background: white;
        z-index: 10;
    }

    .conversations-list.hidden {
        display: none;
    }

    .chat-area {
        width: 100%;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #6b7280;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #9ca3af;
    border-radius: 50%;
    margin-right: 4px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}
