/* Shared styling for the chart editor modal */

.chart-editor-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 5000;
}

.chart-editor-overlay[hidden] {
  display: none;
}

.chart-editor-panel {
  background: #fff;
  width: min(1200px, 95vw);
  height: min(900px, 90vh);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  overflow-y: auto;
}

.chart-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.chart-editor-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.chart-editor-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.chart-editor-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

.chart-editor-controls .spacer {
  flex: 1;
}

.chart-editor-controls label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-editor-controls select {
  min-width: 160px;
}

.chart-editor-controls button {
  border: none;
  background: #1976d2;
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

.chart-editor-controls button.secondary {
  background: #546e7a;
}

.chart-editor-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.regression-panels-wrapper {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid #eceff1;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

.regression-panels-wrapper.collapsed {
  display: none !important;
}

.regression-options,
.regression-results {
  flex: 1 1 360px;
  min-width: 280px;
}

.regression-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.regression-option {
  display: none;
  flex: 1 1 calc(50% - 1rem);
  min-width: 240px;
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
}

.regression-option.active {
  display: block;
}

.regression-option label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.regression-option input,
.regression-option textarea {
  width: 100%;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.regression-option textarea {
  min-height: 80px;
  resize: vertical;
}

.regression-option small {
  display: block;
  margin-top: 0.25rem;
  color: #546e7a;
  font-size: 0.78rem;
}

.regression-results {
  padding: 0.75rem;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  background: #fff;
  max-height: 280px;
  overflow: auto;
  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
}

.regression-results[hidden] {
  display: none !important;
}

.regression-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.regression-results button {
  border: none;
  background: #eceff1;
  color: #263238;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.regression-results button.secondary {
  background: #cfd8dc;
}

#chartEditorSelectionInfo {
#chartEditorSelectionInfo {
  font-size: 0.85rem;
  color: #555;
}

#chartEditorPlot {
  flex: 1 1 auto;
  width: 100%;
  min-height: 300px;
  min-height: 0;
  position: relative;
}

#chartEditorPlot > div,
#chartEditorPlot .plot-container,
#chartEditorPlot .svg-container {
  height: 100% !important;
}

.regression-results-modal {
  z-index: 7000 !important;
}

