/**
 * Customer Chat History Styles
 * Save as: customer-history.css
 */

.customer-chat-history {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.customer-chat-history h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 32px;
    text-align: center;
}

.no-history {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.conversations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.conversation-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.conversation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.conversation-header {
    padding: 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
}

.conversation-header .vendor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.vendor-details h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.last-message-time {
    font-size: 13px;
    opacity: 0.9;
}

.messages-preview {
    padding: 20px;
    background: #f8fafc;
    max-height: 300px;
    overflow-y: auto;
}

.messages-preview::-webkit-scrollbar {
    width: 6px;
}

.messages-preview::-webkit-scrollbar-track {
    background: #e5e7eb;
}

.messages-preview::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.message-item {
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
}

.message-item.customer {
    border-left-color: #4f46e5;
    background: linear-gradient(to right, rgba(79, 70, 229, 0.05), white);
}

.message-item.vendor {
    border-left-color: #10b981;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), white);
}

.message-item strong {
    display: block;
    margin-bottom: 4px;
    color: #1f2937;
    font-size: 13px;
}

.message-item .time {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.message-item a {
    color: #4f46e5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-item a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .customer-chat-history {
        margin: 20px auto;
        padding: 0 16px;
    }
    
    .customer-chat-history h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    .conversations-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .conversation-header {
        padding: 16px;
    }
    
    .conversation-header .vendor-avatar {
        width: 48px;
        height: 48px;
    }
    
    .vendor-details h3 {
        font-size: 16px;
    }
    
    .messages-preview {
        padding: 16px;
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .customer-chat-history h2 {
        font-size: 20px;
    }
    
    .conversation-card {
        border-radius: 12px;
    }
    
    .conversation-header {
        flex-direction: column;
        text-align: center;
    }
    
    .message-item {
        font-size: 13px;
        padding: 10px;
    }
}