@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', serif;
    box-sizing: border-box;
}

html {
    overflow: hidden;
}
.invert {
    filter: invert(1);
}

body {
    background-color: #000000;
    color: aliceblue;
    display: grid;
    grid-template-columns: 300px auto;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "navbar navbar"
        "sidebar mainbar"
        "playbar playbar";
    gap: 5px 0;
    min-height: 100vh;
}

nav {
    grid-area: navbar;
    height: 60px;
    background-color: #000000;
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    box-shadow: 0 2px 4px 0 rgba(87, 87, 87, 0.434);
    margin-bottom: 10px;
    z-index: 100;
}

.nav-part1 {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
}
.logo-name {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    padding-right: 25px;
}
.search-container {
    display: flex;
    align-items: center;
    background-color: #1e1e1e;
    border-radius: 30px;
    padding: 10px 15px;
    width: 300px;
}

.search-container i {
    color: #aaa;
    font-size: 18px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    padding: 0 10px;
    font-size: 16px;
}

.nav-part2 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.user-profile {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

aside {
    grid-area: sidebar;
    position: sticky;
    top: 70px;
    margin: 0 10px 0;
    border-radius: 10px 10px 0 0;
    align-self: start;
    height: calc(100vh - 160px);
    background-image: linear-gradient(to bottom, #181818, #121212);
}

.sidebar-container {
    padding: 10px 0 0 10px;
    height: 82%;
}

.sidebar-title {
    display: flex;
    gap: 20px;
    align-items: center;
    padding-bottom: 10px;
    box-shadow: 0 2px 4px 0 rgba(87, 87, 87, 0.434);
}

.song-list {
    overflow-y: scroll;
    height: 90%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.song-list::-webkit-scrollbar {
    display: none;
}

.song-list ul {
    padding: 8px 15px;
}

.song-list li {
    list-style-type: none;
    display: flex;
    border-bottom: 1px solid #333;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
    padding: 5px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.song-list li:hover {
    background-color: #2a2a2a;
    border-radius: 5px;
}

.info {
    flex-grow: 1;
    text-align: center;
    margin: 0 10px;
    overflow: hidden;
}

.info h3 {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info p {
    font-size: 12px;
    color: #b3b3b3;
}

.song-list li.playing {
    background-color: #2a2a2a;
    border-radius: 5px;
}

.song-list li.playing .info h3 {
    color: #1db954;
}

.footer-section {
    padding-left: 20px;
    padding-top:10px ;
}

.footer-section ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 5px;
}

.footer-section ul li {
    list-style: none;
    font-size: 10px;
}

.footer-section ul li a {
    color: #ffffff;
    text-decoration: none;
}

.footer-section ul li a:hover {
    text-decoration: underline;
}

main {
    grid-area: mainbar;
    padding: 20px;
    background-image: linear-gradient(to bottom, #222222, #121212);
    margin: 0 10px 0;
    border-radius: 10px 10px 0 0;
    position: relative;
    height: calc(100vh - 160px);
    transition: filter 0.3s ease;
}

.mainbar-container {
    height: 100%;
    overflow-y: scroll;
    background-color: #1e1e1e;
    color: white;
    padding: 10px 5px 10px 10px;
    box-sizing: content-box;
    border-radius: 10px;
}

.mainbar-container::-webkit-scrollbar {
    width: 10px;
}

.mainbar-container::-webkit-scrollbar-track {
    background: #232323;
    border-radius: 10px;
}

.mainbar-container::-webkit-scrollbar-thumb {
    background: #323232;
    border-radius: 10px;
}

.mainbar-container::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

.cards-container {
    margin-top: 10px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.song-card {
    height: 145px;
    width: 130px;
    font-size: 10px;
    border-radius: 5px;
    background-color: #33364580;
    padding: 5px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.song-card:hover {
    background-color: #535353;
}

.song-card img {
    height: 100px;
    width: 110px;
    object-fit: cover;
    border-radius: 5px;
    margin: 0 5px;
}

.card-play {
    position: absolute;
    display: none;
    bottom: -30px;
    right: 5px;
    cursor: pointer;
}

.song-card:hover .card-play {
    display: block;
    bottom: 45px;
    right: 5px;
    transition: all 0.3s ease-in;
}

.playbar {
    grid-area: playbar;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background-color: #181818;
    border-top: 1px solid #282828;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.playbar-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Song Info Section */
.song-info-section {
    display: flex;
    align-items: center;
    width: 300px;
    min-width: 200px;
    flex-shrink: 0;
}

.song-artwork {
    width: 56px;
    height: 56px;
    background-color: #282828;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    overflow: hidden;
}

.song-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.music-icon {
    width: 24px;
    height: 24px;
    opacity: 0.7;
}

.song-details {
    flex: 1;
    min-width: 0;
}

.song-title {
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    color: #b3b3b3;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Playbar Controls */
.playbar-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 722px;
    margin: 0 32px;
}

.control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.control-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.play-btn {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.play-btn:hover {
    transform: scale(1.08);
    background: #f0f0f0;
}

.progress-section {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.time-current,
.time-total {
    color: #a7a7a7;
    font-size: 12px;
    font-weight: 400;
    min-width: 40px;
    text-align: center;
    user-select: none;
}

.progress-bar-container {
    flex: 1;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #4a4a4a;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.progress-bar-container:hover .progress-bar {
    height: 6px;
    background-color: #535353;
}

.progress-fill {
    height: 100%;
    background-color: #1ed760;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar-container:hover  {
    opacity: 1;
}

/* Volume Section */
.volume-section {
    display: flex;
    align-items: center;
    width: 300px;
    min-width: 200px;
    justify-content: flex-end;
    gap: 16px;
    flex-shrink: 0;
}

.volume-bar-container {
    width: 93px;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.volume-bar {
    width: 100%;
    height: 4px;
    background-color: #4a4a4a;
    border-radius: 2px;
    position: relative;
    transition: all 0.2s ease;
}

.volume-bar-container:hover .volume-bar {
    height: 6px;
    background-color: #535353;
}

.volume-fill {
    height: 100%;
    background-color: #1ed760;
    border-radius: 2px;
    width: 75%;
    transition: width 0.1s linear;
    position: relative;
}

.volume-bar-container:hover  {
    opacity: 1;
}

.invert {
    filter: invert(1);
}

/* Active states */
.control-btn.active {
    color: #1db954;
}

/* Hide playlist toggle button by default on desktop */
#playlist-toggle-btn {
    display: none;
}

.blurred {
    filter: blur(4px);
    user-select: none;
}



/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "navbar"
            "mainbar"
            "playbar";
    }

    aside {
        display: none;
    }

    #playlist-toggle-btn {
        display: flex;
    }

    aside.show-sidebar {
        display: block;
        position: fixed;
        left: 0;
        top: 70px;
        height: calc(100vh - 220px); /* 70px nav + 150px playbar */
        width: 300px;
        margin: 0;
        border-radius: 0;
        z-index: 2000; /* Ensure it's on top */
        box-shadow: 3px 0 10px rgba(0,0,0,0.4);
    }

    main {
        /* nav(60px + 10px margin) + playbar(150px) = 220px */
        height: calc(100vh );
    }

    .playbar {
        height: 150px;
    }

    .playbar-container {
        flex-direction: column;
        justify-content: center;
        padding: 8px 12px;
        gap: 8px;
    }

    .song-info-section {
        width: 100%;
        min-width: 0;
        justify-content: space-between;
    }
    .volume-section {
        display: none;
    }
    
    .progress-section {
        gap: 12px;
    }
    
    .time-current,
    .time-total {
        min-width: 35px;
        font-size: 11px;
    }
    .playbar-controls {
        margin: 0 10px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    main{
        height: 105vh;
    }
    .mainbar-container {
        padding-left: 30px;
    }
    .song-card {
    height: 200px;
    width: 200px;
    font-size: 14px;
    border-radius: 10px;
    padding: 10px;
    
    }



    .song-card img {
    height: 140px;
    width: 170px;
    object-fit: cover;
    border-radius: 7.5px;
  
}
.card-play{
    height: 50px;
}
    
    .playbar-container {
        flex-direction: column;
        justify-content: center;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .song-info-section {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
    
    .song-artwork {
        width: 48px;
        height: 48px;
        margin-right: 12px;
    }
    
    .playbar {
        height: 150px;
    }

    aside.show-sidebar {
        height:100%;
    }

    .volume-section {
        display: none;
    }
    
    
    
    .control-buttons {
        gap: 12px;
    }
    
    .play-btn {
        width: 32px;
        height: 32px;
    }

    .playbar-controls {
        margin: 0 10px;
        width: 100%;
    }
}