:root {
    --primary: hsl(259, 43%, 50%);
    --primary-bg: hsl(259, 20%, 30%);
    --primary-subtle: hsl(259, 35%, 48%);
    --bg-dark: hsl(240, 5%, 5%);
    --bg: hsl(240, 5%, 10%);
    --bg-light: hsl(240, 5%, 15%);
    --text: hsl(0, 0%, 90%);
    --text-muted: hsl(0, 0%, 70%);
    --border: hsl(0, 0%, 30%);
    --gold: hsl(46, 65%, 52%);
    --gold-shadow: hsl(44, 67%, 37%);
    --silver: hsl(0, 0%, 75%);
    --silver-shadow: hsl(0, 0%, 54%);
    --bronze: hsl(30, 61%, 50%);
    --bronze-shadow: hsl(32, 61%, 34%);
    --blur-dark: hsla(240, 6%, 10%, 0.7);
    --blur-light: hsl(240, 5%, 15%, 0.6);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
}
*::-webkit-scrollbar-track {
    background: var(--bg);
}
*::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--primary-subtle);
}

body {
    margin: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle, var(--primary-bg), var(--bg-dark));
}

header {
    height: 15%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

main {
    height: 85vh;
}

header p {
    color: var(--primary-subtle);
    margin: 0;
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 5px;
    text-shadow: 0 4px 7px var(--bg-light);
    text-align: center;
}

h1 {
    margin: 0;
    color: var(--primary);
    text-align: center;
    font-size: 3rem;
    font-family: "Fraunces", sans-serif;
    text-shadow: 0 5px 10px var(--bg);
}

#searchContainer {
    height: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10%;
    flex-direction: column;
}

#songInput {
    width: 40%;
    height: 20%;
    background: linear-gradient(to top, var(--bg), var(--bg-light));
    border: solid 3px var(--primary);
    border-radius: 999px;
    text-indent: 5%;
    color: var(--text-muted);
    box-shadow: 4px 4px 10px var(--bg-light);
    font-family: "Inter", sans-serif;
}
#songInput:focus {
    outline: none;
    color: var(--text);
}
#songInput::placeholder {
    color: var(--text-muted);
    font-family: "Inter", sans-serif;
    font-size: auto;
}

#submitBtn {
    width: 10%;
    height: 25%;
    background: linear-gradient(to top, var(--bg), var(--bg-light));
    border: solid 3px var(--primary);
    border-radius: 999px;
    color: var(--text);
    box-shadow: 4px 4px 10px var(--bg-light);
    font-family: "Inter", sans-serif;
    font-size: auto;
}
#submitBtn:hover {
    background: var(--primary-bg);
}
#submitBtn:active {
    background: var(--primary);
    transform: translateY(3px);
    box-shadow: none;
}

#results {
    height: 70%;
    display: flex;
    gap: 5%;
    justify-content: center;
}

#placeholder {
    display: none;
    width: 100%;
    height: 100%;
    gap: 5%;
    justify-content: center;
}

.result, .placeholderResult {
    width: clamp(200px, 20%, 275px);
    height: 75%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to top right, var(--bg), var(--bg-light));
    border: solid 3px var(--border);
    border-radius: 15px;
}
.placeholderResult {
    justify-content: center;
    gap: 10%;
}

.resultImg {
    width: 50%;
    max-width: 125px;
    height: auto;
    margin-top: 5%;
}
.placeholderImg {
    width: 60%;
    height: 40%;
    margin-top: 5%;
    background-color: var(--bg-light);
    border-radius: 15px;
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: var(--bg-light);
    }
    100% {
        background-color: var(--bg-dark);
    }
}

.resultName {
    height: fit-content;
    color: var(--text);
    margin-top: 5%;
    margin-bottom: 0;
    font-size: 1.2rem;
    font-family: "Inter", sans-serif;
}
.placeholderName {
    width: 60%;
    height: 5%;
    margin-top: 7%;
    margin-bottom: 0;
    border-radius: 15px;
    background-color: var(--bg-light);
    animation: skeleton-loading 1s linear infinite alternate;
}

.resultArtist {
    height: fit-content;
    color: var(--text-muted);
    margin-top: 2%;
    margin-bottom: 5%;
    font-family: "IBM Plex Mono", sans-serif;
}
.placeholderArtist {
    width: 50%;
    height: 5%;
    margin-top: 2%;
    border-radius: 15px;
    background-color: var(--bg-light);
    animation: skeleton-loading 1s linear infinite alternate;
}
.lowerResult {
    margin-top: 5%;
}

#result1, #result2 {
    margin-top: 5%;
}

#result1 {
    order: -1;
}

#result0 {
    border-color: var(--gold);
    box-shadow: 0px 2px 10px var(--gold-shadow);
}
#result1 {
    border-color: var(--silver);
    box-shadow: 0px 2px 10px var(--silver-shadow);
}
#result2 {
    border-color: var(--bronze);
    box-shadow: 0px 2px 10px var(--bronze-shadow);
}

