/* Moog Modular Synthesizer - Styles */

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

body {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* Header */
.header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(90deg, #2d1810 0%, #4a2c1a 50%, #2d1810 100%);
    border-bottom: 4px solid #8b4513;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: relative;
}

.info-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4a3828, #2d1810);
    border: 2px solid #8b4513;
    color: #ffd700;
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    line-height: 1;
    padding-left: 1px;
}

.info-btn:hover {
    background: linear-gradient(145deg, #5a4838, #3d2820);
    border-color: #ffd700;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255,215,0,0.4);
}

.header h1 {
    font-size: 2.5em;
    color: #ffd700;
    text-shadow: 0 0 10px #ff8c00, 0 0 20px #ff6600;
    letter-spacing: 8px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header p {
    color: #cd853f;
    margin-top: 5px;
    font-size: 0.9em;
}

/* Synth Container */
.synth-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Module Base */
.module {
    background: linear-gradient(180deg, #3d3d3d 0%, #2a2a2a 50%, #1f1f1f 100%);
    border: 3px solid #555;
    border-radius: 10px;
    padding: 15px;
    box-shadow:
        inset 0 2px 5px rgba(255,255,255,0.1),
        0 5px 15px rgba(0,0,0,0.5);
    position: relative;
}

.module::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    border-radius: 2px;
}

.module-title {
    text-align: center;
    color: #ffd700;
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(255,215,0,0.5);
}

/* Module Sizes */
.vco-module { min-width: 180px; }
.mixer-module { min-width: 150px; }
.filter-module { min-width: 200px; }
.adsr-module { min-width: 220px; }
.lfo-module { min-width: 180px; }
.effects-module { min-width: 200px; }
.master-module { min-width: 150px; }

/* Knob Styles */
.knob-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 5px;
}

.knob {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border: 3px solid #666;
    position: relative;
    cursor: pointer;
    box-shadow:
        0 4px 8px rgba(0,0,0,0.4),
        inset 0 -2px 5px rgba(0,0,0,0.3),
        inset 0 2px 5px rgba(255,255,255,0.1);
}

.knob::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, #ffd700, #ff8c00);
    border-radius: 2px;
    box-shadow: 0 0 5px #ffd700;
}

.knob.small {
    width: 45px;
    height: 45px;
}

.knob.small::after {
    top: 6px;
    width: 3px;
    height: 15px;
}

.knob-label {
    color: #aaa;
    font-size: 0.7em;
    margin-top: 8px;
    text-transform: uppercase;
}

.knob-value {
    color: #ffd700;
    font-size: 0.65em;
    margin-top: 2px;
}

.knob-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

/* Wave Selector Buttons */
.wave-selector {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin: 10px 0;
}

.wave-btn {
    width: 35px;
    height: 30px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wave-btn:hover {
    border-color: #ffd700;
}

.wave-btn.active {
    background: #3d2a00;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255,215,0,0.3);
}

.wave-btn svg {
    width: 20px;
    height: 15px;
    stroke: #ffd700;
    fill: none;
    stroke-width: 2;
}

/* LED Indicators */
.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #330000;
    border: 1px solid #555;
    margin: 5px auto;
    transition: all 0.1s;
}

.led.on {
    background: #ff0000;
    box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
}

