/**
 * Mementor Text to Speech - Public CSS
 * 
 * This file contains styles specific to the frontend player.
 * For shared styles between admin and frontend, see mementor-tts-shared.css
 */

/* Loading state styles */
.mementor-tts-loading {
    opacity: 0.7;
    pointer-events: none;
}

.mementor-tts-spin {
    animation: mementor-tts-spin 2s linear infinite;
}

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

/* Generating state styles */
.mementor-tts-generating {
    position: relative;
}

.mementor-tts-generating .dashicons {
    animation: mementor-tts-spin 2s linear infinite;
    color: var(--mementor-tts-accent-color-hover, #135e96) !important;
}

/* Player container generating state */
.mementor-tts-player-container.is-generating .mementor-tts-play-button {
    animation: mementor-tts-pulse 1.5s infinite;
}

/* Pulse animation for generating state */
@keyframes mementor-tts-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 113, 177, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(34, 113, 177, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 113, 177, 0); }
}

/* Elementor hidden state - hide player until properly positioned */
.mementor-tts-player-container.mementor-tts-elementor-hidden {
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Error state styles */
.mementor-tts-player-container.has-error .mementor-tts-play-button {
    border-color: #cc0000;
}

.mementor-tts-player-container.has-error .mementor-tts-play-button .dashicons {
    color: #cc0000;
}

/* Message container for errors */
.mementor-tts-message-container {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    display: none;
    font-size: 13px;
    line-height: 1.4;
}

.mementor-tts-player-container.has-error .mementor-tts-message-container {
    display: block;
}

/* Error states */
.mementor-tts-player.has-error .mementor-tts-play-button {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.mementor-tts-player.has-error .mementor-tts-play-button .dashicons {
    color: #dc3545;
}

.mementor-tts-message-container {
    display: none;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.mementor-tts-player.has-error .mementor-tts-message-container {
    display: block;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Loading state */
.mementor-tts-player .mementor-tts-play-button.mementor-tts-loading {
    opacity: 0.7;
}

.mementor-tts-player .mementor-tts-play-button .mementor-tts-spin {
    animation: mementor-tts-spin 1.5s linear infinite;
}

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

/* Generating state */
.mementor-tts-player.is-generating .mementor-tts-play-button {
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.mementor-tts-player.is-generating .mementor-tts-play-button .dashicons {
    color: #856404;
}

.mementor-tts-generating {
    animation: mementor-tts-pulse 1.5s infinite ease-in-out;
}

@keyframes mementor-tts-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Hover effects for better UX */
.mementor-tts-play-button:hover:not(.mementor-tts-loading) {
    background-color: #f0f0f0;
    cursor: pointer;
}

.mementor-tts-player.has-error .mementor-tts-play-button:hover {
    background-color: #f1c1c7;
}

.mementor-tts-player.is-generating .mementor-tts-play-button:hover {
    background-color: #ffe8b3;
} 