/* Tristimulus Color Space Visualization CSS */

.ct-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    font-family: 'Courier New', monospace;
    background-color: #000000;
    color: #ffffff;
    border-radius: 8px;
}

.ct-controls {
    background-color: #111111;
    border: 1px solid #444444;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.ct-control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ct-control-row:last-child {
    margin-bottom: 0;
}

.ct-control-row label {
    color: #00ffff;
    font-size: 15px;
    min-width: 90px;
    text-align: right;
    white-space: nowrap;
}

.ct-control-row label.ct-inline-label {
    min-width: 0;
    margin-left: 6px;
    text-align: left;
}

.ct-control-row input[type="range"] {
    flex: 1;
    min-width: 80px;
    max-width: 400px;
    height: 6px;
    background: #333333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.ct-control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
}

.ct-control-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.ct-control-row select {
    background-color: #1a1a1a;
    color: #00ff00;
    border: 1px solid #444444;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    cursor: pointer;
    min-width: 100px;
}

.ct-control-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #00ff00;
}

.ct-control-value {
    color: #00ff00;
    font-size: 14px;
    min-width: 70px;
    font-family: 'Courier New', monospace;
}

/* Separate info panels for Gamma and Gamut */
.ct-info-panel {
    margin-left: 100px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    max-width: 700px;
}
.ct-info-panel-title {
    color: #00ffff;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
}
.ct-info-panel-body {
    color: #fff;
    font-size: 11px;
    line-height: 1.5;
}

.ct-btn {
    background-color: #002233;
    color: #00ffff;
    border: 1px solid #00ffff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.ct-btn:hover {
    background-color: #00ffff;
    color: #000000;
}

/* View modes: 2D Wheel + 3D Cube */
.ct-view-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.ct-view-tab {
    padding: 6px 12px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.ct-view-tab.active {
    background: #003333;
    color: #00ffff;
    border-color: #00ffff;
}

.ct-view-tab:hover:not(.active) {
    background: #333;
    color: #fff;
}

/* 2D Layout */
.ct-visualization {
    background-color: #000000;
    border: 1px solid #444444;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.ct-view-2d {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.ct-wheel-wrapper {
    flex: 1;
    min-width: 280px;
    text-align: center;
}

.ct-wheel-wrapper canvas {
    display: block;
    margin: 0 auto;
    background: #0a0a0a;
    cursor: crosshair;
    border: 1px solid #333;
    border-radius: 4px;
}

.ct-panel-wrapper {
    flex: 1;
    min-width: 200px;
}

.ct-coords-panel {
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.ct-gamut-status {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
}
.ct-rgb-linear {
    color: #fff;
    font-size: 13px;
    margin-bottom: 2px;
}
.ct-rgb-encoded {
    font-weight: bold;
    font-size: 14px;
    color: #00ff00;
    margin-bottom: 6px;
}
.ct-coords-hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 8px 0;
}
.ct-coords-panel .ct-swatch {
    width: 60px;
    height: 40px;
    border: 1px solid #444;
    border-radius: 4px;
    margin: 8px 0;
}

.ct-luminance-canvas {
    margin-top: 12px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    display: block;
    width: 100%;
}

/* CIE 1931 dual view: 70% 3D + 30% chromaticity */
.ct-view-cie {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 400px;
    width: 100%;
}
.ct-cie-morph-info {
    flex: 1 1 100%;
    margin-top: 8px;
    padding: 12px 14px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #fff;
}
.ct-cie-morph-info-title {
    color: #00ffff;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}
.ct-cie-morph-info-p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}
.ct-cie-morph-info-p:last-of-type {
    margin-bottom: 10px;
}
.ct-cie-morph-table {
    width: 100%;
    max-width: 640px;
    border-collapse: collapse;
    font-size: 11px;
}
.ct-cie-morph-table td, .ct-cie-morph-table th {
    border: 1px solid #333;
    padding: 6px 8px;
    text-align: left;
    color: #fff;
}
.ct-cie-morph-table tr:nth-child(even) {
    background: #111;
}
.ct-cie-left {
    flex: 0 0 70%;
    position: relative;
    min-width: 0;
}
.ct-cie-left .ct-3d-buttons {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}
.ct-cie-left #ct-cie-three-container {
    width: 100%;
    height: 380px;
    background: #000;
}
.ct-cie-left #ct-cie-three-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.ct-cie-right {
    flex: 0 0 calc(30% - 10px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ct-cie-plot-label {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00ffff;
    margin-bottom: 6px;
}
.ct-cie-canvas-wrap {
    position: relative;
    display: inline-block;
}
.ct-cie-hover-overlay {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
    padding: 4px 8px;
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #555;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
}
.ct-cie-hover-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 2px;
}
.ct-cie-hover-rgb {
    vertical-align: middle;
}
.ct-cie-right canvas {
    display: block;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    max-width: 100%;
}
.ct-cie-legend {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #fff;
    margin-top: 6px;
    text-align: center;
}

/* 3D Layout */
.ct-view-3d {
    position: relative;
    min-height: 400px;
}

.ct-view-3d canvas {
    display: block;
    width: 100%;
    background: #000;
    border-radius: 4px;
}

.ct-3d-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ct-3d-btn {
    padding: 6px 10px;
    background: rgba(0, 50, 50, 0.8);
    color: #00ffff;
    border: 1px solid #00ffff;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.ct-3d-btn:hover {
    background: rgba(0, 200, 200, 0.3);
}

/* Probe / Tristimulus curves */
.ct-probe-canvas {
    margin-top: 10px;
    margin-left: -360px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    display: block;
    width: 100%;
}

/* Info frame: formulas, plugged values, results (aligned with L/M/S curves box) */
.ct-info-frame {
    width: 721px;
    margin-left: -360px;
    margin-top: 14px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #fff;
    max-height: 647px;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}
.ct-info-frame::-webkit-scrollbar {
    width: 8px;
}
.ct-info-frame::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}
.ct-info-frame::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.ct-info-frame::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.ct-info-title {
    color: #00ffff;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}
.ct-info-section {
    margin-bottom: 10px;
}
.ct-info-formula-label {
    color: #00ff88;
    font-size: 14px;
    margin-bottom: 2px;
}
.ct-info-formula {
    color: #fff;
    font-size: 12px;
    margin-bottom: 2px;
}
.ct-info-plugged {
    color: #fff;
    font-size: 12px;
    margin-bottom: 1px;
}
.ct-info-result {
    color: #44ff44;
    font-size: 14px;
    font-weight: bold;
}
.ct-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 10px;
}
.ct-info-table td, .ct-info-table th {
    border: 1px solid #333;
    padding: 4px 6px;
    text-align: left;
    color: #fff;
}
.ct-info-table tr:nth-child(even) {
    background: #111;
}

/* Gamut tooltip */
.ct-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #00ffff;
    padding: 6px 10px;
    font-size: 13px;
    color: #00ff00;
    pointer-events: none;
    z-index: 10;
    border-radius: 4px;
}
