/**
 * Matched Filter Explorer – Engineering dark dashboard theme.
 * Layout: Sidebar (controls) + Main (Panel A, B, C). Colors: Cyan, Amber, Canvas #252526.
 */

#mfexplorer-root {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    padding: 12px;
    border-radius: 6px;
    box-sizing: border-box;
    max-width: 1100px;
    margin: 0 auto;
}

#mfexplorer-root * {
    box-sizing: border-box;
}

/* Grid: Sidebar (250px) + Main */
.mfexplorer-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 16px;
    min-height: 520px;
}

/* Left sidebar – controls */
.mfexplorer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 10px;
    background-color: #252526;
    border-radius: 6px;
    border: 1px solid #3c3c3c;
}

.mfexplorer-sidebar label {
    display: block;
    font-size: 12px;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.mfexplorer-sidebar select,
.mfexplorer-sidebar input[type="range"] {
    width: 100%;
    margin-bottom: 4px;
}

.mfexplorer-sidebar input[type="range"] {
    accent-color: #00d2ff;
}

.mfexplorer-sidebar select {
    background: #3c3c3c;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
}

.mfexplorer-value {
    font-size: 11px;
    color: #888;
    font-family: 'Consolas', monospace;
}

.mfexplorer-control-group {
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.mfexplorer-control-group:last-of-type {
    border-bottom: none;
}

.mfexplorer-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.mfexplorer-checkbox-row input[type="checkbox"] {
    accent-color: #00d2ff;
}

.mfexplorer-btn {
    background: #0e639c;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 4px;
}

.mfexplorer-btn:hover {
    background: #1177bb;
}

.mfexplorer-btn.playing {
    background: #c5502e;
}

.mfexplorer-button-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.mfexplorer-button-row .mfexplorer-btn {
    flex: 1;
    min-width: 0;
}

.mfexplorer-button-row #mfexplorer-step-fwd,
.mfexplorer-button-row #mfexplorer-step-bwd {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 14px;
}

/* Main content – 3 vertical panels */
.mfexplorer-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mfexplorer-panel {
    background-color: #252526;
    border-radius: 6px;
    border: 1px solid #3c3c3c;
    overflow: hidden;
    min-height: 180px;
}

.mfexplorer-panel-title {
    font-size: 11px;
    color: #888;
    padding: 6px 10px;
    border-bottom: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Panel A split: two half-height plots (Re / Im) — combined height = single Panel A */
.mfexplorer-panel-a-split {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mfexplorer-plot-wrap-half {
    display: flex;
    flex-direction: column;
    height: 14vh;
    min-height: 80px;
    padding: 6px 8px;
    border-bottom: 1px solid #2a2a2a;
}

.mfexplorer-plot-wrap-half:last-child {
    border-bottom: none;
}

.mfexplorer-plot-sublabel {
    flex: 0 0 auto;
    font-size: 10px;
    color: #888;
    padding: 2px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mfexplorer-plot-canvas-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
}

.mfexplorer-plot-canvas-wrap .mfexplorer-plot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Panel A & B: Canvas container */
.mfexplorer-plot-wrap {
    height: 60px;
    min-height: 160px;
    padding: 8px;
    position: relative;
}

.mfexplorer-plot-wrap-half .mfexplorer-plot-canvas-wrap {
    width: 100%;
}

.mfexplorer-plot {
    display: block;
    width: 100%;
    height: 100%;
    background: #252526;
    border-radius: 4px;
    border: 1px solid #3c3c3c;
}

/* Panel C: Split into Phasor Walk (left) and Constellation (right) */
.mfexplorer-panel-c-split {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 10px;
}

.mfexplorer-panel-c-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mfexplorer-panel-c-label {
    font-size: 10px;
    color: #888;
    padding: 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.mfexplorer-toggle-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 10;
    background: rgba(60, 60, 60, 0.85);
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 9px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.mfexplorer-toggle-btn:hover {
    background: rgba(76, 76, 76, 0.9);
    border-color: #666;
}

.mfexplorer-toggle-btn.active {
    background: rgba(14, 99, 156, 0.85);
    border-color: #1177bb;
    color: #fff;
}

.mfexplorer-phasor-canvas-wrap {
    background: #252526;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    height: 200px;
    width: 100%;
    flex: 1;
    position: relative;
}

#mfexplorer-phasor-canvas,
#mfexplorer-constellation-canvas {
    background: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    width: 100%;
    height: 200px;
}

.mfexplorer-lag-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.mfexplorer-lag-row input[type="range"] {
    flex: 1;
    accent-color: #ffba00;
}

/* Tooltip / processing gain hint */
.mfexplorer-hint {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}
