/* --- 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%;
}

/* --- Sidebar Styling --- */
.data-sidebar {
    height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    padding-top: 2rem;
    gap: 1.5rem;
    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 Stack */
.data-stack {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.data-stack:last-child { border-bottom: none; margin-bottom: 0; }

.data-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.data-val {
    align-self: flex-end; 
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem; 
}

/* Legend */
.legend-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.line-sample { width: 30px; height: 0; }
.solid { border-top: 3px solid #3498db; }
.dashed { border-top: 3px dashed #e74c3c; }
.wave { border-top: 2px solid rgba(59, 89, 152, 0.3); }

/* --- 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 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

/* Play Button */
.control-group-left {
    padding-right: 1.5rem;
    border-right: 1px solid rgba(0,0,0,0.1);
    flex: 0 0 auto;
}

.control-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.control-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px var(--primary-glow); }

/* Sliders */
.control-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
}

.slider-col { flex-grow: 1; }
.toggle-col { flex: 0 0 auto; align-items: center; }

.slider-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.val-display {
    font-family: 'Roboto Mono', monospace;
    color: var(--text-main);
    font-size: 0.85rem;
}

.panel-divider {
    width: 1px;
    height: 45px;
    background: rgba(0,0,0,0.1);
}

input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px; 
    background: #cbd5e0;
    border-radius: 3px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: 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); }

/* Switch Toggle */
.toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e0;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider { background-color: var(--primary); }
input:focus + .slider { box-shadow: 0 0 1px var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }

.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }