/* Tissue Optics Lab Styles */

:root {
    --color-void: #0a0a1f;
    --color-void-light: #12122a;
    --color-plasma-cyan: #00fff2;
    --color-plasma-red: #ef4444;
    --color-plasma-orange: #f97316;
    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-text-dim: #6b7280;
    --font-main: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --safe-top: env(safe-area-inset-top, 20px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: var(--font-main);
    background: var(--color-void);
    color: var(--color-text);
    height: 100%;
    overflow: hidden;
}

#app { display: flex; flex-direction: column; height: 100%; }

.lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--safe-top) + 10px) 20px 10px;
    background: rgba(10, 10, 31, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 100;
}

.back-link {
    display: flex; align-items: center; gap: 8px;
    color: var(--color-text-muted); text-decoration: none;
    transition: color 0.3s;
}
.back-link:hover { color: var(--color-plasma-red); }

.lab-title { text-align: center; }
.lab-title h1 { font-size: 1.3rem; font-weight: 600; }
.lab-tagline { font-size: 0.8rem; color: var(--color-plasma-red); }

.lab-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    overflow: hidden;
}

.viz-section {
    position: relative;
    background: linear-gradient(180deg, #1a0a0a 0%, #0a0505 100%);
    overflow: hidden;
}

#tissue-canvas {
    width: 100%; height: 100%;
    display: block;
}

/* Depth Scale */
.depth-scale {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    height: 300px;
    width: 60px;
    display: flex;
    flex-direction: column;
}

.depth-marker {
    position: absolute;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--color-plasma-cyan);
    box-shadow: 0 0 10px var(--color-plasma-cyan);
    transition: top 0.3s ease;
}

.depth-value {
    position: absolute;
    right: 70px;
    top: -8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-plasma-cyan);
    white-space: nowrap;
}

.depth-labels {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--color-text-dim);
}

/* Stats Panel */
.stats-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(10,10,31,0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}

.stat { display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 0.65rem; color: var(--color-text-dim); text-transform: uppercase; }
.stat-value { font-family: var(--font-mono); font-size: 0.95rem; color: var(--color-plasma-red); }

/* Controls Panel */
.controls-panel {
    background: var(--color-void-light);
    border-left: 1px solid rgba(255,255,255,0.05);
    padding: 20px;
    overflow-y: auto;
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.panel-section:last-of-type { border-bottom: none; }

.panel-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.control-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-plasma-cyan);
    margin-top: 5px;
}

.slider {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    background: var(--color-plasma-red);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--color-plasma-red);
}

.slider-cyan::-webkit-slider-thumb {
    background: var(--color-plasma-cyan);
    box-shadow: 0 0 10px var(--color-plasma-cyan);
}

.wavelength-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.wavelength-value {
    font-family: var(--font-mono);
    font-size: 1rem;
}

.wavelength-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    box-shadow: 0 0 15px currentColor;
}

/* Preset Buttons */
.preset-group { margin-top: 15px; }
.preset-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.preset-btn {
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.preset-btn:hover { border-color: rgba(255,255,255,0.2); }
.preset-btn.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-plasma-red);
    color: var(--color-plasma-red);
}

/* Tissue Buttons */
.tissue-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tissue-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tissue-btn:hover { border-color: rgba(255,255,255,0.2); }
.tissue-btn.active {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--color-plasma-orange);
    color: var(--color-plasma-orange);
}

.tissue-icon { font-size: 1.3rem; }

.action-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-plasma-red), var(--color-plasma-orange));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.info-panel {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 15px;
    border-left: 3px solid var(--color-plasma-orange);
}

.info-panel h4 {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: var(--color-plasma-orange);
}

.info-panel p {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.info-panel strong { color: var(--color-text); }

@media (max-width: 900px) {
    .lab-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    .controls-panel {
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
    .stats-panel { flex-wrap: wrap; }
}

