/**
 * Audio Player Styles
 * Modern, responsive design matching the reference screenshots
 */

/* Main Player Container */
.eap-audio-player-wrapper {
    width: 100%;
    max-width: 100%;
}

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

.eap-audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #D4C4B0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Play Button */
.eap-play-button {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    background-color: #FFFFFF;
    color: #1E3A5F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.eap-play-button:hover {
    background-color: #1E3A5F;
    color: #FFFFFF;
    transform: scale(1.05);
}

.eap-play-button:focus {
    outline: 2px solid #1E3A5F;
    outline-offset: 2px;
}

.eap-play-button svg {
    width: 24px;
    height: 24px;
}

/* Controls Container */
.eap-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Time Display */
.eap-time {
    font-size: 14px;
    font-weight: 500;
    color: #1E3A5F;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Progress Bar */
.eap-progress-container {
    flex: 1;
    min-width: 0;
}

.eap-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background-color: rgba(30, 58, 95, 0.2);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: height 0.2s ease;
}

.eap-progress-bar:hover {
    height: 8px;
}

.eap-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #1E3A5F 0%, #2E5A8F 100%);
    border-radius: 10px;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* Volume Control */
.eap-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eap-volume-icon {
    background: none;
    border: none;
    color: #1E3A5F;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.eap-volume-icon:hover {
    background-color: rgba(30, 58, 95, 0.1);
    transform: scale(1.1);
}

.eap-volume-icon svg {
    width: 20px;
    height: 20px;
}

/* Volume Bar Container */
.eap-volume-bar-container {
    position: relative;
}

.eap-volume-horizontal .eap-volume-bar {
    width: 80px;
    height: 4px;
    background-color: rgba(30, 58, 95, 0.2);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.eap-volume-horizontal .eap-volume-level {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #1E3A5F;
    border-radius: 10px;
    pointer-events: none;
    transition: width 0.1s ease;
}

.eap-volume-vertical {
    position: relative;
}

.eap-volume-vertical .eap-volume-bar {
    width: 4px;
    height: 60px;
    background-color: rgba(30, 58, 95, 0.2);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.eap-volume-vertical .eap-volume-level {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1E3A5F;
    border-radius: 10px;
    pointer-events: none;
    transition: height 0.1s ease;
}

/* Playback Rate */
.eap-playback-rate {
    flex-shrink: 0;
}

.eap-speed-control {
    padding: 6px 10px;
    border: 1px solid rgba(30, 58, 95, 0.3);
    border-radius: 6px;
    background-color: #FFFFFF;
    color: #1E3A5F;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.eap-speed-control:hover {
    border-color: #1E3A5F;
    background-color: #f8f9fa;
}

.eap-speed-control:focus {
    outline: 2px solid #1E3A5F;
    outline-offset: 1px;
}

/* No Audio Message */
.eap-no-audio {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .eap-audio-player {
        gap: 10px;
        padding: 15px;
    }

    .eap-play-button {
        width: 45px;
        height: 45px;
    }

    .eap-play-button svg {
        width: 20px;
        height: 20px;
    }

    .eap-controls {
        gap: 8px;
    }

    .eap-time {
        font-size: 12px;
    }

    .eap-volume-horizontal .eap-volume-bar {
        width: 60px;
    }

    .eap-speed-control {
        padding: 4px 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .eap-audio-player {
        flex-wrap: wrap;
        gap: 12px;
    }

    .eap-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .eap-progress-container {
        order: -1;
        width: 100%;
    }

    .eap-volume-horizontal .eap-volume-bar {
        width: 50px;
    }
}

/* Elementor Editor Styles */
.elementor-editor-active .eap-audio-player {
    pointer-events: auto;
}

/* Accessibility */
.eap-play-button:focus-visible,
.eap-volume-icon:focus-visible,
.eap-speed-control:focus-visible {
    outline: 2px solid #1E3A5F;
    outline-offset: 2px;
}

/* Loading State */
.eap-audio-player.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth Transitions — only on elements that actually animate */
.eap-play-button,
.eap-progress,
.eap-volume-level,
.eap-volume-icon,
.eap-progress-bar {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar for Speed Control Dropdown */
.eap-speed-control option {
    padding: 8px;
}

/* Hover Effects */
.eap-progress-bar:hover .eap-progress {
    box-shadow: 0 0 8px rgba(30, 58, 95, 0.3);
}

.eap-volume-bar:hover {
    transform: scaleY(1.2);
}

.eap-volume-horizontal .eap-volume-bar:hover {
    transform: scaleY(1.5);
}

/* Active States */
.eap-progress-bar:active,
.eap-volume-bar:active {
    cursor: grabbing;
}

/* Disabled State */
.eap-audio-player[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .eap-audio-player {
        display: none;
    }
}