:root {
    --bg-base: #000000;
    --bg-surface: #121212;
    --bg-elevated: #282828;
    --text-main: #ffffff;
    --text-sub: #b3b3b3;
    --spotify-green: #1db954;
    --sidebar-width: 240px;
    --player-height: 90px;
}

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

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: grid;
    grid-template-areas: 
        "sidebar main"
        "player player";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: calc(100vh - var(--player-height)) var(--player-height);
    height: 100vh;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background-color: var(--bg-base);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--spotify-green);
    font-size: 32px;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    padding: 12px 0;
    color: var(--text-sub);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links li:hover, .nav-links li.active {
    color: var(--text-main);
}

.nav-links li i {
    font-size: 20px;
}

/* Main Content */
.main-content {
    grid-area: main;
    background: linear-gradient(to bottom, #222, var(--bg-surface));
    overflow-y: auto;
    padding: 20px 32px;
}

.top-bar {
    height: 64px;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.search-bar {
    background-color: white;
    border-radius: 500px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 360px;
}

.search-bar i {
    color: #121212;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

/* Song Grid */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.song-card {
    background-color: #181818;
    padding: 16px;
    border-radius: 8px;
    transition: background-color 0.3s;
    cursor: pointer;
    position: relative;
}

.song-card:hover {
    background-color: #282828;
}

.song-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.song-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-card p {
    color: var(--text-sub);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explicit-badge {
    background: #b3b3b3;
    color: #121212;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: bold;
    margin-right: 4px;
}

/* Player Bar */
.player-bar {
    grid-area: player;
    background-color: #181818;
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 30%;
}

.now-playing img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
}

.track-info span {
    display: block;
}

#current-title {
    font-size: 14px;
    font-weight: 500;
}

#current-artist {
    font-size: 12px;
    color: var(--text-sub);
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    gap: 8px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
}

.control-buttons button {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 18px;
    cursor: pointer;
}

.control-buttons button:hover {
    color: var(--text-main);
}

.play-btn {
    font-size: 32px !important;
    color: var(--text-main) !important;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: 12px;
    color: var(--text-sub);
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: #4f4f4f;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: var(--text-main);
    border-radius: 2px;
    width: 0%;
}

.progress-bar:hover .progress-fill {
    background-color: var(--spotify-green);
}

.volume-controls {
    width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.volume-controls input {
    width: 100px;
    accent-color: var(--text-main);
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.hidden {
    display: none !important;
}

.btn-primary {
    background-color: var(--spotify-green);
    color: black;
    border: none;
    padding: 12px 32px;
    border-radius: 500px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
}

.btn-secondary {
    background-color: white;
    color: black;
    border: none;
    padding: 8px 24px;
    border-radius: 500px;
    font-weight: bold;
    cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        grid-template-areas: 
            "main"
            "player";
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .now-playing {
        width: 70%;
    }
    .volume-controls {
        display: none;
    }
    .player-controls {
        width: 30%;
    }
    .progress-container {
        display: none;
    }
}
