/* Visualization.css - Styles for the 3D Jumper Visualization */

.visualization-container {
    position: relative;
    width: 100%;
    height: 800px !important;
    min-height: 800px !important;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #0066aa;
}

.visualization-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

#jumper-visualization,
#live-visualization {
    width: 100%;
    height: 800px !important;
    min-height: 800px !important;
}

.visualization-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.visualization-controls button {
    margin: 2px;
    padding: 5px 10px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.visualization-controls button:hover {
    background: #0b7dda;
}

.visualization-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

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

.legend-color {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
}

.pipe-color {
    background-color: #3498db;
}

.elbow-color {
    background-color: #e67e22;
}

.segment-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
}

.visualization-info {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    font-size: 14px;
    display: none;
}

.info-visible .visualization-info {
    display: block;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    gap: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px;
    border-radius: 5px;
}

.camera-controls button {
    padding: 5px 10px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Visualization loading state */
.visualization-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Unity color gradient for pipes */
.pipe-unity-low {
    color: #2ecc71; /* Green for low unity (safe) */
}

.pipe-unity-medium {
    color: #f39c12; /* Orange for medium unity */
}

.pipe-unity-high {
    color: #e74c3c; /* Red for high unity (approaching limit) */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .visualization-container {
        height: 500px !important;
        min-height: 400px !important;
    }
    
    #jumper-visualization,
    #live-visualization {
        height: 500px !important;
        min-height: 400px !important;
    }
    
    .contour-plots-container {
        flex-direction: column;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Fullscreen mode */
.visualization-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1000;
    border-radius: 0;
    background-color: #f0f4f8;
}

.visualization-fullscreen canvas {
    width: 100vw !important;
    height: 100vh !important;
}

.fullscreen-exit {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 9001;
}

/* Element labels */
.element-label {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 100;
}

/* Canvas styling */
#jumper-visualization canvas,
#live-visualization canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Element info tooltip */
.element-info-tooltip {
    position: absolute;
    background-color: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    z-index: 200;
    max-width: 250px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -100%);
    margin-top: -10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.element-info-tooltip.visible {
    opacity: 1;
}

.element-info-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(44, 62, 80, 0.9);
}

.element-info-tooltip h5 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #3498db;
}

.element-info-tooltip p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.element-info-tooltip .tooltip-unity {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
}

.element-info-tooltip .tooltip-unity span {
    font-weight: bold;
}

/* Element highlight */
.element-highlight {
    position: absolute;
    border: 2px solid #e74c3c;
    border-radius: 4px;
    pointer-events: none;
    z-index: 150;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Export image dialog */
.export-dialog {
    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: 1000;
}

.export-dialog-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.export-dialog-content h3 {
    margin-top: 0;
}

.export-dialog-content .export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.export-dialog-content .export-preview {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.export-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Visualization Tab Panel */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Results Tabs */
.results-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 15px;
    background: #f5f5f5;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 2px;
}

.tab-btn.active {
    background: #fff;
    border-bottom: 2px solid #2196F3;
    color: #2196F3;
}

/* Contour Plots */
.contour-plots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.contour-plot {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.contour-plot-header {
    font-weight: bold;
    padding: 5px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.contour-plot-content {
    height: 300px;
}

.plot-canvas {
    width: 100%;
    height: 100%;
}

.unity-gradient {
    width: 100%;
    height: 20px;
    background: linear-gradient(to right, green, yellow, red);
    margin: 5px 0;
    border-radius: 3px;
}

.unity-legend {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Elements Table */
.elements-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.elements-table th, 
.elements-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.elements-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.elements-table tr:hover {
    background-color: #f9f9f9;
}

/* High Unity Values */
.elements-table .high-unity {
    color: #f44336;
    font-weight: bold;
}

/* Summary Section */
.unity-values-summary {
    margin-top: 30px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.summary-item .value {
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
}

/* Export Options */
.export-options {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.export-options button {
    padding: 8px 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.export-options button:hover {
    background: #0b7dda;
} 