/* Regularisation demo styles */

canvas {
    max-width: 100%;
    height: auto;
}

.value-display {
    font-size: 16px;
    font-weight: bold;
    color: #2563eb;
}

/* Demo-specific cell color classes for coefficients table */
.horizontal-scroll-table tbody td.var-badge {
    background: #2c3e50 !important;
    color: white !important;
    font-weight: 700;
    font-family: inherit;
    position: sticky;
    left: 0;
    z-index: 2;
}

.horizontal-scroll-table tbody td.unreg-value {
    background: #e9ecef;
    color: #6c757d;
}

.horizontal-scroll-table tbody td.l1-penalty {
    background: #fff3e0;
    color: #e67e22;
}

.horizontal-scroll-table tbody td.l2-penalty {
    background: #f3e5f5;
    color: #9b59b6;
}

.horizontal-scroll-table tbody td.eff-value {
    background: #d1ecf1;
    color: #0c5460;
    font-weight: bold;
}

.horizontal-scroll-table tbody td.delta-value {
    font-weight: bold;
}

.horizontal-scroll-table tbody td.delta-value.shrinkage {
    background: #d4edda;
    color: #155724;
}

.horizontal-scroll-table tbody td.delta-value.growth {
    background: #fff3cd;
    color: #856404;
}

.horizontal-scroll-table tbody td.delta-value.neutral {
    background: #e9ecef;
    color: #6c757d;
}

/* Zero values shown as dashes should not be bold */
.horizontal-scroll-table tbody td.zero-dash {
    font-weight: normal !important;
}

.horizontal-scroll-table tbody tr:hover td:not(.var-badge) {
    filter: brightness(0.95);
}

/* MetricLabel Display - at top */
.metriclabel-container {
    display: flex;
    justify-content: center;
}

.metriclabel-container--spaced {
    margin: 20px 0;
}

.metriclabel-row {
    text-align: center;
    font-size: 16px;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 0;
    border: 2px solid #dee2e6;
    min-width: 300px;
}

/* Left Column Wrapper - contains chart and control panels */
.left-column-wrapper {
    display: flex;
    flex-direction: column;
}

/* Control Row - Data Buttons and Visualization Selector */
.control-row {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Data Buttons Panel */
.data-buttons-panel {
    flex: 0 0 auto;
    border: 2px solid #ddd;
    border-radius: 0;
    background: white;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
}

.data-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.data-btn:last-child {
    margin-bottom: 0;
}

.data-btn:hover {
    background: #2980b9;
}

.data-btn:active {
    background: #21618c;
}

/* Color variations for data buttons */
#generate-data-btn {
    background: #27ae60;
}

#generate-data-btn:hover {
    background: #229954;
}

#generate-data-btn:active {
    background: #1e8449;
}

#clear-data-btn {
    background: #e74c3c;
}

#clear-data-btn:hover {
    background: #c0392b;
}

#clear-data-btn:active {
    background: #a93226;
}

/* Visualization Selector Panel */
.visualization-selector-panel {
    flex: 0 0 auto;
    border: 2px solid #ddd;
    border-radius: 0;
    background: white;
    padding: 12px 16px;
}

.visualization-selector-panel h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.visualization-boxes {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

.visualization-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 70px;
    padding: 4px;
    border: 3px solid #bdc3c7;
    border-radius: 8px;
    background: #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Subtle colors for inactive visualization box */
.visualization-box[data-visualization="squared-errors"]:not(.active) {
    background: #fef9f8;
    border-color: #f8e5e1;
}

.visualization-box:hover {
    border-color: #95a5a6;
    background: #dfe6e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.visualization-graphic {
    margin-bottom: 4px;
    color: #7f8c8d;
}

/* Subtle graphic colors for inactive box */
.visualization-box[data-visualization="squared-errors"]:not(.active) .visualization-graphic {
    color: #e0b3a7;
}

.visualization-label {
    font-size: 11px;
    font-weight: 600;
    color: #34495e;
    text-align: center;
    line-height: 1.2;
}

/* Subtle label colors for inactive box */
.visualization-box[data-visualization="squared-errors"]:not(.active) .visualization-label {
    color: #e0b3a7;
    opacity: 0.5;
}

/* Norm display styling */
.norm-display {
    font-size: 13px;
    font-weight: 700;
    font-family: monospace;
    text-align: center;
    margin-top: 4px;
    color: #2c3e50;
}

/* L1 norm box styling - active state */
.visualization-box[data-visualization="l1-norm"].active {
    border-color: #e67e22;
    background: #fff3e0;
}

.visualization-box[data-visualization="l1-norm"].active .visualization-graphic {
    color: #e67e22;
}

.visualization-box[data-visualization="l1-norm"].active .visualization-label {
    color: #d35400;
}

/* L1 norm box styling - inactive state (λ₁ = 0) */
.visualization-box[data-visualization="l1-norm"]:not(.active) {
    border-color: #ddd;
    background: #f5f5f5;
    opacity: 0.6;
}

.visualization-box[data-visualization="l1-norm"]:not(.active) .visualization-graphic {
    color: #999;
}

.visualization-box[data-visualization="l1-norm"]:not(.active) .visualization-label {
    color: #999;
}

/* L2 norm box styling - active state */
.visualization-box[data-visualization="l2-norm"].active {
    border-color: #9b59b6;
    background: #f3e5f5;
}

.visualization-box[data-visualization="l2-norm"].active .visualization-graphic {
    color: #9b59b6;
}

.visualization-box[data-visualization="l2-norm"].active .visualization-label {
    color: #8e44ad;
}

/* L2 norm box styling - inactive state (λ₂ = 0) */
.visualization-box[data-visualization="l2-norm"]:not(.active) {
    border-color: #ddd;
    background: #f5f5f5;
    opacity: 0.6;
}

.visualization-box[data-visualization="l2-norm"]:not(.active) .visualization-graphic {
    color: #999;
}

.visualization-box[data-visualization="l2-norm"]:not(.active) .visualization-label {
    color: #999;
}

/* Active State - Red theme for squared errors */
.visualization-box.active[data-visualization="squared-errors"] {
    border-color: #e74c3c;
    background: #fef5f4;
}

.visualization-box.active[data-visualization="squared-errors"] .visualization-graphic {
    color: #c0392b;
}

.visualization-box.active[data-visualization="squared-errors"] .visualization-label {
    color: #a93226;
}

/* Hide the actual checkbox - we'll use the box click to toggle */
.visualization-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
