/**
 * CMU Text-to-Speech Styles
 */

.cmu-tts-container {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.cmu-tts-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4264A1;
    /*background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);*/
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.cmu-tts-button:hover {
    background: #4264A1;
    /*background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);*/
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    transform: translateY(-2px);
}

.cmu-tts-button:active {
    transform: translateY(0);
}

.cmu-tts-button.playing {
    background: #ED9B09;
    /*background: linear-gradient(135deg, #ff6b35 0%, #ff5722 100%);*/
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
    animation: pulse 1s infinite;
}

.cmu-tts-button.playing:hover {
    background: #ED9B09;
    /*background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);*/
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
    }
    50% {
        box-shadow: 0 2px 16px rgba(255, 107, 53, 0.5);
    }
}

.cmu-tts-button.is-loading {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

.cmu-tts-button:disabled {
    pointer-events: none;
}

.cmu-tts-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    color: #4f5d75;
    font-size: 12px;
    font-weight: 600;
    min-height: 20px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef3fb;
    border: 1px solid transparent;
    opacity: 0;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.cmu-tts-loader.is-visible {
    opacity: 1;
    border-color: #dbe5f5;
}

.cmu-tts-loader.is-loading {
    opacity: 1;
    border-color: #c9d8ef;
}

.cmu-tts-loader.is-loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #b8c9e5;
    border-top-color: #4264A1;
    border-radius: 50%;
    animation: cmu-tts-spin 0.8s linear infinite;
}

@keyframes cmu-tts-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .cmu-tts-container {
        padding: 12px;
    }

    .cmu-tts-button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Accessibility: Focus states */
.cmu-tts-button:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cmu-tts-button,
    .cmu-tts-loader,
    .cmu-tts-loader.is-loading::before {
        animation: none;
    }

    .cmu-tts-button,
    .cmu-tts-loader {
        transition: none;
    }
}
