/**
 * WPBakery Audio Player Styles
 */

/* Base Variables */
.vc-audio-player {
    --player-bg: #000000;
    --player-text: #ffffff;
    --player-text-secondary: #999999;
    --player-accent: #94c75b;
    --player-accent-hover: #a8d474;
    --player-border: #222222;
    --player-progress-bg: #333333;
    --player-radius: 12px;
    --player-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--player-bg);
    border-radius: var(--player-radius);
    box-shadow: var(--player-shadow);
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
}

/* Dark Theme (same as default since default is now dark) */
.vc-audio-player--dark {
    --player-bg: #000000;
    --player-text: #ffffff;
    --player-text-secondary: #999999;
    --player-border: #222222;
    --player-progress-bg: #333333;
    --player-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Light Theme */
.vc-audio-player--light {
    --player-bg: #ffffff;
    --player-text: #1a1a1a;
    --player-text-secondary: #666666;
    --player-border: #e5e5e5;
    --player-progress-bg: #e5e5e5;
    --player-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Minimal Theme */
.vc-audio-player--minimal {
    --player-shadow: none;
    border: 1px solid var(--player-border);
}

/* Error Message */
.vc-audio-player-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
    background: #fff5f5;
    border-radius: 8px;
}

/* Main Player Section */
.vc-audio-player__main {
    padding: 24px;
}

/* Cover Image */
.vc-audio-player__cover {
    margin-bottom: 20px;
}

.vc-audio-player__cover-img {
    width: 100%;
    aspect-ratio: 1;
    max-width: 200px;
    margin: 0 auto;
    border-radius: 8px;
    background: linear-gradient(135deg, #94c75b, #6b9a3d);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vc-audio-player__cover-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vc-audio-player__cover-img svg {
    width: 60px;
    height: 60px;
    color: rgba(255, 255, 255, 0.9);
}

/* Track Info */
.vc-audio-player__info {
    text-align: center;
    margin-bottom: 20px;
}

.vc-audio-player__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--player-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc-audio-player__artist {
    font-size: 14px;
    color: var(--player-text-secondary);
}

/* Progress Bar */
.vc-audio-player__progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.vc-audio-player__time {
    font-size: 12px;
    font-weight: 500;
    color: var(--player-text-secondary);
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}

.vc-audio-player__time--current {
    text-align: right;
}

.vc-audio-player__time--duration {
    text-align: left;
}

.vc-audio-player__progress {
    flex: 1;
    padding: 8px 0;
    cursor: pointer;
}

.vc-audio-player__progress-bar {
    position: relative;
    height: 6px;
    background: var(--player-progress-bg);
    border-radius: 3px;
}

.vc-audio-player__progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--player-accent);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.vc-audio-player__progress-handle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    background: var(--player-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vc-audio-player__progress:hover .vc-audio-player__progress-handle,
.vc-audio-player__progress-handle:focus {
    opacity: 1;
}

/* Controls */
.vc-audio-player__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vc-audio-player__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--player-text);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vc-audio-player__btn:hover {
    background: var(--player-progress-bg);
}

.vc-audio-player__btn svg {
    width: 24px;
    height: 24px;
}

/* Play Button */
.vc-audio-player__btn--play {
    width: 56px;
    height: 56px;
    background: var(--player-accent);
    color: white;
}

.vc-audio-player__btn--play:hover {
    background: var(--player-accent-hover);
    transform: scale(1.05);
}

.vc-audio-player__btn--play svg {
    width: 28px;
    height: 28px;
}

/* Play/Pause Icon Toggle */
.vc-audio-player__btn--play .icon-pause {
    display: none;
}

.vc-audio-player.is-playing .vc-audio-player__btn--play .icon-play {
    display: none;
}

.vc-audio-player.is-playing .vc-audio-player__btn--play .icon-pause {
    display: block;
}

/* Volume Control */
.vc-audio-player__volume {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.vc-audio-player__btn--volume {
    width: 36px;
    height: 36px;
}

.vc-audio-player__btn--volume svg {
    width: 20px;
    height: 20px;
}

/* Volume Icon States */
.vc-audio-player__btn--volume .icon-volume-low,
.vc-audio-player__btn--volume .icon-volume-mute {
    display: none;
}

.vc-audio-player.is-volume-low .vc-audio-player__btn--volume .icon-volume-high {
    display: none;
}

.vc-audio-player.is-volume-low .vc-audio-player__btn--volume .icon-volume-low {
    display: block;
}

.vc-audio-player.is-muted .vc-audio-player__btn--volume .icon-volume-high,
.vc-audio-player.is-muted .vc-audio-player__btn--volume .icon-volume-low {
    display: none;
}

.vc-audio-player.is-muted .vc-audio-player__btn--volume .icon-volume-mute {
    display: block;
}

/* Volume Slider */
.vc-audio-player__volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}

.vc-audio-player__volume:hover .vc-audio-player__volume-slider {
    width: 80px;
    padding-left: 8px;
}

.vc-audio-player__volume-bar {
    position: relative;
    width: 72px;
    height: 4px;
    background: var(--player-progress-bg);
    border-radius: 2px;
    cursor: pointer;
}

.vc-audio-player__volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 80%;
    background: var(--player-accent);
    border-radius: 2px;
}

