#musicPlayerContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    background: var(--secondary);
    box-shadow: 5px 0 35px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    border-right: 1px solid var(--glass-border);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s ease;
}

body.miniplayer-active #musicPlayerContainer {
    height: calc(100% - 85px);
}

.sidenav {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: transparent;
    position: relative;
}

.sidenav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.2rem;
    background: var(--primary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    position: relative;
    z-index: 3;
}

.sidenav-header h4 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    color: var(--accent);
    line-height: 1;
}

.sidenav-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.sidenav-header button:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

.music-panel {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    min-height: 0;
    position: absolute;
    top: 57px;
    left: 0;
    width: 100%;
    height: calc(100% - 57px);
    background-color: var(--secondary);
}

#artistListContainer {
    z-index: 2;
    transform: translateX(0);
}
#songListContainer {
    z-index: 3;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}

.panel-controls {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.search-wrapper {
    position: relative;
}
.search-wrapper i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9em;
}
.search-wrapper input,
.search-wrapper-songs input {
    width: 100%;
    padding: 0.7rem 1.3rem 0.7rem 2.5rem;
    font-size: 0.9rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    transition: var(--transition);
}
.search-wrapper input:focus,
.search-wrapper-songs input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.2);
    background: rgba(0, 224, 255, 0.08);
}

.artist-grid {
    padding: 0.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    overflow-y: auto;
    flex-grow: 1;
}

.artist-card {
    background: transparent;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.6rem 0.75rem;
    gap: 1rem;
}

.artist-card:hover {
    background: var(--glass);
}

.artist-card.current-artist {
    background: rgba(0, 224, 255, 0.1);
    border-color: rgba(0, 224, 255, 0.2);
}

.artist-thumb-wrapper {
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
}

.artist-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-thumb-placeholder {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.artist-card-title {
    padding: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    transition: color 0.2s ease-in-out;
}

.artist-card:hover .artist-card-title,
.artist-card.current-artist .artist-card-title {
    color: var(--text-primary);
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.pagination-controls #artistCounter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-icon-sm {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon-sm:hover {
    background-color: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

.custom-select {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.select-selected {
    background-color: var(--glass);
    color: var(--text-primary);
    padding: 0.7rem 2.5rem 0.7rem 1.3rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.select-selected:hover {
    border-color: var(--accent);
}

.select-items {
    position: absolute;
    background-color: var(--primary);
    top: 105%;
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    max-height: 250px;
}
.select-hide { display: none; }
.select-option {
    color: var(--text-secondary);
    padding: 0.8rem 1.3rem;
    cursor: pointer;
    user-select: none;
}
.select-option:hover {
    background-color: var(--glass);
    color: var(--text-primary);
}

.artist-grid::-webkit-scrollbar,
.select-items::-webkit-scrollbar,
.song-list::-webkit-scrollbar {
    width: 8px;
}
.artist-grid::-webkit-scrollbar-thumb,
.select-items::-webkit-scrollbar-thumb,
.song-list::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 4px;
}
.artist-grid::-webkit-scrollbar-track,
.select-items::-webkit-scrollbar-track,
.song-list::-webkit-scrollbar-track {
    background: transparent;
}


.song-list-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
}
.back-btn-icon {
    flex-shrink: 0;
}
#artist-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    flex-grow: 1;
    justify-content: center;
}
#artist-header-thumb {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
}
#artist-header-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-wrapper-songs {
    position: relative;
    padding: 0 1rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.song-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.album-group {
    margin-bottom: 1.5rem;
}
.album-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.song-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.song-item:hover {
    background: var(--glass);
}
.song-item.current-song {
    background: var(--accent);
}
.song-item.current-song .song-number,
.song-item.current-song .item-title {
    color: var(--primary) !important;
}

