/* Reset and general styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #fff;
    background-color: #121212;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar styles */
.sidebar {
    width: 240px;
    background-color: #000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
}

.sidebar .logo {
    margin-bottom: 30px;
    padding: 20px;
}

.sidebar .logo img {
    width: 40px;
    height: 40px;
    display: block;
}

.sidebar nav ul {
    list-style-type: none;
    padding: 0;
}

.sidebar nav ul li {
    margin-bottom: 15px;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    color: #b3b3b3;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sidebar nav ul li a svg {
    margin-right: 10px;
    width: 24px;
    height: 24px;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    color: #fff;
}

.sidebar nav ul li a:hover svg,
.sidebar nav ul li a.active svg {
    color: #1db954;
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    color: #fff;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Main content styles */
main {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 20px; /* Default padding */
    transition: padding-bottom 0.3s ease;
}

main.player-visible {
    padding-bottom: 100px; /* Adjust this value based on your music player height */
}

header {
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    margin-bottom: 20px;
}

.search-bar input {
    flex-grow: 1;
    padding: 10px;
    border: none;
    border-radius: 20px 0 0 20px;
    background-color: #282828;
    color: #fff;
}

.search-bar button {
    padding: 10px 20px;
    border: none;
    border-radius: 0 20px 20px 0;
    background-color: #1db954;
    color: #fff;
    cursor: pointer;
}

.banner {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
    background-color: #191414;
}

.banner svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 1200px) {
    .banner svg {
        width: 1200px;
        height: 300px;
        transform-origin: left top;
        transform: scale(calc(100vw / 1200));
    }
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    margin-bottom: 20px;
}

.song-grid, .playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.song-card, .playlist-card {
    background-color: #181818;
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.song-card:hover, .playlist-card:hover {
    background-color: #282828;
}

.song-card img, .playlist-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.song-info, .playlist-card > div {
    padding: 10px;
}

.song-info h3, .playlist-card h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.song-info p, .playlist-card p {
    font-size: 12px;
    color: #b3b3b3;
}

/* Music player styles */
.music-player {
    background-color: rgba(24, 24, 24, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid #333;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.music-player.hidden {
    display: none;
}

.music-player .song-info {
    display: flex;
    align-items: center;
    width: 25%;
}

.music-player .album-cover {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    margin-right: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.music-player .song-details {
    display: flex;
    flex-direction: column;
}

.music-player .song-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.music-player .artist-name {
    font-size: 0.9em;
    color: #b3b3b3;
}

.music-player .player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25%;
}

.music-player .control-button {
    background: none;
    border: none;
    cursor: pointer;
    margin: 0 10px;
    transition: transform 0.2s ease;
}

.music-player .control-button:hover {
    transform: scale(1.1);
}

.music-player .control-button img {
    width: 32px;
    height: 32px;
}

.music-player .progress-container {
    display: flex;
    align-items: center;
    width: 40%;
}

.music-player .current-time,
.music-player .total-time {
    font-size: 0.8em;
    color: #b3b3b3;
    width: 40px;
    text-align: center;
}

.music-player .progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: #535353;
    margin: 0 10px;
    cursor: pointer;
    border-radius: 2px;
    position: relative;
}

.music-player .progress {
    height: 100%;
    background-color: #1db954;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.music-player .seeker {
    width: 12px;
    height: 12px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.music-player .seeker:hover {
    transform: translateY(-50%) scale(1.2);
}

.music-player .volume-control {
    display: flex;
    align-items: center;
    width: 10%;
}

.music-player .volume-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    cursor: pointer;
}

.music-player .volume-slider-container {
    position: relative;
    width: 100%;
}

.music-player #volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #535353;
    outline: none;
    border-radius: 2px;
}

.music-player #volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    cursor: pointer;
    border-radius: 50%;
}

.music-player .volume-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background-color: #1db954;
    pointer-events: none;
    border-radius: 2px;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .music-player {
        flex-wrap: wrap;
        padding: 10px;
    }

    .music-player .song-info,
    .music-player .player-controls,
    .music-player .progress-container,
    .music-player .volume-control {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .music-player .progress-container {
        order: -1;
    }
}

