/**
 * Chart Message Type Styles
 * Styles for Chart.js visualizations
 */

/* Chart Container */
.chart-message-container {
    width: 100%;
    margin: 8px 0;
}

/* Chart Wrapper */
.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Canvas Element */
.chart-wrapper canvas {
    max-height: 400px;
    width: 100% !important;
    height: auto !important;
}

/* Chart Error */
.chart-error {
    padding: 12px;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    border-left: 4px solid #c62828;
    font-size: 14px;
    margin: 8px 0;
}

/* Loading State (optional, for future use) */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
    font-size: 14px;
}

.chart-loading::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chart-wrapper {
        max-width: 100%;
        padding: 12px;
    }
    
    .chart-wrapper canvas {
        max-height: 300px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .chart-wrapper {
        padding: 8px;
    }
    
    .chart-wrapper canvas {
        max-height: 250px;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .chart-wrapper {
        max-width: 500px;
    }
}

/* Large Screens */
@media (min-width: 1200px) {
    .chart-wrapper {
        max-width: 700px;
    }
    
    .chart-wrapper canvas {
        max-height: 450px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chart-wrapper {
        background: #2a2a2a;
        border-color: #444;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .chart-error {
        background: #3a1f1f;
        color: #ff6b6b;
        border-left-color: #ff6b6b;
    }
    
    .chart-loading {
        color: #999;
    }
}

/* Print Styles */
@media print {
    .chart-wrapper {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .chart-wrapper canvas {
        max-height: none !important;
    }
}

/* Accessibility - Focus Styles */
.chart-wrapper:focus-within {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .chart-wrapper {
        border-width: 2px;
        border-color: #000;
    }
    
    .chart-error {
        border-left-width: 6px;
    }
}