.vc-audio-player__volume-handle {
    position: absolute;
    top: 50%;
    left: 80%;
    width: 12px;
    height: 12px;
    background: var(--player-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Playlist */
.vc-audio-player__playlist {
    border-top: 1px solid var(--player-border);
}

.vc-audio-player__playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.03);
}

.vc-audio-player--light .vc-audio-player__playlist-header {
    background: rgba(0, 0, 0, 0.02);
}

.vc-audio-player__playlist-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--player-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vc-audio-player__playlist-count {
    font-size: 12px;
    color: var(--player-text-secondary);
}

.vc-audio-player__tracks {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
}

.vc-audio-player__track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.vc-audio-player__track:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vc-audio-player--light .vc-audio-player__track:hover {
    background: rgba(0, 0, 0, 0.03);
}

.vc-audio-player__track.is-active {
    background: rgba(148, 199, 91, 0.12);
}

.vc-audio-player__track-number {
    width: 24px;
    font-size: 13px;
    font-weight: 500;
    color: var(--player-text-secondary);
    text-align: center;
}

.vc-audio-player__track.is-active .vc-audio-player__track-number {
    display: none;
}

/* Playing Animation */
.vc-audio-player__track-playing {
    display: none;
    width: 24px;
    height: 16px;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.vc-audio-player__track.is-active .vc-audio-player__track-playing {
    display: flex;
}

.vc-audio-player__track-playing span {
    width: 3px;
    height: 100%;
    background: var(--player-accent);
    border-radius: 1px;
    animation: soundBars 0.8s ease infinite;
}

.vc-audio-player__track-playing span:nth-child(1) {
    animation-delay: 0s;
}

.vc-audio-player__track-playing span:nth-child(2) {
    animation-delay: 0.2s;
}

.vc-audio-player__track-playing span:nth-child(3) {
    animation-delay: 0.4s;
}

.vc-audio-player:not(.is-playing) .vc-audio-player__track-playing span {
    animation-play-state: paused;
}

@keyframes soundBars {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}

/* Track Info */
.vc-audio-player__track-info {
    flex: 1;
    min-width: 0;
}

.vc-audio-player__track-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--player-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc-audio-player__track.is-active .vc-audio-player__track-title {
    color: var(--player-accent);
}

.vc-audio-player__track-artist {
    display: block;
    font-size: 12px;
    color: var(--player-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc-audio-player__track-duration {
    font-size: 12px;
    font-weight: 500;
    color: var(--player-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Hidden Audio Element */
.vc-audio-player__audio {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .vc-audio-player__main {
        padding: 20px 16px;
    }

    .vc-audio-player__cover-img {
        max-width: 160px;
    }

    .vc-audio-player__title {
        font-size: 16px;
    }

    .vc-audio-player__btn {
        width: 40px;
        height: 40px;
    }

    .vc-audio-player__btn--play {
        width: 52px;
        height: 52px;
    }

    .vc-audio-player__track {
        padding: 10px 16px;
    }

    .vc-audio-player__playlist-header {
        padding: 10px 16px;
    }

    .vc-audio-player__volume:hover .vc-audio-player__volume-slider {
        width: 60px;
    }

    .vc-audio-player__volume-bar {
        width: 52px;
    }
}

/* Accessibility - Focus Styles */
.vc-audio-player__btn:focus-visible,
.vc-audio-player__track:focus-visible {
    outline: 2px solid var(--player-accent);
    outline-offset: 2px;
}

/* Scrollbar Styling for Playlist */
.vc-audio-player__tracks::-webkit-scrollbar {
    width: 6px;
}

.vc-audio-player__tracks::-webkit-scrollbar-track {
    background: transparent;
}

.vc-audio-player__tracks::-webkit-scrollbar-thumb {
    background: var(--player-progress-bg);
    border-radius: 3px;
}

.vc-audio-player__tracks::-webkit-scrollbar-thumb:hover {
    background: var(--player-text-secondary);
}
