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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--tg-theme-bg-color, #1a1a2e);
    color: var(--tg-theme-text-color, #ffffff);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.status-container {
    text-align: center;
    width: 100%;
}

.status {
    font-size: 18px;
    font-weight: 500;
    color: var(--tg-theme-hint-color, #8e8e93);
    margin-bottom: 10px;
}

.status.connected {
    color: #34c759;
}

.status.recording {
    color: #ff3b30;
}

.status.playing {
    color: #007aff;
}

.transcript {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #8e8e93);
    min-height: 40px;
    padding: 10px;
    background: var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.1));
    border-radius: 12px;
    display: none;
}

.transcript.visible {
    display: block;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mic-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: var(--tg-theme-button-color, #007aff);
    color: var(--tg-theme-button-text-color, #ffffff);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

.mic-button:disabled {
    background: var(--tg-theme-hint-color, #8e8e93);
    cursor: not-allowed;
    box-shadow: none;
}

.mic-button:not(:disabled):hover {
    transform: scale(1.05);
}

.mic-button:not(:disabled):active,
.mic-button.recording {
    transform: scale(0.95);
    background: #ff3b30;
    box-shadow: 0 4px 20px rgba(255, 59, 48, 0.5);
}

.mic-button.playing {
    background: #34c759;
    box-shadow: 0 4px 20px rgba(52, 199, 89, 0.5);
}

.mic-icon,
.stop-icon {
    width: 40px;
    height: 40px;
}

.hidden {
    display: none !important;
}

.mic-hint {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #8e8e93);
}

.visualizer {
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Animation for recording */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mic-button.recording {
    animation: pulse 1s ease-in-out infinite;
}

/* Wave animation for playing */
@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

.mic-button.playing .mic-icon {
    animation: wave 0.5s ease-in-out infinite;
}
