:root {
    --background-base: #121212;
    --background-highlight: #1a1a1a;
    --background-press: #000;
    --background-elevated-base: #242424;
    --background-elevated-highlight: #2a2a2a;
    --background-tinted-base: hsla(0,0%,100%,.07);
    --background-tinted-highlight: hsla(0,0%,100%,.1);
    --background-tinted-press: hsla(0,0%,100%,.04);
    --text-base: #fff;
    --text-subdued: #a7a7a7;
    --text-bright-accent: #1ed760;
    --essential-base: #fff;
    --essential-subdued: #727272;
    --essential-bright-accent: #1ed760;
    --decorative-base: #fff;
    --decorative-subdued: #292929;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--background-base);
    color: var(--text-base);
    line-height: 1.5;
}

/* Main Container */
.main-container {
    display: grid;
    grid-template-areas:
        "nav main"
        "player player";
    grid-template-columns: 300px 1fr;
    grid-template-rows: 1fr auto;
    height: 100vh;
    gap: 8px;
    padding: 8px;
    background: var(--background-press);
}

/* Navigation Bar */
.nav-bar {
    grid-area: nav;
    background: var(--background-base);
    border-radius: 8px;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.nav-logo {
    padding: 0 12px;
    margin-bottom: 18px;
}

.spotify-logo {
    width: 130px;
    height: 40px;
}

.nav-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    color: var(--text-subdued);
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--text-base);
}

.nav-item.active {
    color: var(--text-base);
    background: var(--background-tinted-base);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

/* Playlists Section */
.nav-playlists {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

.playlist-actions {
    background: var(--background-base);
    border-radius: 8px;
    padding: 16px 12px;
}

.create-playlist-icon,
.liked-songs-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.create-playlist-icon {
    background: var(--background-tinted-base);
}

.liked-songs-icon {
    background: linear-gradient(135deg,#450af5,#c4efd9);
}

.nav-separator {
    height: 1px;
    background: var(--decorative-subdued);
    margin: 8px 0;
}

.playlists-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-item {
    color: var(--text-subdued);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.playlist-item:hover {
    color: var(--text-base);
}

.playlist-item.active {
    color: var(--text-bright-accent);
}

/* Main Content */
.main-content {
    grid-area: main;
    background: var(--background-base);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    height: 64px;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navigation-buttons {
    display: flex;
    gap: 16px;
}

.nav-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,.7);
    border: none;
    color: var(--text-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: rgba(0,0,0,.9);
    transform: scale(1.04);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upgrade-button {
    padding: 8px 32px;
    border-radius: 500px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-base);
    background: rgba(0,0,0,.7);
    border: 1px solid var(--essential-subdued);
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-button:hover {
    transform: scale(1.04);
    border-color: var(--text-base);
}

.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px;
    background: rgba(0,0,0,.7);
    border: none;
    border-radius: 23px;
    color: var(--text-base);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-button:hover {
    background: rgba(0,0,0,.9);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 32px;
    background: var(--background-elevated-base);
    border-radius: 4px;
    padding: 4px;
    min-width: 196px;
    display: none;
    box-shadow: 0 16px 24px rgba(0,0,0,.3);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: var(--text-base);
    text-decoration: none;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: var(--background-tinted-highlight);
}

.dropdown-divider {
    height: 1px;
    background: var(--decorative-subdued);
    margin: 4px 0;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signup-button,
.login-button {
    padding: 8px 32px;
    border-radius: 500px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.signup-button {
    color: var(--text-subdued);
    background: transparent;
}

.signup-button:hover {
    color: var(--text-base);
    transform: scale(1.04);
}

.login-button {
    color: var(--background-base);
    background: var(--text-base);
}

.login-button:hover {
    transform: scale(1.04);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 0 32px 32px;
    overflow-y: auto;
}

/* Now Playing Bar */
.now-playing-bar {
    grid-area: player;
    background: var(--background-base);
    border-radius: 8px;
    padding: 0 16px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.now-playing-left {
    min-width: 180px;
    width: 30%;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.track-image {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
}

.track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details {
    display: flex;
    flex-direction: column;
}

.track-name {
    color: var(--text-base);
    font-size: 14px;
    font-weight: 400;
}

.track-artist {
    color: var(--text-subdued);
    font-size: 11px;
}

.like-button,
.pip-button {
    background: transparent;
    border: none;
    color: var(--text-subdued);
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
}

.like-button:hover,
.pip-button:hover {
    color: var(--text-base);
    transform: scale(1.04);
}

.now-playing-center {
    max-width: 722px;
    width: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-button {
    background: transparent;
    border: none;
    color: var(--text-subdued);
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
}

.control-button:hover {
    color: var(--text-base);
    transform: scale(1.04);
}

.play-pause-button {
    background: var(--text-base);
    border: none;
    color: var(--background-base);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-pause-button:hover {
    transform: scale(1.04);
}

.playback-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playback-time,
.playback-duration {
    min-width: 40px;
    text-align: center;
    font-size: 11px;
    color: var(--text-subdued);
}

.progress-bar,
.volume-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--background-tinted-base);
    position: relative;
    cursor: pointer;
}

.progress-bar {
    flex: 1;
}

.volume-bar {
    width: 93px;
}

.progress {
    height: 100%;
    background: var(--text-subdued);
    border-radius: 2px;
    position: relative;
}

.progress-bar:hover .progress,
.volume-bar:hover .progress {
    background: var(--text-bright-accent);
}

.progress-handle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-base);
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
    display: none;
}

.progress-bar:hover .progress-handle,
.volume-bar:hover .progress-handle {
    display: block;
}

.now-playing-right {
    min-width: 180px;
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--background-tinted-base);
    border: 3px solid var(--background-base);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--background-tinted-highlight);
}
