/* Somatics Lab Styles */

:root {
    --color-void: #0a0a1f;
    --color-void-light: #12122a;
    --color-plasma-purple: #a855f7;
    --color-plasma-pink: #ec4899;
    --color-plasma-cyan: #00fff2;
    --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%; position: relative; }

#background-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

.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;
    position: relative;
}

.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-purple); }

.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-purple); }

.lab-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 360px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.viz-section {
    position: relative;
    background: radial-gradient(ellipse at center, #150a20 0%, #050510 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#wave-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Frequency Display */
.frequency-display {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.freq-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(168, 85, 247, 0.3);
    animation: ring-pulse 4s ease-in-out infinite;
}

.ring-1 { width: 180px; height: 180px; animation-delay: 0s; }
.ring-2 { width: 220px; height: 220px; animation-delay: 1s; opacity: 0.6; }
.ring-3 { width: 260px; height: 260px; animation-delay: 2s; opacity: 0.3; }

@keyframes ring-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

.freq-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
    padding: 40px;
    border-radius: 50%;
}

.freq-value {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--color-plasma-purple);
    text-shadow: 0 0 30px var(--color-plasma-purple);
}

.freq-unit {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Mode Indicator */
.mode-indicator {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 10px 20px;
    background: rgba(10,10,31,0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
}

.mode-label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-name {
    display: block;
    font-size: 0.95rem;
    color: var(--color-plasma-pink);
    margin-top: 2px;
}

/* Brainwave Display */
.brainwave-display {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
}

.brainwave-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}

.brainwave-section {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: rgba(255,255,255,0.5);
}

.brainwave-section.delta { background: rgba(139, 92, 246, 0.3); }
.brainwave-section.theta { background: rgba(168, 85, 247, 0.4); }
.brainwave-section.alpha { background: rgba(236, 72, 153, 0.4); }
.brainwave-section.beta { background: rgba(249, 115, 22, 0.4); }
.brainwave-section.gamma { background: rgba(250, 204, 21, 0.4); }

.brainwave-marker {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 40px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
    transition: left 0.5s ease;
    left: 50%;
}

.brainwave-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.65rem;
    color: var(--color-text-dim);
}

/* 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;
}

/* Solfeggio Grid */
.solfeggio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.solfeggio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.solfeggio-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
}

.solfeggio-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--color-plasma-purple);
    color: var(--color-plasma-purple);
}

.sol-freq {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.sol-name {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Body Frequencies Grid */
.body-freq-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.body-freq-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.body-freq-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.body-freq-btn.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.body-freq {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: #ef4444;
}

.body-freq-btn.active .body-freq {
    color: white;
}

.body-name {
    font-size: 0.7rem;
    font-weight: 600;
}

.body-desc {
    font-size: 0.55rem;
    opacity: 0.6;
    line-height: 1.2;
}

/* Binaural Grid */
.binaural-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.binaural-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.binaural-btn:hover {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.3);
}

.binaural-btn.active {
    background: rgba(236, 72, 153, 0.2);
    border-color: var(--color-plasma-pink);
    color: var(--color-plasma-pink);
}

.bi-wave {
    font-size: 1.2rem;
    font-weight: bold;
}

.bi-name {
    font-size: 0.75rem;
}

.bi-desc {
    font-size: 0.65rem;
    opacity: 0.6;
}

/* Planetary Grid */
.planetary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.planetary-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 15px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.planetary-btn:hover {
    background: rgba(0, 255, 242, 0.1);
    border-color: rgba(0, 255, 242, 0.3);
}

.planetary-btn.active {
    background: rgba(0, 255, 242, 0.2);
    border-color: var(--color-plasma-cyan);
    color: var(--color-plasma-cyan);
}

.planet-icon {
    font-size: 1.5rem;
}

.planet-freq {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-plasma-cyan);
}

.planetary-btn.active .planet-freq {
    color: white;
}

.planet-name {
    font-size: 0.75rem;
    font-weight: 600;
}

.planet-desc {
    font-size: 0.6rem;
    opacity: 0.6;
    line-height: 1.3;
}

.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-pink);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--color-plasma-pink);
}

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

.play-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--color-plasma-purple), var(--color-plasma-pink));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

.play-btn.playing {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.play-icon {
    font-size: 1.2rem;
}

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

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

.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); }

.tip {
    background: rgba(168, 85, 247, 0.1);
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--color-plasma-purple) !important;
    font-size: 0.75rem !important;
}

@media (max-width: 900px) {
    .lab-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    .controls-panel {
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
    .solfeggio-grid { grid-template-columns: repeat(3, 1fr); }
    .binaural-grid { grid-template-columns: repeat(2, 1fr); }
}

