/* --- Layout Overrides --- */
@media (min-width: 900px) {
    .module-layout {
        grid-template-columns: 280px 1fr !important; 
        gap: 2rem !important;
    }
}

/* --- Canvas Container --- */
.canvas-container {
    position: relative;
    width: 100%;
    height: 550px; 
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
    overflow: hidden;
    cursor: default; 
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Cursor States */
canvas.draggable { cursor: ns-resize; }
canvas.dragging { cursor: grabbing; }
canvas.locked { cursor: not-allowed; }

.overlay-instruction {
    position: absolute;
    top: 30%;
    width: 100%;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.7;
    user-select: none;
    transition: opacity 0.3s ease;
}

/* --- Sidebar Styling --- */
.data-sidebar {
    height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    padding-top: 2rem;
    gap: 1.2rem;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

.data-card {
    background: rgba(255,255,255,0.92);
    padding: 1rem 1.2rem; 
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    backdrop-filter: blur(8px);
}

.data-card h3 {
    margin: 0 0 0.8rem 0;
    font-size: 1rem; 
    color: var(--primary);
    border-bottom: 2px solid rgba(59, 89, 152, 0.1);
    padding-bottom: 0.4rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    color: var(--text-light);
}

.data-val {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--text-main);
}

/* Gauge Bar */
.gauge-bar {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2ed573, #ffa502, #ff4757);
    transition: width 0.1s ease-out;
}

/* --- UI Controls --- */
.ui-layer {
    position: absolute;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10;
    pointer-events: none;
}

.panel-bottom {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    border-top: 1px solid rgba(255,255,255,0.8);
    
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.control-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.slider-col {
    flex: 1; /* Takes available space */
}

.center-col {
    flex: 0 0 auto;
    align-items: center;
}

/* Slider Headers (Label + Value) */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap; /* PREVENTS WRAPPING */
}

.val-display {
    font-family: 'Roboto Mono', monospace;
    color: var(--text-main);
    font-size: 0.85rem;
}

.temp-icon { font-size: 1.1rem; }

.panel-divider {
    width: 1px;
    height: 50px;
    background: rgba(0,0,0,0.1);
    margin: 0 0.5rem;
}

/* Mode Buttons (Similar to Coulomb) */
.col-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mode-toggle-group {
    display: flex;
    gap: 4px;
    background: #f0f2f5;
    padding: 4px;
    border-radius: 8px;
}

.btn-mode {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-light);
    transition: all 0.2s;
}

.btn-mode:hover { background: rgba(0,0,0,0.05); }

.btn-mode.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Custom Slider Styling */
input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px; 
    background: #cbd5e0;
    border-radius: 3px;
    outline: none;
}

/* Temperature Slider Gradient */
#inp-temp { background: linear-gradient(90deg, #3498db, #e74c3c); }

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); 
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }