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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-y: auto;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    color: #4a9eff;
    margin-bottom: 20px;
    font-size: 24px;
}

h3 {
    color: #4a9eff;
    margin-bottom: 15px;
    font-size: 16px;
}

.status-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4444;
    margin-right: 10px;
    transition: background 0.3s;
}

.status-indicator.connected {
    background: #44ff44;
}

.status-indicator.connecting {
    background: #ffaa44;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.audio-settings {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.audio-settings .input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.audio-settings select {
    flex: 1;
    padding: 8px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
}

.audio-settings select:focus {
    outline: none;
    border-color: #4a9eff;
}

.refresh-btn {
    padding: 8px 12px;
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: #4a4a4a;
    border-color: #4a9eff;
}

.mode-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    background: #3a3a3a;
    border-color: #4a9eff;
}

.mode-btn.active {
    background: #4a9eff;
    border-color: #4a9eff;
    color: white;
}

.config-section {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #b0b0b0;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #4a9eff;
}

.action-btn {
    padding: 12px;
    background: #4a9eff;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin: 0 5px;
}

.action-btn:hover {
    background: #3a8eef;
}

.action-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

.disconnect-btn {
    background: #ff4444;
}

.disconnect-btn:hover {
    background: #dd3333;
}

.mute-btn {
    background: #666;
}

.mute-btn:hover {
    background: #777;
}

.mute-btn.muted {
    background: #ff4444;
}

.mute-btn.muted:hover {
    background: #dd3333;
}

input[type="range"] {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    height: 6px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    border: none;
}

.connected-section {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.audio-visualizer {
    margin-bottom: 20px;
    background: #1a1a1a;
    border-radius: 4px;
    padding: 10px;
}

#audioCanvas {
    width: 100%;
    height: 100px;
}

.log-section {
    flex: 1;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

#logArea {
    flex: 1;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
}

.log-entry.error {
    color: #ff6666;
}

.log-entry.success {
    color: #66ff66;
}

.log-entry.info {
    color: #6666ff;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.settings-grid .input-group:last-child {
    grid-column: span 2;
}

.server-config {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.server-config small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

.connection-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.audio-visualizer-container {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#refreshDevicesBtn {
    background: #666;
}

#refreshDevicesBtn:hover {
    background: #777;
}