.song-number {
    font-size: 0.9rem;
    color: var(--text-secondary);
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}
.song-details {
    flex-grow: 1;
    overflow: hidden;
}
.song-details .item-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.song-item .play-icon {
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

@keyframes spin-song {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.song-item .loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-secondary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin-song 0.8s linear infinite;
}
.song-item:hover .play-icon,
.song-item.current-song .play-icon {
    opacity: 1;
}
.song-item.current-song .play-icon {
    color: var(--primary);
}
.list-item-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    background-color: transparent;
    border: 1px dashed var(--glass-border);
    border-radius: var(--border-radius-md);
}

#side-nav-now-playing {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--primary);
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
    cursor: pointer;
}
#side-nav-now-playing .details {
    overflow: hidden;
}
#side-nav-now-playing img {
    width: 45px;
    height: 45px;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}
#side-nav-now-playing p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#side-nav-track-title {
    font-weight: 600;
}
#side-nav-track-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
#side-nav-play-pause {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 1.2rem;
}

#miniplayer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85px;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 2fr minmax(200px, 1fr);
    gap: 1.5rem;
    align-items: center;
    z-index: 1045;
    color: var(--text-primary);
    transform: translateY(110%);
}

.miniplayer-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 17, 22, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    z-index: -1;
}

.player-left-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    min-width: 0;
}
.album-cover {
    width: 55px;
    height: 55px;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}
#trackInfo .details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    gap: 0.1rem;
}
#trackTitle, #trackArtist {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#trackTitle { font-weight: 600; }
#trackArtist { font-size: 0.8rem; color: var(--text-secondary); }

.player-center-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    min-width: 250px;
}
#player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}
.control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.control-btn:hover {
    color: var(--accent);
    background: var(--glass);
}
.control-btn.active { color: var(--accent); }
.control-btn.play-pause-main {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: var(--primary);
}
.control-btn.play-pause-main:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 224, 255, 0.4);
}

#closeMiniplayerBtn {
    color: var(--text-secondary);
}

#closeMiniplayerBtn:hover {
    color: var(--accent);
}

.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--primary);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1030;
}

.fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.time-and-progress {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1rem;
}
.time-label { font-size: 0.75rem; color: var(--text-secondary); }

#progressBarContainer {
    flex-grow: 1;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 2.5px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}
#progressBarContainer:hover {
    height: 8px;
}
#seek-hover-bar {
    position: absolute;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: inherit;
    width: 0%;
}
#played-bar {
    position: relative;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    width: 0%;
}
#progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 14px;
    height: 14px;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.2s ease;
}
#progressBarContainer:hover #progress-handle {
    transform: translate(-50%, -50%) scale(1);
}

.player-right-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}
#volumeControl { position: relative; }
.volume-slider-wrapper {
    position: absolute;
    top: 50%;
    left: calc(100% + 15px);
    transform: translateY(-50%);
    background: var(--secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.volume-slider-wrapper.active {
    opacity: 1;
    visibility: visible;
    left: calc(100% + 5px);
}
#volumeSlider {
    -webkit-appearance: none;
    appearance: none;
    /* Removed writing-mode: bt-lr; */
    width: 100px; /* Adjusted for horizontal orientation */
    height: 8px; /* Adjusted for horizontal orientation */
    background: var(--glass);
    border-radius: 4px;
}
#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

#audioPlayer { display: none; }
body.miniplayer-active { padding-bottom: 85px; }

@media (max-width: 768px) {
    body.miniplayer-active { padding-bottom: 110px; }
    
    body.miniplayer-active #musicPlayerContainer {
        height: calc(100% - 110px);
    }
    
    #miniplayer {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "info actions"
            "center center";
        height: 110px;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }
    .player-left-info { grid-area: info; }
    .player-center-controls { grid-area: center; padding: 0 1rem; }
    .player-right-actions { grid-area: actions; justify-content: flex-end; }
    #downloadBtn, #downloadAlbumBtn, #eqBtn, #volumeControl { display: none; }
}

@media (max-width: 576px) {
    #player-controls { gap: 1.5rem; }
}