/* Responsive design */
@media (max-width: 1200px) {
    .sidebar {
        width: 180px;
    }
    
    main {
        margin-left: 180px;
    }
    
    .song-grid, .playlist-grid, .search-results, .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 60px;
        padding: 10px;
    }
    
    .sidebar .logo img {
        width: 30px;
        height: 30px;
    }
    
    .sidebar nav ul li a {
        justify-content: center;
    }
    
    .sidebar nav ul li a span {
        display: none;
    }
    
    main {
        margin-left: 60px;
    }
    
    .song-grid, .playlist-grid, .search-results, .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px 0;
    }
    
    .sidebar nav ul {
        display: flex;
        justify-content: space-around;
        width: 100%;
    }
    
    .sidebar nav ul li {
        margin: 0;
    }
    
    .sidebar nav ul li a {
        flex-direction: column;
        align-items: center;
        font-size: 12px;
    }
    
    .sidebar nav ul li a span {
        display: block;
        margin-top: 5px;
    }
    
    .user-profile {
        display: none;
    }
    
    main {
        margin-left: 0;
        padding: 10px;
    }
    
    .music-player {
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .music-player .song-info,
    .music-player .player-controls,
    .music-player .progress-container,
    .music-player .volume-control {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .music-player .progress-container {
        order: -1;
    }
    
    .banner svg {
        height: 200px;
    }
    
    .song-detail-container {
        padding: 10px;
    }
    
    .detail-album-cover {
        max-width: 200px;
    }
}

@media (max-width: 576px) {
    .song-grid, .playlist-grid, .search-results, .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .sidebar nav ul li a svg {
        width: 20px;
        height: 20px;
    }
    
    .sidebar nav ul li a span {
        font-size: 10px;
    }
    
    .music-player .control-button img {
        width: 24px;
        height: 24px;
    }
    
    .music-player .album-cover {
        width: 40px;
        height: 40px;
    }
    
    .music-player .song-title,
    .music-player .artist-name {
        font-size: 12px;
    }
    
    .library-controls {
        flex-wrap: wrap;
    }
    
    .library-controls button,
    #library-filter {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .banner svg {
        height: 150px;
    }
}

/* Adjust main content area to account for fixed music player */
main {
    padding-bottom: 120px;
}

/* Ensure the music player stays on top */
.music-player {
    z-index: 1000;
}

/* Additional responsive adjustments */
@media (max-width: 480px) {
    .detail-controls button {
        width: 100%;
        margin: 5px 0;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    #search-input, #search-button {
        width: 100%;
        margin-bottom: 10px;
        border-radius: 20px;
    }
}

/* Library section styles */
#library {
    padding: 20px;
}

.library-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.library-controls button {
    background-color: #1db954;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
}

#library-filter {
    padding: 5px 10px;
    border-radius: 20px;
    border: none;
    width: 200px;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.remove-from-library {
    background-color: #e91429;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

/* Add styles for the Search page */
#search {
    padding: 20px;
}

.search-container {
    display: flex;
    margin-bottom: 20px;
}

#search-input {
    flex-grow: 1;
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 20px 0 0 20px;
    background-color: #282828;
    color: #fff;
}

#search-button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 0 20px 20px 0;
    background-color: #1db954;
    color: #fff;
    cursor: pointer;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Update the main content styles */
main {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
    overflow-y: auto;
}

/* Remove the header styles since we've removed the search bar from there */
header {
    margin-bottom: 30px;
}

/* Add these styles at the end of your CSS file */
#song-detail {
    padding: 20px;
    text-align: center;
    margin-bottom: 100px; /* Add space for the music player */
}

.song-detail-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: rgba(18, 18, 18, 0.8);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.detail-album-cover {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-song-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: #fff;
}

.detail-artist-name, .detail-album-name, .detail-release-date {
    font-size: 16px;
    color: #b3b3b3;
    margin-bottom: 5px;
}

.detail-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.detail-controls button {
    margin: 10px;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 20px;
    background-color: #1db954;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.detail-controls button:hover {
    background-color: #1ed760;
}

/* Responsive design for song detail */
@media (max-width: 768px) {
    .song-detail-container {
        padding: 15px;
    }

    .detail-album-cover {
        max-width: 200px;
    }

    .detail-song-title {
        font-size: 20px;
    }

    .detail-artist-name, .detail-album-name, .detail-release-date {
        font-size: 14px;
    }

    .detail-controls button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Adjust main content area to account for fixed music player */
main {
    padding-bottom: 100px; /* Adjust this value based on your music player height */
}

/* Ensure the music player stays on top */
.music-player {
    z-index: 1000;
}

/* Add these styles to your existing CSS file */

.artist-details {
    margin-top: 30px;
    text-align: left;
}

.artist-details h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.artist-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.artist-bio {
    font-size: 14px;
    line-height: 1.6;
    color: #b3b3b3;
}

.error-message {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 0, 0, 0.1);
    border-radius: 10px;
    margin-top: 20px;
}

.error-message h2 {
    color: #ff4444;
    margin-bottom: 10px;
}

.error-message p {
    color: #ffffff;
}