.players-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

.audio-player-container {
    width: 350px;
    background-color: #f4f4f2d0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.player-header {
    padding: 10px;
    text-align: center;
    color: black;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-header h3 {
    font-size: 1.2rem;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    width: 100%;
    text-align: center;
}

.playlist-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: none;
}

.visualizer-container {
    height: 42px;
    background-color: #000000bf;
    display: flex;
    align-items: flex-end;
    padding: 0;
    width: 100%;
}

.waveform-visualizer {
    width: 100%;
    height: 100%;
    display: block;
}

.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    background-color: #f4f4f2d0;
    height: 42px;
}

.control-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.2s, color 0.2s;
    color: black;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    width: 42px;
}

.control-button:hover {
    color: #555;
}

.control-button.play-pause {
    font-size: 28px;
}

.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    height: 5px;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    width: 0;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    padding: 5px 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
}

.playlist-container {
    max-height: 200px;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.playlist-item:hover {
    background-color: #f5f5f5;
}

.playlist-item.active {
    background-color: rgba(0, 0, 0, 0.05);
}

.track-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    margin-right: 10px;
    color: black;
}

.track-info {
    flex: 1;
    padding-left: 8px;
}

.track-title {
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Custom scrollbar */
.playlist-container::-webkit-scrollbar {
    width: 4px;
}

.playlist-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.playlist-container::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

.playlist-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Theme specific styling - these are applied dynamically */
.theme-blue .player-header {
    background-color: #cccecfa6;
}
.theme-blue .progress-bar {
    background-color: #edeaf2;
}
.theme-blue .track-number {
    background-color: #d3d8d9;
}
.theme-blue .playlist-item.active {
    background-color: #f5f5f5;
    border-left-color: #eaf0f2;
}
.theme-blue .playlist-container::-webkit-scrollbar-thumb {
    background: #edeaf2;
}

.theme-green .player-header {
    background-color: #ded7d8a6;
}
.theme-green .progress-bar {
    background-color: #bfd0d6;
}
.theme-green .track-number {
    background-color: #ded5d6;
}
.theme-green .playlist-item.active {
    background-color: #f5f5f5;
    border-left-color: #bfd0d6;
}
.theme-green .playlist-container::-webkit-scrollbar-thumb {
    background: #bfd0d6;
}

.theme-purple .player-header {
    background-color: #fef180;
}
.theme-purple .progress-bar {
    background-color: #fef180;
}
.theme-purple .track-number {
    background-color: #fef180;
}
.theme-purple .playlist-item.active {
    background-color: #fffce6;
    border-left-color: #fef180;
}
.theme-purple .playlist-container::-webkit-scrollbar-thumb {
    background: #fef180;
}

/* Mobile Responsive Adjustments */
@media (max-width: 767px) {
    .players-container {
        flex-direction: column;
        align-items: center;
    }
    
    .audio-player-container {
        width: 100%;
        max-width: 350px;
        contain: layout; /* Improve performance by isolating the layout */
    }
    
    /* Prevent content jumps by ensuring stable container size */
    .playlist-container {
        max-height: 200px;
        contain: content; /* Improve performance by containing content */
    }
}

/* Ensure content stability */
html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    min-height: 100%;
    overflow-anchor: none; /* Disable the browser's scroll anchoring to prevent jumps */
}

/* Buy Button Styles */
.control-button.buy-button {
    width: auto !important; /* Overrides the fixed 42px width of other buttons */
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    background-color: #c49c1b; /* Green color */
    color: white;
    border-radius: 4px;
    text-decoration: none;
    height: 30px;
    margin-left: auto; /* Pushes the button to the far right */
    display: none; /* Hidden by default, JS toggles this to 'flex' */
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.control-button.buy-button:hover {
    background-color: #17676d; /* Darker green on hover */
    color: white;
}

.player-chin {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.05); /* Optional: gives a slight separation */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

.master-toggle-btn {
    width: auto !important;
    padding: 5px 15px !important;
    font-weight: bold;
    letter-spacing: 1px;
}

.level-match-btn {
    width: auto !important;
    padding: 5px 12px !important;
    font-size: 0.8em;
    font-weight: 600;
}

/* State class used by JS to dim inactive buttons */
.btn-dimmed {
    opacity: 0.5;
}