/* Page-specific styles for messages.html */
body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex: 1;
    min-height: 0;
    max-width: 1280px;
    width: calc(100% - 40px);
    margin: 12px auto;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Conversations List */
.conversations-sidebar {
    width: 350px;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.sidebar-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

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

.conversation-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    gap: 12px;
    align-items: center;
}

.conversation-item:hover {
    background: #f7f7f7;
}

.conversation-item.active {
    background: #e3f2fd;
    border-left: 4px solid #3665f3;
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #c41e3a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

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

.conversation-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.conversation-preview {
    font-size: 13px;
    color: #707070;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 12px;
    color: #999;
}

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

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #c41e3a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.chat-user-info {
    flex: 1;
}

.chat-user-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.chat-user-status {
    font-size: 13px;
    color: #707070;
}

.view-profile-btn {
    padding: 8px 16px;
    background: white;
    color: #3665f3;
    border: 1px solid #3665f3;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.view-profile-btn:hover {
    background: #f0f0f0;
}

/* Messages Area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 70%;
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #c41e3a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.message.sent .message-avatar {
    background: #3665f3;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    background: #f0f0f0;
    color: #333;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: #3665f3;
    color: white;
}

.message-time {
    font-size: 11px;
    color: #999;
    padding: 0 8px;
}

/* Message Input */
.message-input-area {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 10px;
    align-items: center;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: Arial, sans-serif;
}

.message-input:focus {
    border-color: #3665f3;
}

.send-btn {
    width: 45px;
    height: 45px;
    background: #3665f3;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #2348c5;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-text {
    font-size: 18px;
}

@keyframes conv-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .chat-container {
        margin: 0;
        width: 100%;
        border-radius: 0;
    }

    .conversations-sidebar {
        width: 100%;
        display: none;
    }

    .conversations-sidebar.mobile-show {
        display: flex;
    }

    .chat-area.mobile-hide {
        display: none;
    }

    .message {
        max-width: 85%;
    }
}
