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

body {
    font-family: 'Circular Std', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #b3b3b3;
    height: 100vh;
    overflow: hidden;
}

.main-container {
    display: flex;
    height: calc(100vh - 90px); /* Height minus player bar */
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: #000;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logo {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.logo i {
    font-size: 30px;
    margin-right: 5px;
    color: #bb86fc; /* Purple Logo */
}

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

.nav-links li {
    padding: 8px 0;
    font-weight: bold;
    font-size: 14px;
    transition: 0.3s;
}

.nav-links li a {
    text-decoration: none;
    color: #b3b3b3;
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-links li:hover a, .nav-links li.active a {
    color: #fff;
}

.playlist-section {
    margin-top: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.section-title {
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.create-playlist, .liked-songs {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 0;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    color: #b3b3b3;
}

.create-playlist:hover, .liked-songs:hover {
    color: #fff;
}

.playlist-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    height: 200px; /* Limit height */
}

.playlist-list a {
    text-decoration: none;
    color: #b3b3b3;
    font-size: 14px;
    transition: 0.3s;
    display: block;
    padding: 5px 0;
}

.playlist-list a:hover {
    color: #fff;
}

/* Scrollbar for Playlists */
.playlist-list::-webkit-scrollbar {
    width: 8px;
}

.admin-link {
    margin-top: auto;
    border-top: 1px solid #282828;
    padding-top: 15px;
}

.admin-link a {
    color: #bb86fc;
    text-decoration: none;
    font-weight: bold;
}

/* Content */
.content {
    flex-grow: 1;
    background: linear-gradient(180deg, #2a1a3a 0%, #121212 40%); /* Dark Purple Gradient */
    overflow-y: auto;
    position: relative;
}

.top-bar {
    position: sticky;
    top: 0;
    background-color: rgba(18, 18, 18, 0.7); /* Transparent */
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.circle-btn {
    background: #0a0a0a;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
}

.upgrade-btn {
    background: transparent;
    border: 1px solid #888;
    color: #fff;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 20px;
    cursor: pointer;
}

.upgrade-btn:hover {
    transform: scale(1.05);
    border-color: #fff;
}

.user-profile {
    background: #282828;
    padding: 5px 10px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.page-content {
    padding: 20px 32px;
    padding-bottom: 100px;
}

h2 {
    color: #fff;
    font-size: 32px;
    margin-bottom: 20px;
}

/* Grid for Songs */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

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

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

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

.song-card h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-card p {
    font-size: 14px;
    color: #b3b3b3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Play button on hover */
.play-hover-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    background: #bb86fc; /* Purple Accent */
    color: #000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    transform: translate(-50%, -40%); /* Start slightly lower */
    transition: all 0.3s ease;
    box-shadow: 0 8px 8px rgba(0,0,0,0.3);
}

.song-card:hover .play-hover-btn {
    opacity: 1;
    transform: translate(-50%, -50%); /* Center */
}

.play-hover-btn:hover {
    background: #9965f4;
    transform: translate(-50%, -50%) scale(1.05); /* Maintain center and scale */
}


/* Player Bar */
.player-bar {
    height: 90px;
    background-color: #181818;
    border-top: 1px solid #282828;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

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

.now-playing img {
    height: 56px;
    width: 56px;
    margin-right: 14px;
    object-fit: cover;
}

.track-name {
    color: #fff;
    font-size: 14px;
    margin-bottom: 3px;
}

.artist-name {
    font-size: 12px;
}

.like-btn {
    background: transparent;
    border: none;
    color: #b3b3b3;
    margin-left: 20px;
    cursor: pointer;
}

.like-btn:hover {
    color: #fff;
}

/* Player Controls Center */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    max-width: 722px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.control-btn {
    background: transparent;
    border: none;
    color: #b3b3b3;
    font-size: 16px;
    cursor: pointer;
}

.control-btn:hover {
    color: #fff;
}

.control-btn.active {
    color: #bb86fc; /* Active Shuffle/Repeat */
}

.play-pause-btn {
    font-size: 32px;
    color: #fff;
    transition: transform 0.1s;
}

.play-pause-btn:hover {
    transform: scale(1.1);
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #b3b3b3;
}

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

.progress-bar {
    height: 100%;
    background: #b3b3b3;
    border-radius: 2px;
    width: 0%;
}

.progress-bar-wrapper:hover .progress-bar {
    background: #bb86fc; /* Purple on hover */
}

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

.volume-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100px;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #535353;
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    opacity: 0;
}

.volume-wrapper:hover input[type=range]::-webkit-slider-thumb {
    opacity: 1;
}

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

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

::-webkit-scrollbar-thumb {
    background: #555;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: calc(100vh - 120px); /* Adjust for larger mobile player bar */
    }

    /* Hide Sidebar on Mobile, create a bottom nav or hamburger menu if needed.
       For now, we'll hide it to focus on the player content */
    .sidebar {
        display: none; 
    }

    .content {
        width: 100%;
    }

    .top-bar {
        padding: 10px 15px;
    }

    .page-content {
        padding: 15px;
        padding-bottom: 140px; /* Space for player bar */
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .player-bar {
        height: auto;
        padding: 10px;
        flex-direction: column;
        gap: 10px;
        bottom: 0;
    }

    .now-playing {
        width: 100%;
        justify-content: flex-start;
    }

    .player-controls {
        width: 100%;
    }

    .volume-controls {
        display: none; /* Hide volume on mobile to save space */
    }

    /* Transform Explore Premium to Search on Mobile */
    .upgrade-btn {
        display: none;
    }

    #search-container {
        display: block !important;
        margin: 0 10px !important;
        max-width: none !important;
    }
}
