body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

select, .palette-select {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 250px;
    transition: all 0.2s;
}

select:hover, .palette-select:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

select:focus, .palette-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.message-info {
    margin-top: 15px;
    padding: 12px;
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 6px;
    font-size: 13px;
    color: #2e7d32;
    text-align: center;
    font-weight: 500;
}

.error-info {
    margin-top: 15px;
    padding: 12px;
    background: #ffe8e8;
    border: 1px solid #f44336;
    border-radius: 6px;
    font-size: 13px;
    color: #c62828;
    text-align: center;
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    font-size: 16px;
}

.plots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(850px, 1fr));
    gap: 30px;
    margin-top: 30px;
    justify-items: center;
    align-items: start;
}

.plot {
    width: auto; /* Allow dynamic width */
    min-width: 700px; /* Minimum width to accommodate content */
    max-width: 1200px; /* Maximum width to prevent excessive stretching */
    height: auto;
    padding: 25px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.plot:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.plot-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    flex-shrink: 0;
}

.plot-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible; /* Changed from auto to visible for better centering */
    min-height: 400px; /* Ensure minimum height for proper centering */
    padding: 10px 0; /* Add some vertical padding */
}

.plot-content svg {
    display: block;
    margin: 0 auto; /* Ensure SVG is centered */
}

.plot-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    padding: 20px 15px 5px 15px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.plot-controls .control-group {
    margin-right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.plot-controls .control-group .control-label {
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.plot-controls .palette-select {
    min-width: 200px;
    font-size: 12px;
    padding: 8px 12px;
}

.save-button {
    padding: 10px 18px;
    border: 1px solid #007bff;
    border-radius: 6px;
    background: #007bff;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-button:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 123, 255, 0.3);
}

.save-button:active {
    transform: translateY(0);
}

.axis {
    font-size: 14px;
}

.axis-label {
    font-size: 16px;
    font-weight: 600;
}

/* Correlation Matrix Styles */
.matrix-cell {
    transition: opacity 0.2s ease;
}

.matrix-cell:hover {
    opacity: 0.9;
}

.matrix-cell rect {
    cursor: default;
}

.matrix-cell text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    pointer-events: none;
}

.row-label, .col-label {
    font-size: 11px;
    font-weight: 600;
    fill: #333;
    cursor: default;
    user-select: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.row-label:hover, .col-label:hover {
    fill: #007bff;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
    max-width: 300px;
    word-wrap: break-word;
    font-weight: 500;
}

/* Add responsive behavior */
@media (max-width: 1700px) {
    .plots-container {
        grid-template-columns: 1fr;
    }
}