/* Custom Audio Player Container */
.custom-audio-player {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
    max-width: 600px;
    margin: 20px auto;
    flex-wrap: wrap; /* Allow wrapping for mobile */
}

/* Player Artwork */
.player-artwork {
    flex: 0 0 100px;
    margin-right: 15px;
}

.player-artwork img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Player Controls Wrapper */
.player-controls-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: calc(100% - 120px); /* Ensure the player controls take the remaining width */
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    justify-content: space-between;
}

/* Play/Pause and Download Buttons */
.play-pause,
.download-button {
    padding: 8px;
    background-color: #252525;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.play-pause {
    margin-right: 10px;
}

.download-button {
    margin-left: 10px;
}

.download-button a {
    color: #fff !important;
}

.play-pause:hover,
.download-button:hover {
    background-color: #555;
}

/* Progress Bar Container */
.progress-bar-container {
    flex-grow: 1;
    height: 8px;
    background-color: #ddd;
    border-radius: 4px;
    position: relative;
    margin: 5px 10px;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Progress Bar Styling */
.progress-bar {
    flex-grow: 1;
    cursor: pointer;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    padding: 0;
    position: relative;
}

/* Buffering Overlay */
.buffering-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 165, 0, 0.5);
    border-radius: 8px;
}

.buffering-overlay img {
    width: 120px;
    height: 120px;
    animation: spin 1s linear infinite;
}

/* Progress bar styling for Webkit browsers */
.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #0073aa;
    cursor: pointer;
    margin-top: -4px;
    border: none;
    border-radius: 50%;
}

/* Progress bar styling for Firefox */
.progress-bar::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #0073aa;
    cursor: pointer;
    border: none;
    border-radius: 50%;
}

/* Progress track styling for Webkit browsers */
.progress-bar::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #ddd;
    border-radius: 4px;
}

/* Time Stamp Display */
.time-stamp {
    font-size: 14px;
    color: #333;
    margin-top: 5px;
    width: 100%;
    text-align: left;
}

/* Remove any other spinner graphic */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Styles for Screen Width Less Than 800px */
@media screen and (max-width: 800px) {
    .custom-audio-player {
        flex-direction: column; /* Stack elements vertically */
        align-items: center; /* Center-align elements */
    }

    .player-artwork {
        margin: 0 0 10px 0; /* Add margin below the artwork */
        width: 100%; /* Make artwork take full width */
        max-width: 200px; /* Set max width for artwork */
    }

    .player-controls-wrapper {
        width: 100%; /* Full width for mobile */
    }

    .progress-bar-container {
        margin: 10px 0; /* Adjust margin for mobile */
    }

    .time-stamp {
        text-align: center; /* Center-align the timestamp */
        margin-top: 5px; /* Adjust margin */
    }

    .player-controls {
        flex-direction: column; /* Stack buttons vertically */
        align-items: center; /* Center-align buttons */
        margin-top: 10px;
    }

    .play-pause,
    .download-button {
        margin: 5px 0; /* Add margin between buttons */
    }
}
