/**
 * Vendor Chat Dashboard Styles
 */

.vendor-chat-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dashboard-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e1e5e9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.chat-stats {
    display: flex;
    gap: 16px;
}

.chat-stats span {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.dashboard-content {
    display: flex;
    height: 700px;
}

.conversations-panel {
    width: 380px;
    border-right: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

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

.conversation-item {
    padding: 0;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    margin-bottom: 1px;
    position: relative;
}

.conversation-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

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

.conversation-item.unread {
    background: #fff8e1;
    border-left: 4px solid #ff9800;
}

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

.conversation-content {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.customer-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.customer-avatar-small {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid #e1e5e9;
}

.customer-details {
    flex: 1;
    min-width: 0;
}

.customer-name {
    font-weight: 600;
    font-size: 15px;
    color: #2d3748;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-message {
    color: #64748b;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-left: 12px;
}

.conversation-time {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
}

.unread-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.messages-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
    min-height: 0;
}

.message-item {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-item.vendor {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.message-item.customer .message-bubble {
    background: white;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 6px;
}

.message-item.vendor .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.message-content {
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

.reply-area {
    padding: 24px;
    border-top: 1px solid #e1e5e9;
    background: white;
}

.reply-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#vendor-reply-input {
    flex: 1;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 12px 16px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
    min-height: 44px;
    max-height: 120px;
}

#vendor-reply-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-reply-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 100px;
    height: 44px;
}

.send-reply-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.send-reply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.refresh-conversations {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.refresh-conversations:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.no-conversation {
    text-align: center;
    color: #64748b;
    margin-top: 100px;
}

.no-conversation p {
    font-size: 16px;
    margin: 0;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-style: italic;
}

.conversation-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 14px;
}

.vendor-chat-login,
.vendor-chat-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

/* Scrollbar Styling */
.conversations-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.conversations-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vendor-chat-dashboard {
        margin: 10px;
        border-radius: 8px;
    }
    
    .dashboard-header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .chat-stats {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .dashboard-content {
        flex-direction: column;
        height: auto;
    }
    
    .conversations-panel {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
    }
    
    .chat-panel {
        height: 500px;
    }
    
    .panel-header {
        padding: 16px 20px;
    }
    
    .conversation-content {
        padding: 12px 16px;
    }
    
    .customer-avatar-small {
        width: 36px;
        height: 36px;
        margin-right: 10px;
    }
    
    .messages-container {
        padding: 16px;
    }
    
    .reply-area {
        padding: 16px;
    }
    
    .reply-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .send-reply-btn {
        width: 100%;
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .conversations-panel {
        width: 320px;
    }
    
    .customer-details {
        margin-right: 8px;
    }
}




/**
 * Additional Vendor Chat Dashboard Styles for Enhanced Features
 * Add these to your existing vendor-chat-admin.css file
 */

/* Status Toggle in Header */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.status-toggle input[type="checkbox"] {
    width: 40px;
    height: 20px;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-toggle input[type="checkbox"]:checked {
    background: #10b981;
}

.status-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.status-toggle input[type="checkbox"]:checked::before {
    left: 22px;
}

.toggle-label {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* Upload Toggle in Conversation Info */
.upload-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.upload-toggle input[type="checkbox"] {
    width: 32px;
    height: 16px;
    appearance: none;
    background: #cbd5e1;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-toggle input[type="checkbox"]:checked {
    background: #4f46e5;
}

.upload-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.upload-toggle input[type="checkbox"]:checked::before {
    left: 18px;
}

/* Typing Indicator for Vendor Dashboard */
.typing-indicator-vendor {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border-top: 1px solid #e1e5e9;
}

.typing-indicator-vendor span:not(.typing-text) {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.typing-indicator-vendor .typing-text {
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}

/* Attachment Links in Messages */
.attachment-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 14px;
}

.message-item.vendor .attachment-link {
    background: rgba(255, 255, 255, 0.2);
}

.attachment-link:hover {
    text-decoration: underline;
    background: rgba(0, 0, 0, 0.1);
}

.message-item.vendor .attachment-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Conversation Info Enhancements */
#conversation-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

#conversation-info .customer-name {
    font-weight: 600;
    color: #2d3748;
}

/* Mobile Responsive Additions */
@media (max-width: 768px) {
    .status-toggle {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .status-toggle input[type="checkbox"] {
        width: 36px;
        height: 18px;
    }
    
    .status-toggle input[type="checkbox"]::before {
        width: 14px;
        height: 14px;
    }
    
    .status-toggle input[type="checkbox"]:checked::before {
        left: 20px;
    }
    
    .upload-toggle {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    #conversation-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}


/**
 * Additional Vendor Chat Dashboard Styles for Enhanced Features
 * Add these to your existing vendor-chat-admin.css file
 */

/* Status Toggle in Header */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.status-toggle input[type="checkbox"] {
    width: 40px;
    height: 20px;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-toggle input[type="checkbox"]:checked {
    background: #10b981;
}

.status-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.status-toggle input[type="checkbox"]:checked::before {
    left: 22px;
}

.toggle-label {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* Upload Toggle in Conversation Info */
.upload-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.upload-toggle input[type="checkbox"] {
    width: 32px;
    height: 16px;
    appearance: none;
    background: #cbd5e1;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-toggle input[type="checkbox"]:checked {
    background: #4f46e5;
}

.upload-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.upload-toggle input[type="checkbox"]:checked::before {
    left: 18px;
}

/* Typing Indicator for Vendor Dashboard */
.typing-indicator-vendor {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border-top: 1px solid #e1e5e9;
}

.typing-indicator-vendor span:not(.typing-text) {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.typing-indicator-vendor .typing-text {
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}

/* Attachment Links in Messages */
.attachment-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 14px;
}

.message-item.vendor .attachment-link {
    background: rgba(255, 255, 255, 0.2);
}

.attachment-link:hover {
    text-decoration: underline;
    background: rgba(0, 0, 0, 0.1);
}

.message-item.vendor .attachment-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Conversation Info Enhancements */
#conversation-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

#conversation-info .customer-name {
    font-weight: 600;
    color: #2d3748;
}

.conversation-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

#vendor-end-conversation-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#vendor-end-conversation-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.conversation-ended-message {
    text-align: center;
    padding: 20px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 500;
}

/* Mobile Responsive Additions */
@media (max-width: 768px) {
    .status-toggle {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .status-toggle input[type="checkbox"] {
        width: 36px;
        height: 18px;
    }
    
    .status-toggle input[type="checkbox"]::before {
        width: 14px;
        height: 14px;
    }
    
    .status-toggle input[type="checkbox"]:checked::before {
        left: 20px;
    }
    
    .upload-toggle {
        font-size: 12px;
        padding: 4px 8px;
    }
    
#conversation-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .conversation-actions {
        width: 100%;
        margin-left: 0;
    }
    
    #vendor-end-conversation-btn {
        font-size: 12px;
        padding: 5px 12px;
    }
}
    #vendor-end-conversation-btn {
        font-size: 12px;
        padding: 5px 12px;
    }
}
media (max-width: 768px) {
    .status-toggle {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .status-toggle input[type="checkbox"] {
        width: 36px;
        height: 18px;
    }
    
    .status-toggle input[type="checkbox"]::before {
        width: 14px;
        height: 14px;
    }
    
    .status-toggle input[type="checkbox"]:checked::before {
        left: 20px;
    }
    
    .upload-toggle {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    #conversation-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}