:root {
    --spotify: #1ed760;
    --white: #fff;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a.has-neutral-color {
    color: #b3b3b3;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    /*background-color: #1a1a1a;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);*/
    color: #fff;
    height: 100vh;
    overflow: hidden;
}
.is-hidden {
    display: none !important;
}

.inter-semibold {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
}
.inter-normal {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
}
.inter-light {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;
}
.player-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    overflow: hidden;
}
.player-background {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}
.player-background-color,
.player-background-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}
.player-header {
    padding: 2rem;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.05)
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.playlist-info {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 1.5rem;
}
.playlist-thumbnail-container,
.current-track-thumbnail-container {
    aspect-ratio: 1/1;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.playlist-thumbnail,
.current-thumbnail {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    aspect-ratio: 1/1;
}
.playlist-info.loading .playlist-thumbnail-container,
.playlist-info.loading .playlist-details h1,
.playlist-info.loading .playlist-details p {
    background-color: rgba(255, 255, 255, 0.1);
}
.playlist-info.loading .playlist-details h1,
.playlist-info.loading .playlist-details p {
    max-width: 200px;
}
.playlist-info.loading .playlist-details p {
    margin-top: 2px;
    max-width: 120px;
}

/* DETAILS */
.playlist-details {
    padding-bottom: 1em;
    position: relative;
}

.playlist-details h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #fff;
}

.playlist-details p {
    color: #b3b3b3;
    font-size: 0.9rem;
}
.playlist-details p#playlistAuthor {
    position: absolute;
    right: 0;
    top: 5px;
}
.playlist-details p#playlistAuthor a:hover {
    color: #fff;
}
.player-main {
    flex: 1;
    overflow: hidden;
    padding: 0;
    position: relative;
    z-index: 1;
}

.tracklist {
    height: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
}

.tracklist-header {
    display: grid;
    grid-template-columns: 60px 60px 2fr 1fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 0.85rem;
    color: #b3b3b3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tracklist-content {
    height: 100%; /* calc(100% - 60px);*/
    overflow-y: auto;
}

.track-item {
    display: grid;
    grid-template-columns: 60px 60px 1fr;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.track-item.playing {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.track-number {
    text-align: center;
    color: #b3b3b3;
    font-size: 0.9rem;
}

.track-item.playing .track-number {
    color: var(--white);
}
.track-art {
    aspect-ratio: 1/1;
    background-position: center center;
    background-size: cover;
    border-radius: 8px;
    overflow: hidden;
}
.track-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    text-align: right;
    color: #b3b3b3;
    font-size: 0.9rem;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #b3b3b3;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent_color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.player-footer {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-track-thumbnail {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
}

.current-track-title {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.current-track-artist {
    color: #b3b3b3;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.player-controls {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.75rem;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.control-btn:disabled {
    color: #666;
    cursor: not-allowed;
}

.control-btn:disabled:hover {
    background: none;
    transform: none;
}

.play-pause-btn {
    background: var(--accent_color);
    width: 48px;
    height: 48px;
    color: #000;
}

.play-pause-btn:hover {
    background: var(--accent_color);
    transform: scale(1.05);
}

.play-pause-btn:disabled {
    background: #333;
    color: #666;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.time {
    font-size: 0.75rem;
    color: #b3b3b3;
    min-width: 40px;
}

.progress-bar {
    position: relative;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-filled {
    height: 100%;
    background: var(--accent_color);
    border-radius: 2px;
    transition: width 0.1s ease;
    width: 0%;
}

.progress-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.progress-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent_color);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-bar:hover .progress-slider::-webkit-slider-thumb {
    opacity: 1;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: end;
}

.volume-slider-container {
    width: 100px;
    position: relative;
    top: -3px;
}

.volume-slider {
    width: 100%;
    height: 4px;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent_color);
    border-radius: 50%;
    cursor: pointer;
}

.tracklist-content::-webkit-scrollbar {
    width: 8px;
}

.tracklist-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.tracklist-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.tracklist-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* SMALL SCREENS */
@media only screen and (max-width: 39.9375em) {
    .progress-container,
    .playlist-details p#playlistAuthor {
        display: none;
    }
    .player-header {
        padding: 1.5em;
    }
    .playlist-info {
        grid-template-columns: 100px 1fr;
        gap: 1rem;
        flex-direction: column;
        text-align: left;
    }
    .playlist-details h1 {
        font-size: 1rem;
    }
    .playlist-details p {
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Number of lines to show */
        line-clamp: 2; /* Standard property */
        -webkit-box-orient: vertical;
        /* Optional: for better display control */
        text-overflow: ellipsis;
    }
    .player-controls {
        gap: 0.5rem;
        grid-template-columns: 2fr 1fr;
    }

    .time {
        min-width: 28px;
    }
    .volume-controls {
        justify-self: center;
    }
    .volume-slider-container {
        display: none;
    }
    .tracklist-header,
    .track-item {
        grid-template-columns: 20px 1fr 60px;
        gap: 0.5rem;
    }
    .track-art {
        display: none;
    }
    .player-footer {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
