/**
 * Customer Messages Widget Styles
 * Shows automated messages sent to customer
 * 
 * Phase 3 Enhancement - Customer Message Awareness
 * ARCHITECTURE.md Rule 4 Compliant
 */

/* Widget Container */
.customer-messages-container {
    margin: 16px 0;
}

.customer-messages-widget {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

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

/* Widget Header */
.widget-header {
    background: linear-gradient(135deg, #FF6B00, #E66000);
    color: #FFFFFF;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-icon {
    font-size: 20px;
}

.widget-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.message-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}

/* Widget Body */
.widget-body {
    padding: 12px;
}

.no-messages,
.loading-text {
    text-align: center;
    color: #757575;
    padding: 24px;
    font-size: 14px;
}

/* Message Items */
.message-item {
    background: #F5F5F5;
    border-left: 4px solid #FF6B00;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.message-item:last-child {
    margin-bottom: 0;
}

.message-item:hover {
    background: #EEEEEE;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-item.replied {
    border-left-color: #2E7D32;
    background: #E8F5E9;
}

.message-item.replied:hover {
    background: #C8E6C9;
}

/* Message Header */
.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-icon {
    font-size: 18px;
}

.message-type {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
}

.message-time {
    font-size: 12px;
    color: #757575;
}

/* Message Content */
.message-content {
    color: #424242;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 8px 0;
}

/* Customer Reply */
.message-reply {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(46, 125, 50, 0.1);
    border-left: 3px solid #2E7D32;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.reply-icon {
    font-size: 16px;
}

.reply-label {
    font-weight: 600;
    color: #1B5E20;
}

.reply-content {
    flex: 1;
    color: #2E7D32;
    font-style: italic;
}

.reply-time {
    font-size: 11px;
    color: #558B2F;
}

/* Loading State */
.customer-messages-widget.loading .widget-body {
    text-align: center;
    padding: 24px;
}

.loading-text::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #FF6B00;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .widget-header {
        padding: 10px 12px;
    }
    
    .widget-title {
        font-size: 14px;
    }
    
    .message-item {
        padding: 10px;
    }
    
    .message-content {
        font-size: 13px;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .customer-messages-widget {
        background: #1E1E1E;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .widget-body {
        background: #2C2C2C;
    }
    
    .message-item {
        background: #333333;
        color: #E0E0E0;
    }
    
    .message-item:hover {
        background: #3A3A3A;
    }
    
    .message-type {
        color: #E0E0E0;
    }
    
    .message-content {
        color: #BDBDBD;
    }
    
    .message-item.replied {
        background: #1B3A1E;
    }
    
    .message-item.replied:hover {
        background: #234F26;
    }
}

/* High Contrast Mode (Android Accessibility) */
@media (prefers-contrast: high) {
    .customer-messages-widget {
        border: 2px solid #000000;
    }
    
    .message-item {
        border-left-width: 6px;
        border: 1px solid #000000;
    }
    
    .message-content {
        color: #000000;
        font-weight: 500;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    .customer-messages-widget,
    .message-item {
        animation: none;
        transition: none;
    }
    
    .loading-text::before {
        animation: none;
    }
}
