/* styles.css */

/* Base styles for the body */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

/* Header styling for branding */
header {
    text-align: center;
    padding: 20px;
    background-color: #1a73e8;
    color: white;
}

/* Main section with Flexbox layout */
section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
}

/* Calculator section for image upload and dot placement */
.calculator {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 50%;
}

/* Outputs section for plots and table */
.outputs {
    width: 50%;
}

/* Container for axis range inputs and canvas (side by side) */
.input-canvas-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Axis range inputs for setting min/max values */
.axis-range {
    margin: 10px 0;
    flex: 1;
}

/* Input fields for axis ranges */
.axis-range input[type="number"] {
    width: 100%;
    max-width: 150px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin: 5px 0;
}

/* Dropdown for selecting X-axis scale type */
.axis-range select {
    width: 100%;
    max-width: 150px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin: 5px 0;
}

/* Focus state for axis range inputs */
.axis-range input[type="number"]:focus,
.axis-range select:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 5px rgba(26, 115, 232, 0.5);
}

/* Stage indicator for showing current calibration stage */
#stage-indicator {
    margin: 10px 0;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
    text-align: center;
}

/* Different background colors for each stage */
#stage-indicator.x-axis {
    background-color: #e0e0e0;
}

#stage-indicator.y-axis {
    background-color: #fffde7;
}

#stage-indicator.dot-placement {
    background-color: #e8f5e9;
}

/* Zoom canvas for magnifying glass view */
#zoom-canvas {
    display: none;
    width: 200px;
    height: 200px;
    border: 2px solid #1a73e8;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    background-color: #f8f9fa;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* Instructions text for user guidance */
.instructions {
    margin: 10px 0;
    font-size: 14px;
    color: #555;
}

/* Styling for labels */
label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}

/* Canvas for image, dots, and fitted curve */
canvas {
    max-width: 450px;
    width: 100%;
    height: auto;
    flex: 2;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    aspect-ratio: attr(width) / attr(height);
}

/* Fixed div for cursor coordinates */
#cursor-coords {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
}

/* Div for chart coordinates below the chart in the lower left */
.chart-coords {
    position: absolute;
    bottom: 5px; // Adjusted to move up further, closer to the chart
    left: 10px;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    z-index: 10;
}

/* Buttons (Fit Curve, Reset, Apply Calibration, etc.) */
button {
    background-color: #1a73e8;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
}

/* Hide Y-axis calibration button by default */
#apply-y-calibration-btn {
    display: none;
}

/* Hover state for buttons */
button:hover {
    background-color: #1557b0;
}

/* Scale buttons for toggling X-axis (Linear/Log) */
.scale-buttons {
    margin: 10px 0;
}

/* Data table for preview */
#data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Table headers */
#data-table th {
    background-color: #1a73e8;
    color: white;
    padding: 8px;
    text-align: left;
}

/* Table cells */
#data-table td {
    padding: 8px;
    border-top: 1px solid #dee2e6;
}

/* Series selection inputs */
#series-select, #series-name {
    width: 100%;
    max-width: 150px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    margin: 5px 0;
}

#series-name {
    max-width: 200px;
}

/* Styles for textbook-like equations */
.fraction {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
}

.fraction .numerator {
    display: block;
    border-bottom: 1px solid black;
    padding-bottom: 2px;
}

.fraction .denominator {
    display: block;
    padding-top: 2px;
}

.equation {
    display: inline-block;
    vertical-align: middle;
    margin: 10px;
}

/* Styles for save/load configuration buttons */
.config-buttons {
    margin-top: 20px;
    text-align: center;
}