/* CVG Chat - Specific Chat Styles */

/* Chat-specific component styles */
.chat-input-container {
    background: var(--cvg-white);
    border-top: 1px solid var(--cvg-border);
}

/* Message styling enhancements */
.bot-message .message-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent var(--cvg-light) transparent transparent;
}

.user-message .message-content::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent var(--cvg-primary);
}

/* Status indicators */
.online-status {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--cvg-success);
    border-radius: 50%;
    border: 2px solid var(--cvg-white);
}

.offline-status {
    background: var(--cvg-border);
}

/* Message status indicators */
.message-status {
    font-size: 10px;
    color: var(--cvg-border);
    margin-left: 5px;
}

.message-status.sent::after {
    content: '✓';
}

.message-status.delivered::after {
    content: '✓✓';
    color: var(--cvg-primary);
}

.message-status.read::after {
    content: '✓✓';
    color: var(--cvg-success);
}

/* Chat bubble animations */
.chat-widget {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px var(--cvg-shadow); }
    50% { box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4); }
    100% { box-shadow: 0 4px 15px var(--cvg-shadow); }
}

/* Notification badge */
.chat-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--cvg-danger);
    color: var(--cvg-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Message types */
.system-message {
    text-align: center;
    margin: 20px 0;
}

.system-message .message-content {
    background: transparent;
    color: var(--cvg-border);
    font-size: 12px;
    font-style: italic;
    padding: 5px 10px;
    max-width: 100%;
}

/* File message styling */
.file-message {
    background: var(--cvg-light);
    border: 1px solid var(--cvg-border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 5px;
}

.file-icon {
    font-size: 16px;
    margin-right: 8px;
}

.file-name {
    font-weight: 500;
}

.file-size {
    font-size: 11px;
    color: var(--cvg-border);
}

/* Quick replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    background: var(--cvg-white);
    border: 1px solid var(--cvg-primary);
    color: var(--cvg-primary);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply-btn:hover {
    background: var(--cvg-primary);
    color: var(--cvg-white);
}

/* Chat header enhancements */
.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

/* Message timestamp hover */
.message:hover .message-time {
    opacity: 1;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--cvg-light);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--cvg-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--cvg-primary);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--cvg-light);
    border-top: 2px solid var(--cvg-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.error-message {
    color: var(--cvg-danger);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success states */
.success-message {
    color: var(--cvg-success);
    font-size: 12px;
    margin-top: 5px;
}

/* CVG branding elements */
.cvg-brand-colors {
    background: var(--cvg-gradient);
}

.cvg-logo-mini {
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="40" fill="white">C</text></svg>') no-repeat center;
    background-size: contain;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--cvg-accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --cvg-border: #000000;
        --cvg-shadow: rgba(0, 0, 0, 0.5);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Human specialist avatar styling */
.human-avatar {
    background: var(--cvg-success) !important;
    border: 2px solid var(--cvg-white);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}
