@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Share Tech Mono', monospace;
    background: #000;
    color: #0f0;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Scanline effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

.container {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #0f0;
    text-shadow: 0 0 10px #0f0, 0 0 20px #0f0;
    font-weight: normal;
}

h3 {
    font-size: 1rem;
    color: #0a0;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: normal;
}

.info-panel {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #030;
    border-left: 3px solid #0f0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.info-item span:first-child {
    color: #060;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-item span:last-child {
    color: #0f0;
    font-weight: bold;
    min-width: 30px;
    text-shadow: 0 0 5px #0f0;
}

input[type="range"] {
    width: 100px;
    cursor: pointer;
    accent-color: #0f0;
    background: #020;
}

input[type="range"]::-webkit-slider-track {
    background: #020;
    border: 1px solid #030;
}

input[type="range"]::-webkit-slider-thumb {
    background: #0f0;
    box-shadow: 0 0 10px #0f0;
}

#roomCanvas {
    border: 2px solid #0f0;
    background: #000;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2), inset 0 0 50px rgba(0, 255, 0, 0.05);
    display: block;
    margin: 0 auto;
    cursor: crosshair;
}

.controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.controls button {
    padding: 10px 25px;
    font-size: 0.85rem;
    font-family: 'Share Tech Mono', monospace;
    background: transparent;
    border: 1px solid #030;
    border-left: 3px solid #0f0;
    color: #0f0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s ease;
}

.controls button:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    transform: translateX(3px);
}

.controls button:active {
    transform: translateX(0);
}

.controls p {
    font-size: 0.8rem;
    color: #060;
}

.controls .material-info {
    margin-top: 5px;
    font-size: 0.8rem;
}

.material-palette {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #030;
    border-left: 3px solid #0f0;
}

.palette-tools {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.material-btn {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-family: 'Share Tech Mono', monospace;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #030;
    color: #0a0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 80px;
}

.material-btn:hover {
    background: rgba(0, 40, 0, 0.8);
    border-color: #0a0;
    transform: translateY(-2px);
}

.material-btn.active {
    background: rgba(0, 60, 0, 0.8);
    border-color: #0f0;
    color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.material-btn .absorption {
    font-size: 0.65rem;
    color: #050;
}

.material-btn.active .absorption {
    color: #0a0;
}

.tool-info {
    text-align: center;
    font-size: 0.75rem;
    color: #050;
}

.tool-info p {
    margin: 3px 0;
}

.speaker-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #030;
    border-left: 3px solid #0f0;
}

.control-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.control-item span:first-child {
    color: #060;
    min-width: 100px;
}

.control-item span:not(:first-child) {
    color: #0f0;
    font-weight: bold;
    min-width: 35px;
    text-shadow: 0 0 5px #0f0;
}

.control-item select {
    padding: 5px 10px;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #030;
    color: #0f0;
    font-size: 0.8rem;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
}

.control-item select:hover {
    border-color: #0f0;
}

.control-item select option {
    background: #000;
    color: #0f0;
}

.acoustic-analysis {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #030;
    border-left: 3px solid #0f0;
}

.acoustic-analysis select,
.acoustic-analysis input[type="number"] {
    padding: 5px 10px;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #030;
    color: #0f0;
    font-size: 0.8rem;
    font-family: 'Share Tech Mono', monospace;
}

.acoustic-analysis select:hover,
.acoustic-analysis input[type="number"]:hover {
    border-color: #0f0;
}

.acoustic-analysis button {
    padding: 8px 15px;
    font-size: 0.75rem;
    font-family: 'Share Tech Mono', monospace;
    background: transparent;
    border: 1px solid #030;
    color: #0a0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.acoustic-analysis button:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    color: #0f0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.mode-results {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 10, 0, 0.8);
    border: 1px solid #020;
    font-size: 0.8rem;
    max-height: 250px;
    overflow-y: auto;
    text-align: left;
}

.mode-results h4 {
    color: #0f0;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: normal;
    text-shadow: 0 0 5px #0f0;
}

.mode-item {
    padding: 5px 10px;
    margin: 5px 0;
    background: rgba(0, 20, 0, 0.5);
    border-left: 3px solid #0f0;
}

.mode-item.warning {
    border-left-color: #ff6b00;
    color: #ffaa66;
}

.mode-item.critical {
    border-left-color: #ff0000;
    color: #ff6666;
}

#freqResponseCanvas,
#waterfallCanvas {
    border: 2px solid #0f0;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    display: block;
    margin: 20px auto;
}

/* Speaker Placement Presets */
.preset-panel {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #030;
    border-left: 3px solid #0f0;
}

.preset-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.preset-btn {
    padding: 8px 15px;
    font-size: 0.75rem;
    font-family: 'Share Tech Mono', monospace;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #030;
    color: #0a0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: rgba(0, 40, 0, 0.8);
    border-color: #0a0;
}

.preset-btn.active {
    background: rgba(0, 60, 0, 0.8);
    border-color: #0f0;
    color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.preset-info {
    font-size: 0.7rem;
    color: #050;
    margin-top: 8px;
}

/* Back link */
.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    color: #0f0;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 8px 16px;
    border: 1px solid #030;
    border-left: 3px solid #0f0;
    transition: all 0.2s ease;
    background: rgba(0, 10, 0, 0.9);
    z-index: 100;
}

.back-link:hover {
    border-color: #0f0;
    background: rgba(0, 40, 0, 0.8);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    transform: translateX(3px);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #010;
}

::-webkit-scrollbar-thumb {
    background: #030;
    border: 1px solid #050;
}

::-webkit-scrollbar-thumb:hover {
    background: #050;
}

@media (max-width: 850px) {
    #roomCanvas {
        max-width: 100%;
        height: auto;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    .info-panel {
        flex-direction: column;
    }
    
    .back-link {
        top: 10px;
        left: 10px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .control-row {
        flex-direction: column;
        align-items: center;
    }
}
