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

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 1rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#textInput {
    width: 100%;
    padding: 1.25rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafbfc;
}

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

.controls {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
}

.voice-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.voice-selector label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

#voiceSelect {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 160px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.generate-btn.loading .btn-text {
    display: none;
}

.generate-btn.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.output-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.audio-container h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-weight: 500;
}

#audioPlayer {
    width: 100%;
    margin-bottom: 1rem;
}

.audio-actions {
    display: flex;
    gap: 1rem;
}

.download-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.hidden {
    display: none !important;
}

.examples {
    background: rgba(255,255,255,0.9);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.examples h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-weight: 500;
}

.example-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.example-btn {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .generate-btn {
        width: 100%;
    }
    
    .example-buttons {
        flex-direction: column;
    }
    
    .example-btn {
        text-align: center;
    }
}

