/* Base Layout */
body{
    height: 100vh;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


.musicPage {
    display: flex;
    flex-direction: row;
    width: 80vw;
    height: 80%;
    position: absolute;
    top: 14vh;
    justify-content: space-between;
    align-items: flex-start;
    overflow: hidden;
    animation: fadeIn 0.3s ease-in-out;
}

#noTracks {
    text-align: center;
    width: 50%;
    margin: 40% 25%;
}

/* Navigation Panel */
.galleryNavPanel {
    width: 20%;
    height: 98%;
    padding: 20px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(1px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-radius: 20px;
    overflow-y: auto;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
}

.navContent {
    display: flex;
    width: 100%;
    flex-direction: column;

}

.galleryNavPanel h3 {
    color: #fff;
    margin-bottom: 10px;
    text-align: center;
}

.galleryNavPanel ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    width: 100%;
}

/* Tags Styling */
.selectedTags ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    grid-gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.selectedTags ul li a {
    display: block;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.8em;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.selectedTags ul li a.active,
.selectedTags ul li a.selected {
  background-color: rgba(255, 255, 255, 0.5)  ;
}

.selectedTags ul li a:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Form Elements */
.galleryNavPanel form {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 20px;
    text-align: center;
}

.galleryNavPanel input[type="text"],
.galleryNavPanel select {
    display: flex;
    width: 80%;
    margin: 0 10%;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    border: none;
    outline: none;
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    margin-bottom: 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.galleryNavPanel select option {
    background-color: #333;
    color: #fff;
}

#searchBtn{
    width: 30%;
    margin: 0 35%;
    padding: 5px;
    background-color: #474747;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 5px;
}

/* Music Gallery */
.musicGallery {
    width: 20%;
    height: 98%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 0 1%;
    box-sizing: border-box;
    position: relative;
}

.trackItem {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(1px);
    border-radius: 15px;
    color: #fff;
    margin: 0 0 10px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 3px solid transparent;
}

.trackItem:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.trackItem.selected {
    background-color: rgba(100, 100, 100, 0.4);
    border: 3px solid #fff;
}

.trackInfo {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    text-align: center;
    width: 60%;
}

.trackTitle {
    margin: 0;
    font-size: 1em;
}

.trackArtist {
    margin: 0;
    font-size: 0.8em;
    color: #ccc;
}

/* Cover Styles */
.coverContainer {
    display: block;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 11px;
    margin: 2px;
}


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

.currentTrackCard {
    width: 60%;
    height: 98%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(1px);
    position: relative;
    margin: 0 0 1vh 1vw;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
}

.currentTrackContent {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
    will-change: background;
}

.commentsSection.open + .currentTrackContent {
    width: 60%;
}

.currentCoverContainer {
    width: 100%;
    height: 70%;
    display: flex;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    align-items: center;
}

.currentCover {
    width: 400px;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

.playButton {
    position: absolute;
    top: 27%;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.2);
    padding-left:  10px;
    border: 3px solid white;
    border-radius: 50%;
    color: transparent;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.playButton.hidden {
    display: none !important;
}

.audioWave {
    position: absolute;
    top: 27%;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: flex-end;
    width: 35px;
    height: 54px;
    gap: 2px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border: solid white 3px;
    border-radius: 100px;
    z-index: 2;
}



.audioWave.visible {
    display: flex !important;
}

.audioWave.playing {
    display: flex;
}

.audioWave span {
    width: 5px;
    background: white;
    animation: wave 1.2s ease-in-out infinite;
    border-radius: 5px;
}

@keyframes wave {
    0%, 100% { height: 8px; }
    50% { height: 30px; }
}

.audioWave span:nth-child(2) { animation-delay: 0.2s; }
.audioWave span:nth-child(3) { animation-delay: 0.4s; }
.audioWave span:nth-child(4) { animation-delay: 0.6s; }
.audioWave span:nth-child(5) { animation-delay: 0.8s; }

/* Current Track Info */
.currentInfo {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: flex-end;
    width: 80%;
    height: 30%;
    text-align: center;
    padding: 20px;
    transition: all 0.3s ease-in-out;
    align-items: center;
}


.commentsSection.open ~ .currentTrackContent .currentInfo {
    text-align: left;
}

.currentInfo h2 {
    margin: 0;
    font-size: 2em;
    color: #fff;
}

.currentInfo p {
    margin: 1vw 0;
    font-size: 1em;
    color: #ccc;
}

/* Tags List */
#tagList {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin: 10px 0;
}

.commentsSection.open ~ .currentTrackContent #tagList {
    justify-content: flex-start;
}

#tagList span {
    background-color: #474747;
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#tagList span:hover {
    background-color: #732763;
}

/* Vote Section */
.voteSection {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


#voteButton {
    width: 30px;
    height: 30px;
    padding: 10px 10px 16px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#voteButton:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

#voteCount{
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 10px;
}

/* Comments Section */
.commentsSection {
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden;
    color: #fff;
    position: absolute;
    top: 0;
    right: 0;
    transition: all 0.3s ease-in-out;
    text-align: center;
}

.commentsSection.open {
    width: 40%;
}

.toggleCommentsButton {
    position: absolute;
    z-index: 10;
    top: 50%;
    right: 0;
    transform: translateY(-50%) rotate(0deg);
    background-color: transparent;
    border: none;
    border-radius: 10px 0 0 10px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    background-repeat: no-repeat;
    background-size: contain;
    width: 30px;
    height: 30px;
}

.toggleCommentsButton.open {
    transform: translateY(-50%) rotate(180deg);
    border-radius: 0 10px 10px 0;
}

