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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 800px;
    width: 100%;
    min-height: 600px;
}

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

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.1);
}

.back-link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(-5px);
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin-top: 10px;
    font-weight: 300;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 300;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 150px;
    justify-content: center;
}

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

.start-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.start-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.stop-btn {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.stop-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #d32f2f, #b71c1c);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(244, 67, 54, 0.3);
}

.clear-btn {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
}

.clear-btn:hover {
    background: linear-gradient(45deg, #f57c00, #ef6c00);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 152, 0, 0.3);
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.status-text {
    font-size: 18px;
    font-weight: 500;
    color: #666;
}

.listening-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}

.listening-indicator.active {
    background: #4CAF50;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.transcript-container {
    margin-bottom: 30px;
}

.transcript-container h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 500;
}

.transcript {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    min-height: 200px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    overflow-y: auto;
    white-space: pre-wrap;
}

.transcript:empty::before {
    content: "Your speech will appear here...";
    color: #999;
    font-style: italic;
}

.settings {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    flex-wrap: wrap;
}

.settings label {
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #333;
}

.settings input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.interim {
    color: #999;
    font-style: italic;
}

.final {
    color: #333;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #ffcdd2;
}

.info-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.info-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.info-section ul {
    margin: 15px 0;
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
    color: #555;
}

kbd {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #333;
    font-family: monospace;
    font-size: 0.9em;
    padding: 2px 6px;
}

.compatibility-note {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .settings {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}