/* Frontend audio player styles */

.websitecare-tts-player {
    margin: 30px 0;
    width: 100%;
}

.tts-audio-element {
    display: none;
}

.tts-player-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tts-play-button {
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.tts-play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tts-play-button:active {
    transform: scale(0.95);
}

.tts-play-button:focus {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

.tts-btn-circular {
    border-radius: 50%;
}

.tts-btn-rectangular {
    border-radius: 8px;
}

.tts-btn-custom {
    border-radius: 0;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.tts-play-button .tts-icon {
    width: 24px;
    height: 24px;
    color: #fff;
    fill: #fff;
}

.tts-play-button.playing .tts-play-icon {
    display: none;
}

.tts-play-button.playing .tts-pause-icon {
    display: block !important;
}

.tts-waveform-container {
    flex: 1;
    position: relative;
    height: 60px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}

.tts-waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.tts-waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    opacity: 0.3;
    pointer-events: none;
    transition: width 0.1s linear;
}

.tts-time-display {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.tts-time-separator {
    margin: 0 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .tts-player-container {
        padding: 15px;
        gap: 15px;
    }
    
    .tts-play-button .tts-icon {
        width: 20px;
        height: 20px;
    }
    
    .tts-waveform-container {
        height: 50px;
    }
    
    .tts-time-display {
        font-size: 12px;
        min-width: 85px;
    }
}

@media (max-width: 480px) {
    .tts-player-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tts-waveform-container {
        width: 100%;
        order: 3;
        margin-top: 10px;
    }
    
    .tts-time-display {
        order: 2;
    }
}

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

.tts-player-container.loading .tts-play-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.5);
    border-radius: inherit;
    animation: tts-button-spin 1s linear infinite;
}

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

/* Playlist controls - HIDDEN for seamless playback */
.tts-playlist-controls {
    display: none;
}

.tts-prev-btn,
.tts-next-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tts-prev-btn:hover,
.tts-next-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tts-prev-btn:active,
.tts-next-btn:active {
    transform: scale(0.95);
}

.tts-prev-btn:disabled,
.tts-next-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tts-prev-btn:disabled:hover,
.tts-next-btn:disabled:hover {
    background-color: transparent;
}

.tts-prev-btn .dashicons,
.tts-next-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.tts-part-indicator {
    font-weight: 500;
    white-space: nowrap;
}

/* Responsive playlist controls */
@media (max-width: 768px) {
    .tts-playlist-controls {
        gap: 10px;
        font-size: 12px;
    }
    
    .tts-prev-btn .dashicons,
    .tts-next-btn .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .tts-playlist-controls {
        width: 100%;
        order: 4;
        margin-top: 10px;
    }
}