.commentsList {
    height: 80%;
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.comment {
    background-color: rgba(255, 255, 255, 0.2);
    width: 80%;
    padding: 10px;
    margin: 5px 5%;
    border-radius: 10px;
    text-align: left;
}

.comment p {
    margin: 0;
}

.commentContent {
    font-size: 0.8em;
    width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.commentAuthor{
    font-weight: bolder;
    font-size: 0.8em;
    color: #ccc;
}

.commentTime {
    font-size: 0.8em;
    color: #ccc;
    text-align: right;
}

/* Comment Form */
#commentForm {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: calc(100% - 40px);
    position: absolute;
    left: 20px;
    margin-top: 20px;
}

#commentForm textarea {
    flex-grow: 1;
    resize: none;
    height: 20px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    outline: none;
    background-color: rgba(255, 255, 255, 0.5);
    color: white;
}

#commentForm button {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#commentForm button:hover {
    background-color: rgba(0, 0, 0, 0.8) ;
}

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

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

::-webkit-scrollbar-thumb {
    background-color: white;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #e0e0e0;
}



.filterByFavorites h3 {
    margin: 0;
}

#favoritesForm{
    display: flex;
    flex-direction: row;
    justify-content: center;
}


.favoriteFilter {
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 10%;

}

.favoriteFilter img {
    width: 24px;
    height: 24px;
    padding: 30px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 38px;
}

.favoriteButton {
    top: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 3;
    padding-right: 2%;
}

.favoriteButton img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.favoriteButton:hover img {
    transform: scale(1.1);
}

.favoriteIcon {
    width: 6%;
    padding-right: 4% ;
}

#commentLoginRequired a {
    color: white;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 5px;
}


























@media screen and (max-width: 1900px) {

.commentsSection.open {
    width: 50%;
}

.commentsSection.open + .currentTrackContent {
    width: 50%;
}

.currentCover {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
}

.playButton{
    top: 21%;
}

.commentsList{
    overflow-x: hidden;
    overflow-y: scroll;
}

#commentForm textarea {
    resize: none;
    height: 10px;
    font-size: 0.6em;
    overflow-y: hidden;
    padding: 10px;
    border-radius: 10px;
    border: none;
    outline: none;
    background-color: rgba(255, 255, 255, 0.5);
    color: white;
}


}












/* Responsive Design */
@media screen and (max-width: 1200px) {

    #content{
        overflow-y: hidden;
    }

    .trackItem{
        margin-left: 4%;
        width: 90%;
    }

    .voteSection{
        position: absolute;
        bottom: 0%;
    }

    #voteButton {
    width: 22px;
    height: 22px;
    padding: 5px 5px 7px 5px;
    }

    .favoriteButton img {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

    #voteCount{
        font-size: 0.7em;
        padding: 3px;
    }

    #currentTags{
        position: absolute;
        bottom: 10%;
    }

    #currentDescription{
        display: none;
    }

    #currentTitle{
        position: absolute;
        bottom: 70%;
    }

    #currentArtist{
        position: absolute;
        bottom: 50%;
    }

    .musicPage {
        flex-direction: column;
        align-items: center;
        justify-content: start;
        width: 100%;
        top: 2vh;
    }

    .galleryNavPanel{
        display: flex;
        overflow: hidden;
        position: absolute;
        bottom: 28vh;
        width: 90%;
        height: 13%;
        max-height: 40vh;
        padding: 10px;     
    }

    .musicGallery{
        width: 100%;
        height: 60%;
        position: absolute;
        top: 68%;
    }

    .galleryNavPanel h3{
        margin: 0;
        font-size: 1em;
    }

    .navContent{
        flex-direction: row;
        overflow: hidden;
    }

    .selectedTags{
        display: none;
    }

    .setSelect{
        display: flex;
        width: 33%;
        flex-direction: column;
    }

    .searchField{
        display: flex;
        width: 33%;
        flex-direction: column;
    }

    .sortingSelect{
        display: flex;
        width: 33%;
        flex-direction: column;
    }

    .favoriteFilter{
        margin-top: 0;
    }

    .favoriteFilter img {
        width: 15px;
        height: 15px;
        padding: 5px;
        border-radius: 10px;
    }

    .trackInfo{
        flex-direction: row;
    }

    #searchBtn{
        width: 92%;
        margin: 0 1%;
        position: absolute;
        top: 68%;
        font-size: 0.8em;
        padding: 3px;
    }

    .currentTrackCard {
        width: 90%;
        height: 50%;
        min-height: 200px;
        margin-bottom: 2vh;
    }


    .currentCover {
        width: 200px;
        height: 200px;
    }


    .currentInfo {
        width: 100%;
        padding: 10px;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
    }

    .currentInfo h2 {
        font-size: 1.4em;
    }

    /* Modify Comment Section Animation for Mobile */
    .commentsSection {
        width: 0; /* Start with zero width */
        height: 100%;
        background-color: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(4px);
        border-top-right-radius: 20px;
        border-bottom-right-radius: 20px;
        overflow: hidden;
        color: #fff;
        position: fixed;
        top: 0;
        right: -100%; /* Start off-screen to the right */
        transition: right 0.3s ease-in-out, width 0s 0.3s; /* Delay width transition */
        text-align: center;
        z-index: 1000;
    }

    .commentsList{
        height: 65%;
    }

    .commentsSection.open {
        right: 0; /* Slide in to the right */
        width: 47%; /* Set width when fully visible */
        transition: right 0.3s ease-in-out, width 0s; /* Apply width immediately */
    }

    .toggleCommentsButton {
        position: fixed;
        bottom: 30%;
        top: auto;
        right: 0%;
        z-index: 1001; /* Ensure button is above the comment section */
    }

    #commentForm {
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: calc(100% - 40px);
    }
}