.led.green.on {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

/* Patch Points */
.patch-section {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #444;
}

.patch-point {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #333, #111);
    border: 2px solid #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.patch-point:hover {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.patch-point.connected {
    background: radial-gradient(circle at 30% 30%, #ffd700, #996600);
}

.patch-point-label {
    font-size: 0.5em;
    color: #888;
    text-align: center;
    margin-top: 2px;
}

/* Keyboard */
.keyboard-container {
    background: linear-gradient(180deg, #2d1810 0%, #1a0f0a 100%);
    padding: 20px;
    border-top: 4px solid #8b4513;
    margin-top: 20px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.keyboard {
    display: flex;
    position: relative;
    height: 140px;
    width: fit-content;
    margin: 0 auto;
    overflow-x: auto;
    padding-bottom: 20px;
}

.white-key {
    width: 28px;
    height: 120px;
    background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 85%, #ccc 100%);
    border: 1px solid #999;
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: all 0.05s;
    box-shadow:
        inset 0 -5px 10px rgba(0,0,0,0.1),
        0 3px 5px rgba(0,0,0,0.3);
}

.white-key:hover {
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 85%, #ddd 100%);
}

.white-key:active, .white-key.pressed {
    background: linear-gradient(180deg, #ddd 0%, #ccc 85%, #bbb 100%);
    height: 118px;
    margin-top: 2px;
}

.black-key {
    width: 18px;
    height: 75px;
    background: linear-gradient(180deg, #333 0%, #1a1a1a 90%, #000 100%);
    border-radius: 0 0 3px 3px;
    cursor: pointer;
    position: absolute;
    z-index: 2;
    top: 0;
    transition: all 0.05s;
    box-shadow:
        inset 0 -3px 5px rgba(255,255,255,0.1),
        0 3px 8px rgba(0,0,0,0.5);
}

.black-key:hover {
    background: linear-gradient(180deg, #444 0%, #2a2a2a 90%, #111 100%);
}

.black-key:active, .black-key.pressed {
    background: linear-gradient(180deg, #222 0%, #111 90%, #000 100%);
    height: 73px;
    margin-top: 2px;
}

.key-label {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55em;
    font-weight: bold;
    color: #333;
    pointer-events: none;
}

.black-key .key-label {
    color: #ffd700;
    bottom: 4px;
    font-size: 0.5em;
}

.octave-marker {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6em;
    color: #888;
    pointer-events: none;
}

/* Oscilloscope */
.oscilloscope {
    background: #001100;
    border: 3px solid #444;
    border-radius: 10px;
    padding: 10px;
    margin: 10px;
}

.oscilloscope canvas {
    background: #001a00;
    border-radius: 5px;
    display: block;
}

.scope-label {
    color: #00ff00;
    font-size: 0.7em;
    text-align: center;
    margin-top: 5px;
}

/* Preset Buttons */
.preset-section {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 15px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 10px 20px;
    background: linear-gradient(180deg, #4a3520 0%, #2d1810 100%);
    border: 2px solid #8b4513;
    border-radius: 5px;
    color: #ffd700;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: linear-gradient(180deg, #5a4530 0%, #3d2820 100%);
    box-shadow: 0 0 15px rgba(255,215,0,0.3);
}

/* Demo Section */
.demo-section {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 10px 15px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border-top: 1px solid #333;
}

.demo-label {
    color: #00ffff;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    text-shadow: 0 0 5px #00ffff;
}

.demo-btn {
    padding: 8px 16px;
    background: linear-gradient(180deg, #0a3030 0%, #051a1a 100%);
    border: 2px solid #00ffff;
    border-radius: 5px;
    color: #00ffff;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    transition: all 0.2s;
    text-shadow: 0 0 5px #00ffff;
}

.demo-btn:hover {
    background: linear-gradient(180deg, #0f4040 0%, #0a2a2a 100%);
    box-shadow: 0 0 15px rgba(0,255,255,0.4);
}

.demo-btn.playing {
    background: linear-gradient(180deg, #00ffff 0%, #008888 100%);
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 20px rgba(0,255,255,0.6);
}

.demo-btn.stop-btn {
    border-color: #ff6666;
    color: #ff6666;
    text-shadow: 0 0 5px #ff6666;
}

.demo-btn.stop-btn:hover {
    background: linear-gradient(180deg, #400a0a 0%, #1a0505 100%);
    box-shadow: 0 0 15px rgba(255,102,102,0.4);
}

/* Recording Button */
.demo-btn.rec-btn {
    border-color: #ff4444;
    color: #ff4444;
    text-shadow: 0 0 5px #ff4444;
}

.demo-btn.rec-btn:hover {
    background: linear-gradient(180deg, #400a0a 0%, #1a0505 100%);
    box-shadow: 0 0 15px rgba(255,68,68,0.4);
}

.demo-btn.rec-btn.recording {
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
    color: #fff;
    text-shadow: none;
    animation: pulse-rec 1s infinite;
}

@keyframes pulse-rec {
    0%, 100% { box-shadow: 0 0 10px rgba(255,68,68,0.6); }
    50% { box-shadow: 0 0 25px rgba(255,68,68,0.9); }
}

/* Preset Manager Section */
.preset-manager {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 10px 15px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border-bottom: 1px solid #333;
}

.preset-manager-label {
    color: #ff9900;
    font-size: 0.85em;
    text-shadow: 0 0 5px #ff9900;
}

.preset-select {
    background: #1a1a1a;
    color: #ff9900;
    border: 2px solid #ff9900;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    min-width: 150px;
    cursor: pointer;
}

.preset-select:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255,153,0,0.4);
}

.preset-manager-btn {
    padding: 8px 14px;
    background: linear-gradient(180deg, #302010 0%, #1a0f05 100%);
    border: 2px solid #ff9900;
    border-radius: 5px;
    color: #ff9900;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    transition: all 0.2s;
    text-shadow: 0 0 5px #ff9900;
}

.preset-manager-btn:hover {
    background: linear-gradient(180deg, #403020 0%, #2a1f15 100%);
    box-shadow: 0 0 15px rgba(255,153,0,0.4);
}

.preset-manager-btn.delete-btn {
    border-color: #ff6666;
    color: #ff6666;
    text-shadow: 0 0 5px #ff6666;
}

.preset-manager-btn.delete-btn:hover {
    background: linear-gradient(180deg, #400a0a 0%, #1a0505 100%);
    box-shadow: 0 0 15px rgba(255,102,102,0.4);
}

/* Info Panel */
.info-panel {
    text-align: center;
    padding: 15px;
    color: #888;
    font-size: 0.8em;
}

.info-panel kbd {
    background: #333;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #555;
    color: #ffd700;
}

/* Patch Cables Canvas */
#patch-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Glide Control */
.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px;
}

.vertical-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 8px;
    background: linear-gradient(90deg, #1a1a1a, #333);
    border-radius: 4px;
    outline: none;
    border: 1px solid #555;
}

.vertical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 25px;
    background: linear-gradient(180deg, #666, #333);
    border: 2px solid #888;
    border-radius: 3px;
    cursor: pointer;
}

.slider-label {
    color: #aaa;
    font-size: 0.7em;
    margin-top: 5px;
}

/* Sequencer */
.sequencer-module {
    min-width: 400px;
}

.sequencer-grid {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.seq-step {
    width: 40px;
    height: 50px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.seq-step.active {
    border-color: #ffd700;
    background: #2a2000;
}

.seq-step.current {
    box-shadow: 0 0 15px #ffd700;
}

.seq-step input {
    width: 30px;
    background: transparent;
    border: none;
    color: #ffd700;
    text-align: center;
    font-size: 0.8em;
}

.transport {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.transport-btn {
    width: 50px;
    height: 40px;
    background: linear-gradient(180deg, #333, #1a1a1a);
    border: 2px solid #555;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.transport-btn:hover {
    border-color: #ffd700;
}

.transport-btn.playing {
    background: linear-gradient(180deg, #003300, #001a00);
    border-color: #00ff00;
}

.transport-btn svg {
    width: 20px;
    height: 20px;
    fill: #ffd700;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.85em;
    border-top: 1px solid #333;
    margin-top: 20px;
}

footer a {
    color: #ffd700;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
