/* Override Grid Layout to make sidebar wider */
@media (min-width: 900px) {
    .module-layout {
        grid-template-columns: 320px 1fr !important; 
        gap: 2rem !important;
    }
}

/* Reuse generic container styles */
.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: crosshair; 
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.overlay-instruction {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    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: 1rem;
    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.5rem; 
    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(5px);
}

.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;
    white-space: nowrap; 
}

.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);
}

.tir-badge {
    background: #ffeaa7;
    color: #d35400;
    border: 1px solid #e1b12c;
    padding: 0.8rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(211, 84, 0, 0.1);
    transition: opacity 0.3s ease;
}

/* --- 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;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    border-top: 1px solid rgba(255,255,255,0.8);
    border-bottom: none;
    
    padding: 1.2rem 2rem;
    display: flex;
    flex-direction: row; /* Horizontal layout */
    justify-content: center;
    align-items: stretch;
    gap: 2rem; /* Gap between sliders and presets */
    width: 100%; 
}

/* --- Slider Group (Left) --- */
.control-group-sliders {
    flex-grow: 1; /* Takes available space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
}

.slider-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1rem; 
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

.slider-row label {
    min-width: 110px; 
    text-align: right;
}

.val-display {
    min-width: 55px;
    text-align: left;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-left: 0.5rem;
}

/* --- Divider --- */
.panel-divider {
    width: 1px;
    background: rgba(0,0,0,0.1);
    margin: 0 0.5rem;
}

/* --- Presets Group (Right) --- */
.control-group-presets {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
}

.preset-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.preset-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

.preset-option span {
    transition: color 0.2s;
}

.preset-option:hover span {
    color: var(--primary);
}

/* Custom Radio Styling */
.preset-option input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    position: relative;
    outline: none;
    transition: all 0.2s;
    margin: 0;
}

.preset-option input[type="radio"]:checked {
    border-color: var(--primary);
    background: #fff;
}

.preset-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

/* Slider Inputs */
input[type=range] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px; 
    background: #cbd5e0;
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); 
    transition: transform 0.1s;
    margin-top: -6px; 
}

input[type=range]::-webkit-slider-runnable-track {
    height: 4px;
    background: #cbd5e0;
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }