/**
 * Plot Message Type Styles
 * Styles for Plotly.js scientific visualizations
 */

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

/* Plot Wrapper */
.plot-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    min-height: 400px;
    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);
}

/* Plotly specific overrides */
.plot-wrapper .plotly {
    width: 100% !important;
    height: 100% !important;
}

.plot-wrapper .main-svg {
    background: transparent !important;
}

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

/* Loading State */
.plot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #666;
    font-size: 14px;
}

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

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

/* Plotly Modebar (toolbar) styling */
.plot-wrapper .modebar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 4px;
    padding: 4px;
}

.plot-wrapper .modebar-btn {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.plot-wrapper .modebar-btn:hover {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .plot-wrapper {
        max-width: 100%;
        min-height: 300px;
        padding: 12px;
    }
    
    .plot-wrapper .modebar {
        transform: scale(0.85);
        transform-origin: top right;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .plot-wrapper {
        min-height: 250px;
        padding: 8px;
    }
    
    .plot-wrapper .modebar {
        transform: scale(0.75);
    }
}

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

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .plot-wrapper {
        background: #2a2a2a;
        border-color: #444;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .plot-wrapper .modebar {
        background: rgba(42, 42, 42, 0.9) !important;
    }
    
    .plot-wrapper .modebar-btn path {
        fill: #ccc !important;
    }
    
    .plot-error {
        background: #3a1f1f;
        color: #ff6b6b;
        border-left-color: #ff6b6b;
    }
    
    .plot-loading {
        color: #999;
    }
}

/* Print Styles */
@media print {
    .plot-wrapper {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
        max-width: 100%;
    }
    
    .plot-wrapper .modebar {
        display: none !important;
    }
}

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

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

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .plot-wrapper .modebar-btn {
        /* Make toolbar buttons larger on touch devices */
        min-width: 36px;
        min-height: 36px;
    }
}
