/**
 * Messages styles for Vendor Dashboard Pro
 *
 * @package Vendor Dashboard Pro
 */

/* Variables */
:root {
    --vdp-message-primary: #3483fa;
    --vdp-message-primary-light: rgba(52, 131, 250, 0.1);
    --vdp-message-secondary: #f1f1f1;
    --vdp-message-text: #333;
    --vdp-message-text-light: #757575;
    --vdp-message-success: #28a745;
    --vdp-message-warning: #f1c40f;
    --vdp-message-unread: #3483fa;
}

/* Messages Content Container */
.vdp-messages-content {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Messages Header Section */
.vdp-messages-header-section {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--vdp-primary) 0%, #2c72d7 100%);
    border-radius: 12px;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(44, 114, 215, 0.2);
}

.vdp-messages-header-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(150px, -150px);
    z-index: 1;
}

.vdp-messages-stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.vdp-stat-box {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 180px;
    max-width: 25%;
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .vdp-messages-stats {
        flex-direction: row;
    }
    
    .vdp-stat-box {
        margin-bottom: 0;
    }
}

/* Messages List Section */
.vdp-messages-list-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.vdp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--vdp-gray-200, #e5e7eb);
}

.vdp-section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.vdp-section-actions {
    display: flex;
    align-items: center;
}

.vdp-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vdp-filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--vdp-gray-300, #d1d5db);
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    min-width: 150px;
}

.vdp-search-filter {
    position: relative;
}

.vdp-search-input {
    padding: 0.5rem 1rem;
    padding-right: 2.5rem;
    border: 1px solid var(--vdp-gray-300, #d1d5db);
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    min-width: 220px;
}

.vdp-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--vdp-gray-500, #6b7280);
    cursor: pointer;
    padding: 5px;
}

/* Messages List */
.vdp-messages-list {
    padding: 1.5rem;
}

.vdp-message-card {
    display: flex;
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--vdp-gray-200, #e5e7eb);
}

.vdp-message-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.vdp-message-card.vdp-unread {
    background-color: var(--vdp-message-primary-light);
    border-left: 3px solid var(--vdp-message-primary);
}

.vdp-message-sender {
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.vdp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--vdp-gray-200, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vdp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vdp-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--vdp-gray-500, #6b7280);
    background-color: var(--vdp-gray-200, #e5e7eb);
}

.vdp-avatar-placeholder.large {
    width: 72px;
    height: 72px;
    font-size: 28px;
}

.vdp-message-content {
    flex: 1;
}

.vdp-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.vdp-message-info {
    flex: 1;
}

.vdp-message-sender-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.vdp-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--vdp-message-primary);
    margin-left: 0.5rem;
}

.vdp-message-meta {
    display: flex;
    align-items: center;
    margin-top: 0.25rem;
    font-size: 12px;
    color: var(--vdp-message-text-light);
}

.vdp-message-time {
    margin-right: 1rem;
}

.vdp-message-product {
    display: flex;
    align-items: center;
}

.vdp-message-product i {
    margin-right: 0.25rem;
}

.vdp-message-actions {
    display: flex;
    gap: 0.5rem;
}

.vdp-message-preview {
    color: var(--vdp-message-text);
    margin-bottom: 0.75rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
}

.vdp-message-status {
    display: flex;
    justify-content: flex-start;
}

.vdp-responded-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--vdp-message-success);
    font-size: 12px;
    font-weight: 500;
}

.vdp-responded-badge i {
    margin-right: 0.25rem;
}

