/* Classification Metrics Demo Styles */

.demo-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* Top Row: Plot (~65%) + Controls (~35%) */
.top-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.plot-container {
    flex: 0 0 calc((100% - 20px) * 0.65);
    border: 2px solid #ddd;
    background: white;
    padding: 10px;
    box-sizing: border-box;
}

.controls {
    flex: 0 0 calc((100% - 20px) * 0.35);
    background: #f5f7fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Bottom Row: Dataset Selector + Confusion Matrix */
.bottom-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.dataset-selector-panel {
    flex: 1;
    box-sizing: border-box;
}

.confusion-matrix-container {
    flex: 1;
    box-sizing: border-box;
}

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

/* Fancybox customization (styles come from phoebe.css) */
.fancybox-container {
    justify-content: space-between;
}

.fancybox {
    flex: 1;
}

/* Confusion Matrix */
.confusion-matrix-container {
    border: 2px solid #ddd;
    background: white;
    padding: 15px;
    border-radius: 0;
}

.confusion-matrix-container h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.confusion-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cm-header {
    font-weight: 600;
    padding: 8px;
    text-align: center;
    color: #2c3e50;
    font-size: 12px;
}

.cm-row-header {
    width: 50px;
    padding: 0;
}

.rotated-text {
    display: inline-block;
    transform: rotate(-90deg);
    white-space: nowrap;
    transform-origin: center center;
}

.cm-cell {
    width: 120px;
    height: 40px;
    border: 2px solid #34495e;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    vertical-align: middle;
}

.cm-cell:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cm-label {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 5px;
}

.cm-count {
    font-size: 24px;
    font-weight: 700;
}

.cm-tp {
    background: #d4edda;
    color: #155724;
}

.cm-tn {
    background: #d4edda;
    color: #155724;
}

.cm-fp {
    background: #f8d7da;
    color: #721c24;
}

.cm-fn {
    background: #f8d7da;
    color: #721c24;
}

/* Alert Banner */
.alert-banner {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    color: #856404;
    font-weight: 600;
    text-align: center;
    font-size: 13px;
}

/* Metric Tracker - uses metric_tracker pattern from phoebe.css */
/* Demo-specific metric colors */
.metric-sensitivity .metric_tracker_value {
    color: #27ae60;
}

.metric-sensitivity .metric_tracker_bar_fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.metric-specificity .metric_tracker_value {
    color: #2980b9;
}

.metric-specificity .metric_tracker_bar_fill {
    background: linear-gradient(90deg, #2980b9, #3498db);
}

.metric-precision .metric_tracker_value {
    color: #8e44ad;
}

.metric-precision .metric_tracker_bar_fill {
    background: linear-gradient(90deg, #8e44ad, #9b59b6);
}

.metric-accuracy .metric_tracker_value {
    color: #7f8c8d;
}

.metric-accuracy .metric_tracker_bar_fill {
    background: linear-gradient(90deg, #7f8c8d, #95a5a6);
}

.metric-f1 .metric_tracker_value {
    color: #d35400;
}

.metric-f1 .metric_tracker_bar_fill {
    background: linear-gradient(90deg, #d35400, #e67e22);
}

.metric-balanced .metric_tracker_value {
    color: #16a085;
}

.metric-balanced .metric_tracker_bar_fill {
    background: linear-gradient(90deg, #16a085, #1abc9c);
}

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

/* Responsive layout */
@media (max-width: 768px) {
    .top-row {
        flex-direction: column;
    }

    .plot-container,
    .controls {
        flex: 1 1 100%;
        width: 100%;
    }

    .bottom-row {
        flex-direction: column;
    }

    .dataset-boxes {
        flex-direction: column;
    }
}
