.hidden{
    display: none;
}

/* Player container */
.player-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-width: 300px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    border: 1px solid #4f4f4f;
    border-radius: 8px;
}

/* Background video */
.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    border: 1px solid #4f4f4f;
    border-radius: 8px;
}

/* Spectrum canvas */
.spectrum-canvas {
    width: 100%;
    height: 200px;
    display: block;
    position: relative;
    z-index: 1;
}

/* Seek bar */
.seek-bar {
    width: 100%;
    height: 8px;
    position: relative;
    margin: 10px 0;
    cursor: pointer;
    touch-action: none; /* Prevents pinch-zoom/scroll during touch */
    z-index: 1;
}

.seek-progress {
    height: 100%;
    width: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.seek-handle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    touch-action: none; /* Ensures smooth touch dragging */
}

.seek-handle:active {
    cursor: grabbing;
}

/* Current track container */
.current-track-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.current-track {
    display: inline-block;
    white-space: nowrap;
    font-size: 16px; /* Base font size for ticker */
}

.ticker-item {
    display: inline-block;
    /*margin-right: 20px;*/
}

/* Controls */
#controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

#controls button {
    border: none;
    width: clamp(36px, 6vw, 40px); /* Square button size, scales with viewport */
    height: clamp(36px, 6vw, 40px); /* Equal to width for square shape */
    font-size: clamp(16px, 3vw, 18px); /* Smaller icon size to fit square */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation; /* Prevents double-tap zoom */
}

#controls button {
    color: white;
    background-color: #00000090;
    border: 1px solid #333333;
    border-radius: 8px;
}

#controls button:hover {
    color: #C0C0C0;
    background-color: #000000;
    border: 1px solid #4f4f4f;
}

/* Playlist container */
.playlist-container {
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.playlist {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

.playlist li {
    padding: 10px;
    cursor: pointer;
}

.playlist li.playing {
    background-color: #00000080;
}

.playlist li.playing:hover {
    background-color: #000000;
}

/* scrollbar width */
.playlist::-webkit-scrollbar {
  width: 15px;
}

/* scrollbar track */
.playlist::-webkit-scrollbar-track {
  background:  #00000080;
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
 
/* scrollbar handle */
.playlist::-webkit-scrollbar-thumb {
  background: #808080;
  border-radius: 10px; /* optional rounded handle */
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
  background-image: -webkit-linear-gradient(45deg,
	                                          rgba(255, 255, 255, .2) 25%,
											  transparent 25%,
											  transparent 50%,
											  rgba(255, 255, 255, .2) 50%,
											  rgba(255, 255, 255, .2) 75%,
											  transparent 75%,
											  transparent);
}

/* scrollbar handle on hover */
.playlist::-webkit-scrollbar-thumb:hover {
    cursor: grab;
    background: #C0C0C0;
    background-image: -webkit-linear-gradient(45deg,
	                                          rgba(255, 255, 255, .2) 25%,
											  transparent 25%,
											  transparent 50%,
											  rgba(255, 255, 255, .2) 50%,
											  rgba(255, 255, 255, .2) 75%,
											  transparent 75%,
											  transparent);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .player-container {
        padding: 10px;
    }

    .spectrum-canvas {
        height: 70px;
    }

    .seek-bar {
        height: 6px;
    }

    .seek-handle {
        width: 14px;
        height: 14px;
    }

    #controls button {
        width: clamp(32px, 8vw, 36px); /* Smaller square buttons for mobile */
        height: clamp(32px, 8vw, 36px);
        font-size: clamp(14px, 4vw, 16px);
    }

    .current-track {
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    #controls {
        gap: 8px;
    }

    #controls button {
        width: clamp(30px, 7.5vw, 34px);
        height: clamp(30px, 7.5vw, 34px);
        font-size: clamp(13px, 3.5vw, 15px);
    }
}

@media (max-width: 320px) {
    .player-container {
        padding: 8px;
    }

    .spectrum-canvas {
        height: 60px;
    }

    .seek-bar {
        height: 5px;
    }

    .seek-handle {
        width: 12px;
        height: 12px;
    }

    #controls button {
        width: clamp(28px, 7vw, 32px); /* Smallest square buttons for 320px */
        height: clamp(28px, 7vw, 32px);
        font-size: clamp(12px, 3.5vw, 14px);
    }

    .current-track {
        font-size: 13px;
    }
}

.audio-credits {
    font-size: 8pt;
    right: 10px;
    position: absolute;
    color: grey;
    bottom: 4px;
    z-index: 4;
}