/* Empty State */
.vdp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.vdp-empty-icon {
    font-size: 48px;
    color: var(--vdp-gray-400, #9ca3af);
    margin-bottom: 1rem;
}

.vdp-empty-state p {
    font-size: 16px;
    color: var(--vdp-gray-600, #4b5563);
    margin-bottom: 1.5rem;
}

/* Filter Tags */
.vdp-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 1.5rem;
}

.vdp-filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background-color: var(--vdp-gray-100, #f3f4f6);
    border-radius: 20px;
    font-size: 12px;
    color: var(--vdp-gray-700, #374151);
}

.vdp-filter-tag-remove {
    margin-left: 0.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--vdp-gray-300, #d1d5db);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 8px;
}

.vdp-filter-tag-remove:hover {
    background-color: var(--vdp-message-primary);
}

/* Message View */
.vdp-message-view-content {
    max-width: 100%;
}

.vdp-message-header-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.vdp-message-subject h2 {
    margin: 0 0 0.5rem 0;
    font-size: 20px;
    font-weight: 600;
}

.vdp-message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 14px;
    color: var(--vdp-message-text-light);
}

.vdp-message-product a {
    color: var(--vdp-message-primary);
    text-decoration: none;
}

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

.vdp-conversation-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.vdp-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.vdp-status-awaiting {
    background-color: rgba(241, 196, 15, 0.15);
    color: #d9a512;
}

.vdp-status-responded {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.vdp-status-badge i {
    margin-right: 0.5rem;
}

/* Conversation */
.vdp-conversation-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.vdp-conversation {
    margin-bottom: 2rem;
}

.vdp-conversation-item {
    display: flex;
    margin-bottom: 1.5rem;
}

.vdp-customer-message {
    flex-direction: row;
}

.vdp-vendor-message {
    flex-direction: row-reverse;
}

.vdp-vendor-message .vdp-message-sender {
    margin-right: 0;
    margin-left: 1.25rem;
}

.vdp-message-sender {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vdp-sender-name {
    font-size: 12px;
    margin-top: 0.5rem;
    text-align: center;
    color: var(--vdp-message-text-light);
}

.vdp-message-bubble {
    padding: 1rem;
    border-radius: 12px;
    position: relative;
    max-width: 80%;
}

.vdp-customer-message .vdp-message-bubble {
    background-color: var(--vdp-message-secondary);
    color: var(--vdp-message-text);
    border-top-left-radius: 0;
}

.vdp-vendor-message .vdp-message-bubble {
    background-color: var(--vdp-message-primary-light);
    color: var(--vdp-message-text);
    border-top-right-radius: 0;
    margin-left: auto;
}

.vdp-message-content {
    margin-bottom: 0.75rem;
}

.vdp-message-content p:first-child {
    margin-top: 0;
}

.vdp-message-content p:last-child {
    margin-bottom: 0;
}

.vdp-message-time {
    font-size: 12px;
    color: var(--vdp-message-text-light);
    text-align: right;
}

/* Reply Form */
.vdp-reply-form {
    background-color: var(--vdp-gray-50, #f9fafb);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px dashed var(--vdp-gray-200, #e5e7eb);
}

.vdp-reply-form h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 16px;
    font-weight: 600;
}

.vdp-form-group {
    margin-bottom: 1.25rem;
}

.vdp-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--vdp-gray-300, #d1d5db);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.vdp-form-control:focus {
    outline: none;
    border-color: var(--vdp-message-primary);
    box-shadow: 0 0 0 3px rgba(52, 131, 250, 0.2);
}

.vdp-quick-replies {
    margin-bottom: 1.5rem;
}

.vdp-quick-replies-header {
    margin-bottom: 0.75rem;
}

.vdp-quick-replies-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--vdp-gray-700, #374151);
}

.vdp-quick-replies-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vdp-quick-reply-item {
    background: white;
    border: 1px solid var(--vdp-gray-300, #d1d5db);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.vdp-quick-reply-item:hover {
    background-color: var(--vdp-message-primary-light);
    border-color: var(--vdp-message-primary);
    color: var(--vdp-message-primary);
}

.vdp-form-actions {
    display: flex;
    justify-content: flex-end;
}

/* Customer Info */
.vdp-customer-info-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.vdp-customer-card {
    padding: 1.5rem;
}

.vdp-customer-header {
    display: flex;
    margin-bottom: 1.5rem;
}

.vdp-customer-avatar {
    margin-right: 1.25rem;
}

.vdp-customer-avatar img,
.vdp-customer-avatar .vdp-avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
}

.vdp-customer-details {
    flex: 1;
}

.vdp-customer-name {
    margin: 0 0 0.5rem 0;
    font-size: 18px;
    font-weight: 600;
}

.vdp-customer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--vdp-message-text-light);
    font-size: 14px;
}

.vdp-customer-interactions {
    border-top: 1px solid var(--vdp-gray-200, #e5e7eb);
    padding-top: 1.5rem;
}

.vdp-interaction-header h4 {
    margin: 0 0 1rem 0;
    font-size: 16px;
    font-weight: 600;
}

.vdp-no-interactions {
    color: var(--vdp-message-text-light);
    font-size: 14px;
    font-style: italic;
}

.vdp-interactions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vdp-interaction-item {
    display: flex;
    align-items: center;
}

.vdp-interaction-icon {
    margin-right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--vdp-gray-100, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vdp-message-text-light);
}

.vdp-interaction-content {
    flex: 1;
}

.vdp-interaction-title {
    font-size: 14px;
    margin-bottom: 0.25rem;
}

.vdp-interaction-meta {
    font-size: 12px;
    color: var(--vdp-message-text-light);
}

.vdp-bottom-actions {
    margin-bottom: 2rem;
}

/* Notification */
.vdp-notification {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.vdp-notification-success {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.vdp-notification-warning {
    background-color: rgba(241, 196, 15, 0.15);
    color: #d9a512;
    border-left: 4px solid #d9a512;
}

.vdp-notification-error {
    background-color: rgba(231, 76, 60, 0.15);
    color: #c0392b;
    border-left: 4px solid #c0392b;
}

/* Contact Modal */
.vdp-contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.vdp-contact-modal.vdp-active {
    opacity: 1;
    visibility: visible;
}

.vdp-modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.vdp-contact-modal.vdp-active .vdp-modal-content {
    transform: scale(1);
}

.vdp-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--vdp-gray-200, #e5e7eb);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vdp-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.vdp-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--vdp-gray-500, #6b7280);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.vdp-modal-close:hover {
    background-color: var(--vdp-gray-100, #f3f4f6);
    color: var(--vdp-gray-700, #374151);
}

.vdp-modal-body {
    padding: 1.5rem;
}

.vdp-modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--vdp-gray-200, #e5e7eb);
    display: flex;
    justify-content: flex-end;
}

/* Loading State */
.vdp-btn-loading {
    position: relative;
    color: transparent !important;
}

.vdp-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 992px) {
    .vdp-messages-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vdp-message-header-section,
    .vdp-conversation-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vdp-conversation-actions {
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .vdp-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vdp-section-actions {
        width: 100%;
        margin-top: 1rem;
    }
    
    .vdp-filters {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vdp-filter-select, 
    .vdp-search-input {
        width: 100%;
    }
    
    .vdp-message-bubble {
        max-width: 75%;
    }
}

@media (max-width: 768px) {
    .vdp-messages-stats {
        grid-template-columns: 1fr;
    }
    
    .vdp-message-card {
        flex-direction: column;
    }
    
    .vdp-message-sender {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .vdp-message-header {
        flex-direction: column;
    }
    
    .vdp-message-actions {
        margin-top: 1rem;
    }
    
    .vdp-customer-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .vdp-customer-avatar {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .vdp-customer-meta {
        justify-content: center;
    }
    
    .vdp-message-bubble {
        max-width: 100%;
    }
}