/**
 * BDO Audio Player Styles
 * Designed to match the screenshot with customizable colors
 */

.bdo-audio-player {
    border-radius: 0 !important;
    margin: 20px 0;
    box-shadow: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.bdo-player-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Play Button */
.bdo-play-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    box-shadow: none !important;
    color: #000;
}

.bdo-play-btn:hover {
    transform: scale(1.05);
}

.bdo-play-btn:active {
    transform: scale(0.95);
}

.bdo-play-btn.playing .bdo-play-icon {
    display: none;
}

.bdo-play-btn.playing .bdo-pause-icon {
    display: block !important;
}

/* Main Content Area */
.bdo-player-main {
    flex: 1;
    min-width: 0;
}

/* Header with Title and Time */
.bdo-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.bdo-player-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bdo-player-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.9;
    font-size: 0.9em;
}

/* Progress Bar */
.bdo-progress-container {
    position: relative;
    width: 100%;
    height: 6px;
    display: block;
}

.bdo-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

.bdo-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 6px;
    width: 0%;
    border-radius: 0;
    transition: width 0.1s linear;
    pointer-events: none;
    will-change: width;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Controls */
.bdo-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bdo-control-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    box-shadow: none !important;
}

.bdo-control-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.bdo-control-btn svg {
    display: block;
}

/* Speed Control */
.bdo-speed-btn {
    font-size: 0.85em;
    font-weight: 600;
    padding: 6px 10px;
    min-width: 48px;
}

.bdo-speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none !important;
    border: 1px solid #ddd;
    padding: 6px;
    margin-bottom: 8px;
    z-index: 100;
}

.bdo-speed-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    color: #333;
    border-radius: 0;
    font-size: 14px;
    transition: background 0.2s;
}

.bdo-speed-option:hover {
    background: #f0f0f0;
}

.bdo-speed-option.active {
    background: #0073aa;
    color: #fff;
}

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

.bdo-volume-slider {
    display: flex;
    align-items: center;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.2s, max-width 0.3s;
}

.bdo-volume-control:hover .bdo-volume-slider {
    opacity: 1;
    max-width: 100px;
}

.bdo-volume-range {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    border-radius: 0;
    cursor: pointer;
}

.bdo-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: none !important;
}

.bdo-volume-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: none !important;
}

/* Hidden Audio Element */
.bdo-audio-element {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bdo-player-container {
        gap: 12px;
    }

    .bdo-play-btn {
        width: 44px;
        height: 44px;
    }

    .bdo-play-btn svg {
        width: 20px;
        height: 20px;
    }

    .bdo-player-title {
        font-size: 13px;
    }

    .bdo-player-time {
        font-size: 12px;
    }

    .bdo-player-controls {
        gap: 6px;
    }

    .bdo-control-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .bdo-control-btn svg {
        width: 18px;
        height: 18px;
    }

    .bdo-speed-btn {
        font-size: 12px;
        min-width: 44px;
        padding: 5px 8px;
    }

    /* Thinner progress bar for mobile - 4px */
    .bdo-progress-container {
        height: 4px;
        padding: 12px 0;
        margin: -12px 0;
        display: block;
    }

    .bdo-progress-bar {
        height: 4px;
        width: 100%;
    }

    .bdo-progress-fill {
        height: 4px;
    }

    /* Hide volume control completely on mobile */
    .bdo-volume-control {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .bdo-player-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .bdo-player-title {
        order: 1;
    }

    .bdo-player-time {
        order: 0;
        font-size: 11px;
    }
}

/* Loading State */
.bdo-audio-player.loading .bdo-play-btn {
    opacity: 0.5;
    cursor: wait;
}

.bdo-audio-player.loading .bdo-progress-fill {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Error State */
.bdo-audio-player.error {
    opacity: 0.6;
}

.bdo-audio-player.error .bdo-player-title::after {
    content: ' (Error loading audio)';
    color: #d63638;
    font-size: 0.9em;
}
