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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #1a1a2e;
    color: #fff;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.btn.start {
    background: linear-gradient(135deg, #34c759, #28a745);
    color: #fff;
}

.btn.start:hover:not(:disabled) {
    background: linear-gradient(135deg, #2db84d, #22923d);
    transform: scale(1.02);
}

.btn.start.connected {
    background: linear-gradient(135deg, #ff3b30, #dc2626);
}

.btn.voice {
    background: linear-gradient(135deg, #007aff, #0055d4);
    color: #fff;
    font-size: 1.2rem;
    padding: 10px 16px;
}

.btn.voice:hover:not(:disabled) {
    background: linear-gradient(135deg, #0066dd, #0044bb);
    transform: scale(1.02);
}

.btn.voice.recording {
    background: linear-gradient(135deg, #ff3b30, #dc2626);
    animation: pulse 1s ease-in-out infinite;
}

.btn.keepalive {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    padding: 10px 16px;
}

.btn.keepalive:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.btn.keepalive.active {
    background: linear-gradient(135deg, #34c759, #28a745);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
}

#terminal-container {
    flex: 1;
    background: #0d0d0d;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

#placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1rem;
}

#placeholder.hidden {
    display: none;
}

#terminal {
    height: 100%;
    padding: 8px;
}

.status {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status:empty {
    display: none;
}

.status.info {
    background: rgba(0, 122, 255, 0.15);
    color: #5ac8fa;
}

.status.success {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.status.error {
    background: rgba(255, 59, 48, 0.15);
    color: #ff6b6b;
}

.status.recording {
    background: rgba(255, 59, 48, 0.15);
    color: #ff6b6b;
}

/* XTerm Anpassungen */
.xterm {
    padding: 8px;
}

.xterm-viewport {
    overflow-y: auto !important;
}

.xterm-viewport::-webkit-scrollbar {
    width: 8px;
}

.xterm-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.xterm-viewport::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }

    h1 {
        text-align: center;
    }

    .controls {
        justify-content: center;
    }

    #terminal-container {
        min-height: 300px;
    }
}
