/* Global Styles - Minimal Bauhaus */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: #f0f0f0;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.2;
}

.container {
    width: 100%;
    max-width: 1200px;
    min-height: 85vh;
    background: #ffffff;
    border: 3px solid #1a1a1a;
    display: flex;
    flex-direction: column;
}

/* Header Controls - Horizontal Layout */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 2px solid #1a1a1a;
    background: #ffffff;
    flex-wrap: wrap;
    gap: 12px;
}

/* Connection Group */
.connection-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-status {
    display: flex;
    align-items: center;
    color: #888888;
    font-size: 16px;
}

.connection-status.connected {
    color: #1a1a1a;
}

/* Main Controls */
.main-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bank-display {
    background: #1a1a1a;
    color: #ffffff;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 14px;
    min-width: 32px;
    text-align: center;
    font-family: 'Courier New', monospace;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon Buttons */
.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #1a1a1a;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: none;
}

.icon-btn:hover {
    background: #333333;
}

.icon-btn:active {
    background: #000000;
}

#serial-connect-btn {
    background: #888888;
}

#serial-connect-btn:hover {
    background: #666666;
}

#serial-connect-btn.connected {
    background: #1a1a1a;
}

#save-btn {
    background: #666666;
}

#save-btn:hover {
    background: #444444;
}

#load-btn {
    background: #888888;
}

#load-btn:hover {
    background: #666666;
}

/* Modulation Controls */
.mod-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mod-controls label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mod-select {
    padding: 4px 8px;
    background: #ffffff;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    height: 32px;
    min-width: 120px;
}

.mod-select:focus {
    outline: none;
    background: #f0f0f0;
}

/* Port Select */
.port-select {
    padding: 4px 8px;
    background: #ffffff;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 120px;
    height: 32px;
}

.port-select:focus {
    outline: none;
    background: #f0f0f0;
}

/* Status Area */
.status-area {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.status-message {
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    background: #e8e8e8;
    border: 1px solid #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 24px;
    display: flex;
    align-items: center;
}

.status-message.error {
    color: #ffffff;
    background: #1a1a1a;
}

.status-message.warning {
    color: #1a1a1a;
    background: #cccccc;
}

/* Waveform Area */
.waveform-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 0;
}

#waveform-canvas {
    width: 100%;
    flex: 1;
    background: #ffffff;
    cursor: crosshair;
    border: 3px solid #1a1a1a;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: pixelated;
}

/* Step Numbers */
.step-numbers {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1a1a1a;
    margin-top: 0;
}

.step-numbers span {
    font-size: 11px;
    color: #ffffff;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .connection-group,
    .main-controls,
    .mod-controls {
        justify-content: center;
    }
    
    .status-area {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        min-height: 95vh;
        border-width: 3px;
    }
    
    .header-controls {
        padding: 12px 16px;
        border-bottom-width: 2px;
    }
    
    .waveform-area {
        padding: 16px;
    }
    
    #waveform-canvas {
        border-width: 3px;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .bank-display {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .mod-btn {
        padding: 6px 8px;
        min-width: 50px;
        font-size: 9px;
    }
    
    .mod-btn i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        border-width: 2px;
    }
    
    .header-controls {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .waveform-area {
        padding: 12px;
    }
    
    #waveform-canvas {
        border-width: 2px;
    }
    
    .connection-group {
        flex-direction: column;
        gap: 4px;
    }
    
    .main-controls {
        gap: 2px;
    }
    
    .mod-controls {
        gap: 1px;
    }
    
    .mod-btn {
        padding: 4px 6px;
        min-width: 45px;
        font-size: 8px;
    }
    
    .mod-btn i {
        font-size: 12px;
    }
    
    .port-select {
        min-width: 120px;
        font-size: 11px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

/* Waveform Styles */
.grid-line {
    stroke: #cccccc;
    stroke-width: 1;
}

.center-line {
    stroke: #1a1a1a;
    stroke-width: 3;
}

.quarter-line {
    stroke: #e8e8e8;
    stroke-width: 1;
}

.waveform-positive {
    fill: #1a1a1a;
}

.waveform-negative {
    fill: #888888;
}

.waveform-border {
    stroke: #1a1a1a;
    stroke-width: 3;
    fill: none;
}