/* ===== Messages Page Styles ===== */
.messages-page {
    background: var(--white-soft);
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.messages-page .hero-section {
    padding: 1.5rem;
    flex-shrink: 0;
}

.messages-page .hero-content {
    text-align: center;
}


/* Messages Container */
.messages-content {
    flex: 1;
    padding: 0 1rem 1rem;
    overflow: hidden;
}

.messages-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100%;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Conversations List */
.conversations-list {
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.conversations-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.conversations-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.conversations-scroll {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.conversation-item:hover {
    background: #f9fafb;
}

.conversation-item.active {
    background: #eff6ff;
    border-left: 3px solid #2563eb;
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conversation-avatar span {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.conversation-time {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    color: #9ca3af;
}

.conversation-unread {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    border-radius: 50%;
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
}

/* Chat Area */
.chat-area {
    display: flex;
    flex-direction: column;
    background: #f9fafb;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.chat-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: #9ca3af;
}

.chat-empty-icon svg {
    width: 100%;
    height: 100%;
}

.chat-empty h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem;
}

.chat-empty p {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    margin: 0;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.chat-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-user-avatar span {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
}

.chat-user-info {
    display: flex;
    flex-direction: column;
}

.chat-user-name {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}

.chat-user-status {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #10b981;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.4;
}

.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.message.received {
    align-self: flex-start;
    background: #fff;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.message-time {
    font-size: 0.6875rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Chat Input */
.chat-input-form {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.chat-input-form input {
    flex: 1;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: #1f2937;
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input-form input:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-input-form input::placeholder {
    color: #9ca3af;
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.3);
}

.send-btn:hover {
    transform: scale(0.95);
    box-shadow: 0 6px 15px rgba(234, 179, 8, 0.4);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    color: #0f172a;
}

/* Empty Conversations */
.no-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7280;
}

.no-conversations p {
    font-size: 0.9375rem;
    margin: 0;
}

@media (max-width: 768px) {
    .messages-container {
        grid-template-columns: 1fr;
    }
    
    .conversations-list {
        display: none;
    }
    
    .conversations-list.mobile-show {
        display: flex;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 10;
    }
}

/* Multimedia Messages */
.chat-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 48px;
    color: #64748b;
    transition: all 0.2s;
}

.chat-tool-btn:hover {
    color: #2563eb;
}

#voiceRecordBtn.recording {
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.chat-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    cursor: pointer;
    display: block;
}

.chat-audio {
    max-width: 100%;
    height: 40px;
}

.message.type-image, .message.type-audio {
    padding: 0.5rem;
}

.btn-report-dispute {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #fee2e2;
    background: #fff;
    transition: all 0.2s;
}

.btn-report-dispute:hover {
    background: #fee2e2;
}