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

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --text-primary: #eee;
    --text-secondary: #aaa;
    --border: #2a2a4a;
    --success: #00d9ff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--accent), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

#power-btn {
    font-size: 1.2rem;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.power-off {
    background: linear-gradient(135deg, #333, #555);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.power-off:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.power-on {
    background: linear-gradient(135deg, var(--accent), var(--success));
    color: #fff;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(0, 217, 255, 0.5); }
}

.synth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.channel {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.channel:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.2);
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.channel-header h3 {
    color: var(--success);
    font-size: 1.1rem;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--success);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.section {
    margin-bottom: 15px;
}

.section label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.section select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.section select:focus {
    outline: none;
    border-color: var(--accent);
}

.section input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--success));
    cursor: pointer;
    transition: transform 0.2s;
}

.section input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.section input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--success));
    cursor: pointer;
    border: none;
}

/* Ghost Sliders for LFO visualization */
.slider-wrapper {
    position: relative;
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
}

.slider-ghost {
    position: absolute;
    width: 14px;
    height: 14px;
    background: rgba(0, 255, 170, 0.4);
    border: 1px solid rgba(0, 255, 170, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    display: none; /* Only show when modulated */
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    transition: opacity 0.3s ease;
}

.slider-wrapper input[type="range"] {
    position: relative;
    z-index: 2;
    background: transparent !important; /* Let the track show through if needed, but here we want to see the ghost */
}

/* Ensure the track is visible even with transparent background */
.slider-wrapper input[type="range"]::-webkit-slider-runnable-track {
    background: var(--bg-secondary);
    height: 8px;
    border-radius: 4px;
}

.slider-wrapper input[type="range"]::-moz-range-track {
    background: var(--bg-secondary);
    height: 8px;
    border-radius: 4px;
}

.hidden {
    display: none !important;
}

.envelope-section {
    margin-top: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.envelope-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.envelope-row:last-child {
    margin-bottom: 0;
}

.env-control {
    flex: 1;
}

.env-control label {
    font-size: 0.75rem !important;
    margin-bottom: 4px !important;
}

.env-control input[type="range"] {
    height: 6px !important;
}

.env-control input[type="range"]::-webkit-slider-thumb {
    width: 14px !important;
    height: 14px !important;
}

.effects-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.effects-section h4 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.effect-slot {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.effect-slot select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.effect-params {
    margin-top: 10px;
}

.effect-param {
    margin-bottom: 10px;
}

.effect-param label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.effect-param input[type="range"] {
    width: 100%;
    height: 6px;
}

.effect-param input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
}

.master-section {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.master-section h3 {
    color: var(--success);
    margin-bottom: 15px;
}

.master-controls {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.engineering-controls {
    flex: 1;
    min-width: 300px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.engineering-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.trim-control {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trim-control label {
    font-size: 12px;
    color: var(--accent);
    font-weight: bold;
}

#cal-tone-btn.active {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    animation: cal-pulse 2s infinite;
}

@keyframes cal-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.master-controls .section {
    min-width: 150px;
}

#visualizer {
    flex: 1;
    min-width: 300px;
    height: 100px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.visualizer-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}

.vis-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vis-toggle:hover {
    background: var(--accent);
    color: var(--text);
}

/* LFO Controls */
.lfo-controls {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid var(--border);
}

.lfo-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.lfo-instance {
    flex: 1;
    min-width: 180px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
}

.lfo-instance h4 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.lfo-instance label {
    display: block;
    font-size: 0.75rem;
    margin-top: 8px;
    margin-bottom: 2px;
    color: var(--text-secondary);
}

.lfo-instance input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.lfo-instance select {
    width: 100%;
    padding: 4px;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
}

.lfo-hint {
    margin-top: 10px;
    text-align: center;
    color: var(--text-secondary);
}

/* Modulation Assignment UI */
.mod-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
}

.mod-button:hover {
    background: var(--accent);
    color: var(--text);
}

.mod-button.active {
    background: var(--success);
    color: var(--text);
}

.mod-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 8px;
}

.mod-panel label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.mod-panel select,
.mod-panel input[type="range"] {
    width: 100%;
    margin-bottom: 8px;
}

.mod-panel button {
    padding: 4px 12px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.mod-panel .btn-assign {
    background: var(--success);
    color: var(--text);
}

.mod-panel .btn-cancel {
    background: var(--bg-secondary);
    color: var(--text);
}

.presets {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid var(--border);
}

.presets h3 {
    color: var(--success);
    margin-bottom: 15px;
}

.preset-btn {
    padding: 12px 25px;
    margin: 5px;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.preset-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.preset-btn:active {
    transform: translateY(0);
}

/* Master Mixer Styles */
.mixer-section {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.mixer-section h3 {
    color: var(--success);
    margin-bottom: 15px;
}

.mixer-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.mixer-group {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.mixer-group h4 {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent);
    margin-right: 5px;
}

.mixer-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    gap: 10px;
}

.mixer-channel label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    height: 30px;
    display: flex;
    align-items: center;
}

.mixer-fader-wrapper {
    height: 150px;
    width: 30px;
    position: relative;
    display: flex;
    justify-content: center;
}

.mixer-fader {
    -webkit-appearance: none;
    width: 150px;
    height: 30px;
    background: var(--bg-secondary);
    outline: none;
    border-radius: 15px;
    transform: rotate(-90deg);
    position: absolute;
    top: 60px;
    cursor: pointer;
}

.mixer-fader::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 40px;
    background: linear-gradient(to right, #444, #666, #444);
    border: 1px solid #888;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.mixer-fader::-moz-range-thumb {
    width: 20px;
    height: 40px;
    background: linear-gradient(to right, #444, #666, #444);
    border: 1px solid #888;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.vu-meter-master {
    width: 50px;
    height: 220px;
    background: #000;
    border: 2px solid #333;
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    padding: 2px;
    gap: 2px;
}

.vu-segment {
    width: 100%;
    flex: 1;
    background: #111;
    transition: background 0.03s;
    border-radius: 1px;
}

.vu-segment.green.active { background: #00ff00; box-shadow: 0 0 5px #00ff00; }
.vu-segment.orange.active { background: #ffaa00; box-shadow: 0 0 5px #ffaa00; }
.vu-segment.red.active { background: #ff0000; box-shadow: 0 0 5px #ff0000; }

.vu-peak-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    transition: background 0.1s;
}

.vu-peak-indicator.active {
    background: #ff0000;
    box-shadow: 0 0 8px #ff0000;
}

.vu-db-scale {
    position: absolute;
    left: -25px;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-align: right;
    width: 22px;
}

.vu-db-label {
    line-height: 1;
}

.mixer-master {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 10px;
    border: 1px solid var(--accent);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .synth-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .master-controls {
        flex-direction: column;
    }
    
    #visualizer {
        width: 100%;
    }
}

/* Channel disabled state */
.channel.disabled {
    opacity: 0.6;
    filter: grayscale(0.5);
}

/* Active effect indicator */
.effect-slot.active {
    border: 1px solid var(--accent);
}

.random-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s;
    width: 100%;
    display: block;
    text-align: center;
    font-weight: bold;
}

.random-btn:hover {
    background: var(--accent);
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.4);
}

#seq-mute-btn, #drum-mute-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

#seq-mute-btn:hover, #drum-mute-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

#seq-mute-btn.active, #drum-mute-btn.active {
    background: #e94560;
    color: white;
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.drum-mute-channel {
    background: rgba(233, 69, 96, 0.05);
    border-radius: 8px;
}

.random-btn.all-effects {
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    color: white;
    font-size: 0.8rem;
    padding: 8px 16px;
    margin-top: 10px;
}

.random-btn.all-effects:hover {
    background: linear-gradient(135deg, #ff6b6b, var(--accent));
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.6);
}

.channel-controls {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.mute-btn, .solo-btn {
    width: 28px;
    height: 22px;
    font-size: 0.65rem;
    font-weight: bold;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.mute-btn:hover, .solo-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.mute-btn.active {
    background: #e94560;
    color: white;
    border-color: #e94560;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.5);
}

.solo-btn.active {
    background: #f5a623;
    color: #000;
    border-color: #f5a623;
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.5);
}

/* ============================================================================
 * MIDI Section Styles
 * ============================================================================ */

.midi-section {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.midi-section h3 {
    color: var(--success);
    margin-bottom: 15px;
}

.midi-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.midi-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.midi-btn:hover {
    background: var(--accent);
}

.midi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.midi-btn.connected {
    background: var(--success);
    color: var(--bg-primary);
}

.midi-select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 200px;
}

.midi-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.midi-select:focus {
    outline: none;
    border-color: var(--accent);
}

.midi-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.midi-led {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #444;
    border: 1px solid #666;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    vertical-align: middle;
}

.midi-led.connected {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, inset 0 1px 3px rgba(0,0,0,0.3);
}

.midi-led.error {
    background: #ff0000;
    box-shadow: 0 0 10px #ff0000;
}

.midi-status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.midi-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.activity-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 5px;
}

.activity-indicator {
    padding: 4px 10px;
    border-radius: 4px;
    background: #444;
    font-size: 0.75rem;
    color: #888;
    transition: all 0.1s ease;
}

.activity-indicator.active {
    background: var(--success);
    color: var(--bg-primary);
    box-shadow: 0 0 8px var(--success);
}

.midi-help {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    font-size: 0.85rem;
}

.midi-help p {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.midi-help ul {
    list-style: none;
    padding-left: 0;
}

.midi-help li {
    padding: 3px 0;
    color: var(--text-secondary);
}

.midi-help li::before {
    content: "→ ";
    color: var(--accent);
}

/* MIDI Learn Overlay */
#midi-learn-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#midi-learn-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.midi-learn-content {
    background: #1a1a2e;
    border: 2px solid #e94560;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.4);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
}

.toast {
    background: #16213e;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 5px solid #00fff2;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.midi-learning {
    box-shadow: 0 0 10px #e94560 !important;
}

.lfo-meter-container {
    width: 100%;
    height: 4px;
    background: #16213e;
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.lfo-meter {
    height: 100%;
    background: #00fff2;
    width: 50%;
    box-shadow: 0 0 5px #00fff2;
    transition: width 0.05s linear;
}

.user-patch-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #16213e !important;
    border: 1px solid #4e4e6a !important;
}

.user-patch-btn:hover {
    border-color: #00fff2 !important;
}

.delete-patch {
    background: #e94560;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.delete-patch:hover {
    opacity: 1;
}

/* Sequencer Styles */
.sequencer-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.sequencer-section h3 {
    color: var(--accent);
    margin-bottom: 15px;
    text-align: center;
}

.sequencer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.seq-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.seq-btn:hover {
    background: var(--accent);
}

.seq-btn.playing {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg-primary);
}

.seq-tempo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.seq-tempo label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.seq-tempo input {
    width: 100px;
}

.seq-clock-sync {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 10px;
}

.seq-clock-sync label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.seq-clock-sync input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.seq-clock-sync input[type="checkbox"]:checked + * {
    color: var(--accent);
}

.seq-volumes {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.seq-volumes label {
    font-size: 11px;
    color: var(--text-secondary);
}

.seq-volumes input {
    width: 60px;
}

.sequencer-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.seq-row-labels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 35px;
}

.seq-label {
    height: 35px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    padding-right: 10px;
}

.seq-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.seq-row {
    display: flex;
    gap: 4px;
    transition: background-color 0.1s ease;
    border-radius: 4px;
}

.seq-row.flash {
    background-color: rgba(233, 69, 96, 0.4);
}

.seq-step {
    width: 35px;
    height: 35px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
}

.seq-step:hover {
    background: #2a4a6a;
    border-color: var(--accent);
}

.seq-step.active {
    background: var(--accent);
    border-color: var(--accent-hover);
    box-shadow: 0 0 8px var(--accent);
}

.seq-step.current {
    border-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.seq-step.active.current {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 15px var(--success), 0 0 5px var(--accent);
}

.seq-step:nth-child(4n+1) {
    border-left: 2px solid var(--text-secondary);
}

.seq-step-header {
    width: 35px;
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.seq-headers {
    display: flex;
    gap: 4px;
    margin-bottom: 5px;
}

.seq-help {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 15px;
}

.seq-help small {
    font-size: 12px;
}

/* Show sequencer when audio is started */
.sequencer-section.active {
    display: block !important;
}


/* Audio I/O Section (Recording & Output Device) */
.audio-io-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.audio-io-section h3 {
    color: var(--accent);
    margin-bottom: 15px;
    text-align: center;
}

.audio-output-controls,
.recording-controls {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.audio-output-controls:last-child,
.recording-controls:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.audio-output-controls label,
.recording-controls label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.audio-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    min-width: 250px;
    cursor: pointer;
}

.audio-select:hover {
    border-color: var(--accent);
}

.audio-help {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.audio-help small {
    font-size: 12px;
}

/* Recording Controls */
.rec-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rec-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rec-btn:hover:not(:disabled) {
    background: #2a4a6a;
    border-color: var(--accent);
}

.rec-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#rec-start-btn {
    border-color: #ff4444;
}

#rec-start-btn:hover:not(:disabled) {
    background: #ff4444;
    color: white;
}

#rec-start-btn.recording {
    background: #ff4444;
    color: white;
    animation: pulse-record 1s infinite;
}

@keyframes pulse-record {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.rec-timer {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: var(--accent);
    background: var(--bg-primary);
    padding: 8px 15px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.rec-download {
    display: inline-block;
    background: var(--success);
    color: var(--bg-primary);
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}

.rec-download:hover {
    background: #00b8e6;
    transform: translateY(-2px);
}

/* Show audio I/O section when audio starts */
.audio-io-section.active {
    display: block !important;
}

/* Alpha Banner Styles */
.alpha-banner {
    background: linear-gradient(90deg, var(--accent), var(--success));
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.alpha-banner strong {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer Styles */
.main-footer {
    margin-top: 60px;
    padding: 40px 0 20px 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h5 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.footer-links a {
    color: var(--success);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8rem;
}
