.audio-player-wrapper {
    margin-top: 1.5rem;
    /* --- EDITED: From solid color to background image --- */
    background-image: url('/images/carbon-fiber.webp');
    background-size: cover;
    background-position: center;
    /* --- End of Edit --- */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    color: var(--text-color);
    position: relative; /* Added for the overlay effect */
    overflow: hidden;   /* Keeps the overlay within the rounded corners */
}

/* --- ADDED: This creates a dark, semi-transparent overlay --- */
/* This ensures that the text is readable on top of the background image. */
.audio-player-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Black with 50% opacity */
    z-index: 1; /* Places the overlay above the background but below the content */
}

/* --- ADDED: Ensures all content (buttons, text) appears above the overlay --- */
.audio-player-wrapper > * {
    position: relative;
    z-index: 2;
}

.audio-track-info {
    text-align: center;
    margin-bottom: 1rem;
    font-size: .9rem;
    color: var(--muted-text-color);
    font-family: var(--body-font);
}

.marquee {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
}

.marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: 15s linear infinite marquee-scroll;
}

@keyframes marquee-scroll {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-100%, 0);
    }
}

.audio-controls-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-buttons,
.audio-volume-area {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.audio-btn {
    background: 0 0;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color .3s, transform .2s;
    padding: .5rem;
}

.audio-btn:hover:not(:disabled) {
    color: var(--primary-color);
    transform: scale(1.1);
}

.audio-btn:disabled {
    color: var(--muted-text-color);
    cursor: not-allowed;
    opacity: .5;
}

.audio-progress-area {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-time {
    font-size: .85rem;
    color: var(--muted-text-color);
    min-width: 35px;
    text-align: center;
}

.audio-progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-bar {
    width: 0;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--dramatic-red), var(--primary-color), var(--secondary-color));
    transition: width .1s linear;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 6px;
    background: var(--border-color);
    outline: 0;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity .2s;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

@media (max-width: 550px) {
    .audio-controls-bar {
        flex-wrap: wrap;
        justify-content: center;
    }

    .audio-progress-area {
        width: 100%;
        order: 1;
    }

    .audio-buttons,
    .audio-volume-area {
        order: 2;
    }
}
