/**
 * css/messaging.css
 * Stylesheet for the chat interface in my-messages.html and messages.html
 */

/* === Conversation List Styling === */

.conversation-list {
    min-height: 100%;
    padding: 0;
    margin: 0;
}

.conversation-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s, font-weight 0.2s;
    font-size: 0.95em;
    color: #333;
}

.conversation-item:hover {
    background-color: #e0f0ff; /* Light hover blue */
}

.conversation-item.active {
    background-color: #007bff; /* Primary color for active chat */
    color: white;
    font-weight: bold;
}

/* === Message Display Area === */

.messages {
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    background-color: #fcfcfc;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 18px;
    font-size: 0.9em;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.message-content {
    margin: 0;
    padding: 0;
}

.message-sender {
    font-size: 0.75em;
    font-weight: bold;
    margin-bottom: 3px;
    opacity: 0.8;
}

.message-timestamp {
    font-size: 0.65em;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

/* --- Message Alignment: Sent (Right) --- */
.message-bubble.sent {
    align-self: flex-end; /* Pushes bubble to the right */
    background-color: #007bff; /* ERP primary color */
    color: white;
    border-bottom-right-radius: 3px;
}
.message-bubble.sent .message-sender {
    color: #e0f0ff;
}

/* --- Message Alignment: Received (Left) --- */
.message-bubble.received {
    align-self: flex-start; /* Keeps bubble to the left */
    background-color: #ffffff; /* White/light background for received */
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 3px;
}
.message-bubble.received .message-timestamp {
    color: #666;
}


/* === Input Area === */

.message-input-area {
    padding: 15px;
}

#messageInput:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

#sendMessageBtn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}