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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.1);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.header p {
    color: #64748b;
    font-size: 1.1rem;
}

.section {
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.password-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.slider-container {
    margin-bottom: 20px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.slider-value {
    text-align: center;
    font-weight: 500;
    color: #667eea;
    margin-top: 8px;
    font-size: 0.9rem;
}

.select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.character-count {
    text-align: right;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.audio-player {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    display: none;
}

.audio-player.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 500;
}

.loading.show {
    display: block;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

.toggle-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 60px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.api-help-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.help-link:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.status-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.progress-container {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
}

.download-section {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.download-section p {
    margin-bottom: 15px;
    color: #059669;
    font-weight: 600;
}

.btn-download {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.4);
}

.preview-section {
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.preview-section p {
    margin: 0 0 15px 0;
    font-weight: 600;
    color: #334155;
}

.preview-section audio {
    width: 100%;
    outline: none;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 24px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .button-group {
        flex-direction: column;
    }
    
    .password-input {
        flex-direction: column;
    }
    
    .toggle-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        padding: 20px;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 24px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .textarea {
        min-height: 100px;
    }
}