/**
 * waves.css - High-quality styling for the Sound Waves Simulation
 */

:root {
    --sim-bg: #111111;
    --panel-bg: #f3f4f6;
    --panel-border: #d1d5db;
    --control-text: #1f2937;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --ph-orange: #f59e0b;
}

body {
    margin: 0;
    padding: 0;
    background-color: #111111;
    color: var(--control-text);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
}

#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #111;
    transform-origin: top left;
}

#simulation-container {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Canvas Area */
#wave-canvas {
    width: 100%;
    height: 100%;
    background-color: var(--sim-bg);
    cursor: crosshair;
}

/* Top Navigation Overlay */
.top-nav {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    background: var(--panel-bg);
    padding: 8px;
    border-radius: 8px;
    border: 2px solid var(--panel-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mode-btn {
    padding: 12px 24px;
    border: 1px solid transparent;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

.mode-btn:hover {
    background: #d1d5db;
}

.mode-btn.active {
    background: var(--ph-orange);
    color: white;
    border: 1px solid #d97706;
    box-shadow: 0 4px 0 #d97706;
    transform: translateY(-2px);
}

.mode-btn.active:active {
    box-shadow: 0 0 0 #d97706;
    transform: translateY(2px);
}

/* Sidebar Controls */
.controls-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 320px;
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 8px;
    padding: 24px;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.control-group {
    margin-bottom: 24px;
}

.control-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--control-text);
    margin-bottom: 8px;
    text-transform: none;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-blue);
    font-weight: 700;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: #d1d5db;
    border-radius: 5px;
    outline: none;
    border: 1px solid #9ca3af;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Specialized mode controls visibility */
.mode-controls {
    display: none;
}

.mode-controls.active {
    display: block;
}

/* Audio Control Component */
.audio-panel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #d1d5db;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid #9ca3af;
}

.slider-switch:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked+.slider-switch {
    background-color: var(--accent-green);
    border-color: #059669;
}

input:checked+.slider-switch:before {
    transform: translateX(20px);
}

/* Select Styling */
select {
    width: 100%;
    padding: 10px;
    background: white;
    border: 2px solid var(--panel-border);
    border-radius: 6px;
    color: var(--control-text);
    outline: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Bottom HUD */
.hud {
    position: absolute;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 items per row */
    gap: 8px;
    max-width: 460px;
}

.hud-item {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    padding: 7px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.hud-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--control-text);
}

.hud-value {
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-blue);
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.resonance-badge {
    color: var(--accent-green);
    animation: pulse 1s infinite;
    font-weight: 800;
}