/* public/css/public.css */
/* Public styles for frontend TTS functionality */

.async-ai-tts-widget {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.async-ai-tts-widget h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.tts-text-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 16px;
}

.tts-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tts-voice-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.tts-generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tts-generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tts-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tts-audio-player {
    display: none;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.tts-audio-player.show {
    display: block;
}

.tts-player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tts-play-btn {
    width: 40px;
    height: 40px;
    background: #667eea;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.tts-progress {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.tts-progress-fill {
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s;
}

.tts-time {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.tts-download-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.tts-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
}

.tts-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tts-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .tts-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tts-voice-select {
        min-width: auto;
    }
}

/* WordPress integration styles */
.wp-block-async-ai-tts {
    margin: 1.5em 0;
}

.async-ai-tts-shortcode {
    margin: 1em 0;
}

/* Admin bar compatibility */
.admin-bar .async-ai-tts-widget {
    margin-top: 46px;
}

@media screen and (max-width: 782px) {
    .admin-bar .async-ai-tts-widget {
        margin-top: 46px;
    }
}