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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 3.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

.api-input {
    flex: 1;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.api-input:focus {
    border-color: #a78bfa;
    background: rgba(255, 255, 255, 0.1);
}

.api-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(167, 139, 250, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.help-text {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.link {
    color: #a78bfa;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Microphone Section */
.mic-container {
    text-align: center;
    margin-bottom: 2rem;
}

.mic-button {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

.mic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.6);
}

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

@keyframes recording-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mic-icon {
    width: 64px;
    height: 64px;
    color: white;
}

.record-status {
    font-size: 1.125rem;
}

/* Transcript */
.transcript-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 100px;
}

.transcript-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.transcript-text {
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Examples Grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.example-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.875rem;
    text-align: left;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Loading State */
.loading-card {
    text-align: center;
}

.spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #a78bfa;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-step {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Result Section */
.result-card {
    padding: 1.5rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-title {
    font-size: 1.8rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preview-container {
    background: white;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    height: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

/* Code Section */
.code-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-active {
    background: #a78bfa !important;
}

.code-container {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem 1rem;
    background: #a78bfa;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #8b5cf6;
}

.code-display {
    background: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    max-height: 400px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e5e7eb;
}

.code-display code {
    white-space: pre;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-buttons .btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.125rem;
    }

    .input-group {
        flex-direction: column;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .button-group {
        width: 100%;
    }

    .button-group .btn {
        flex: 1;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .preview-container {
        height: 400px;
    }
}