/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.anycoder-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.anycoder-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.controls {
    margin-bottom: 30px;
}

.device-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-weight: 500;
}

.device-selector select {
    padding: 10px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

#text-input {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 16px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: white;
}

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

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.generate-btn, .play-btn, .stop-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
    min-width: 200px;
    justify-content: center;
}

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

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

.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;
}

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

.play-btn {
    background: #10b981;
    color: white;
}

.play-btn:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
}

.stop-btn {
    background: #ef4444;
    color: white;
}

.stop-btn:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
}

.play-btn:disabled, .stop-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.audio-section {
    text-align: center;
    padding: 30px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

.status {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.status.loading {
    background: #fef3c7;
    color: #92400e;
}

.status.success {
    background: #d1fae5;
    color: #065f46;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
}

.status.warning {
    background: #fef3c7;
    color: #92400e;
}

.download-section {
    margin-top: 20px;
}

#download-link {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

#download-link:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 40px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 25px 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .generate-btn {
        min-width: auto;
    }
    
    .device-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    #text-input {
        padding: 16px;
    }
}