.playResult {
    background: var(--primary-subtle);
    border: solid 5px var(--primary);
    border-radius: 999px;
    width: auto;
    aspect-ratio: 1/1;
    margin-bottom: 3%;
}
.playResult:hover {
    background-color: var(--primary);
}
.playResult:active {
    transform: translateY(3px);
}

.playAll {
    margin-left: 7%;
    margin-bottom: 0;
}

.playResult .pauseIcon { display: none; }
.playResult.playing .playIcon { display: none; }
.playResult.playing .pauseIcon { display: block; }

#allResultsBtn {
    display: none;
    position: fixed;
    width: 10%;
    height: 5%;
    left: 45%;
    bottom: 5%;
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    padding: 0;
}
#allResultsBtn:hover {
    color: var(--text);
}

#allResultsContainer {
    position: absolute;
    top: 5%;
    width: 50%;
    height: 90%;
    left: 25%;
    background: linear-gradient(to top, var(--bg-dark), var(--bg));
    border: solid 3px var(--border);
    border-radius: 15px;
}

#closeBtn {
    color: var(--text-muted);
    position: absolute;
    top: 0;
    right: 2%;
    height: 5%;
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: 500;
    padding: 0;
}
#closeBtn:hover {
    color: var(--text);
}

#allResults {
    display: flex;
    flex-direction: column;
    gap: 2%;
    width: 97.5%;
    height: 94%;
    margin-top: 5%;
    margin-left: 2.5%;
    overflow-y: scroll;
    scrollbar-color: var(--bg-light) transparent;
}

.resultAll {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 95%;
    height: 15%;
    background-color: var(--bg-light);
    border: solid 3px var(--border);
    border-radius: 15px;
}

#resultAll0 {
    border-color: var(--gold);
}
#resultPlace0 {
    color: var(--gold);
}


#resultAll1 {
    border-color: var(--silver);
}
#resultPlace1 {
    color: var(--silver);
}

#resultAll2 {
    border-color: var(--bronze);
}
#resultPlace2 {
    color: var(--bronze);
}

.resultNameAll, .resultPlace {
    color: var(--text);
}

.resultImgAll {
    height: 90%;
    width: auto;
}

.resultArtistAll {
    color: var(--text-muted);
    margin-left: 9%;
    font-family: "IBM Plex Mono";
}

.resultPlace {
    width: 5%;
    font-size: 2rem;
    margin: 0 5%;
}

.resultNameAll {
    margin-left: 5%;
    font-size: 1.2rem;
    margin-bottom: 0;
    font-family: "Inter", sans-serif;
}

.resultTextAll {
    width: 50%;
}

#bgBlur {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to top, var(--blur-dark), var(--blur-light));
}


@media (max-width: 700px) {
    body::-webkit-scrollbar-track {
        background: transparent;
    }
    h1 {
        width: 80%;
        height: auto;
        margin-top: 0;
    }
    header p {
        width: 80%;
        margin-top: 0;
    }
    #songInput {
        width: 80%;
        height: 20%;
    }
    #submitBtn {
        width: 30%;
    }
    #results, #placeholder, #allResults {
        height: fit-content;
        flex-direction: column;
        align-items: center;
        gap: 5vh;
    }
    .result, .placeholderResult, .resultAll {
        width: 75%;
        max-width: 300px;
        height: 50vh;
    }
    .lower {
        margin-top: 0;
    }
    #result1, #result2 {
        margin-top: 0
    }#result1 {
        order: 0;
    }
    #allResultsBtn {
        position: static;
        align-self: center;
        width: 100%;
        margin-top: 5%;
    }
    #bgBlur {
        position: static;
        background: transparent;
    }
    #resultAll0, #resultAll1, #resultAll2 {
        display: none;
    }
    #allResultsContainer {
        position: static;
        background: transparent;
        border: none;
        width: 100%;
        height: auto;
        justify-self: center;
        justify-content: center;
        gap: 5vh;
        scrollbar-width: none;
        overflow-y: hidden;
        margin-top: 5%;
    }
    #allResults {
        width: 75%;
        overflow-y: hidden;
        justify-self: center;
        margin: 0;
    }
    .resultAll {
        width: 98%;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }
    .resultPlace {
        display: none;
    }
    .resultImgAll {
        width: 50%;
        max-width: 125px;
        height: auto;
        margin-top: 5%;
    }
    .resultNameAll {
        height: fit-content;
        color: var(--text);
        margin-top: 5%;
        margin-bottom: 0;
        font-size: 1.2rem;
        font-family: "Inter", sans-serif;
        text-align: center;
    }
    .resultArtistAll {
        height: fit-content;
        color: var(--text-muted);
        margin-top: 2%;
        margin-bottom: 5%;
        font-family: "IBM Plex Mono", sans-serif;
        text-align: center;
    }
    .playAll {
        margin-left: 0;
        margin-bottom: 3%;
    }
}