/* google fonts */
@import url('https://fonts.googleapis.com/css2?family=Righteous&family=Roboto:wght@300&display=swap');

/* full site styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body * {
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    color: black;
    font-weight: bold;
}

body {
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 100%;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: 'Righteous', sans-serif;
    font-size: 25px;
}

a {
    text-decoration: none;
}

a:hover {
    color: white;
    text-decoration: none;
    border: 0px;
}

/* header */
header {
    min-height: 50px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background-color: #03c0d0;
    padding: 20px;
    gap: 20px;
    align-items: center;
}

.header-item {
    padding: 20px;
    align-self: center;
}

.header-logo a:hover {
    color: black;
    border-bottom: solid 6px white;
}

.header-logo {
    display: inline-block;
    margin-right: 20px;
}

.header-logo a {
    font-size: 240%;
    font-family: 'Righteous', sans-serif;
}

.header-logo i {
    font-size: 260%;
}

nav {
    justify-self: end;
    align-self: center;
    display: grid;
}

nav a:hover {
    color: black;
    border-bottom: solid 6px white;
}

nav ul {
    justify-self: end;
}

nav li {
    display: inline-block;
    list-style-type: none;
    margin-left: 20px;
    font-weight: bold;
}

nav li a {
    font-size: 150%;
    font-family: 'Righteous', sans-serif;
}

nav button {
    background-color: black;
    cursor: pointer;
    border-radius: 5px;
    color: white;
    font-size: 140%;
    padding: 4px 6px;
    font-family: 'Righteous', sans-serif;
}

nav button:hover {
    color: black;
    background-color: white;
    font-weight: bold;
    border-radius: 5px;
}

.logout button {
    border: 0px;
}

.logout .button:hover {
    border: 0px;
}

.login-button {
    background-color: black;
    border-radius: 5px;
    padding: 4px 6px;
}

.login-button:hover {
    color: black;
    background-color: white;
    padding: 4px 6px;
    font-weight: bold;
}

.login a {
    color: white;
    font-weight: lighter;
    font-size: 140%;
}

.login a:hover {
    border-bottom: 0px;
    color: black;
}

.header-item ul {
    list-style-type: none;
}

.nav-search-bar {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 10px;
    justify-self: end;
}

.nav-search-bar input {
    padding: 6px;
    border: solid 3px black;
    border-radius: 5px;
    height: fit-content;
    font-size: 100%;
}

.nav-search-bar button {
    font-size: 100%;
    padding: 6px;
}

/* main pages */
main {
    display: grid;
    grid-template-rows: min-content min-content min-content;
    grid-template-columns: 100%;
    margin: 20px;
}

.wrapper {
    grid-row-start: auto;
    grid-row-end: auto;
    grid-template-columns: 100%;
}

.homepage-wrapper {
    grid-row-start: auto;
    grid-row-end: auto;
    margin: -20px;
}

/* code predominantly taken from nicolaslule.com --> more details in README */
.homepage-image-container {
    position: relative;
    display: flex;
    flex-direction: column;
    background-image: url(https://res.cloudinary.com/dfgylv4o2/image/upload/v1673627238/static/images/hero-image-home.5e7310739c7e.jpg);
    height: 100vh;
    align-self: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    align-items: center;
    justify-content: center;
    background-position: center center;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

.homepage-image-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(3, 192, 208, 0.9);
    width: 30%;
    height: 15%;
    padding: 30px 40px;
    border-radius: 5px;
    text-align: center;
}

.homepage-search-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 10px;
    width: max-content;
    height: max-content;
}

.homepage-search-bar input {
    padding: 6px;
    border: solid 3px black;
    border-radius: 5px;
    font-size: 110%;
}

.homepage-search-bar button {
    border-radius: 5px;
    padding: 10px;
    background-color: black;
    color: white;
    border: 0px;
}

.hero-page-wrapper {
    grid-row-start: auto;
    grid-row-end: auto;
    grid-template-columns: 100%;
    margin: -20px;
}

/* code predominantly taken from nicolaslule.com --> more details in README */
.hero-image-container {
    position: relative;
    display: flex;
    flex-direction: column;
    background-image: url(https://res.cloudinary.com/dfgylv4o2/image/upload/v1673627239/static/images/hero-image-main.77be93a29c41.png);
    height: 100vh;
    align-self: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    align-items: center;
    justify-content: center;
    background-position: center center;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

.hero-image {
    width: 100%;
}

.hero-image-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(3, 192, 208, 0.9);
    width: max-content;
    height: max-content;
    padding: 30px 40px;
    border-radius: 5px;
    text-align: center;
}

.hero-image-content ul {
    list-style-type: none;
}

.hero-image-content li {
    padding: 10px 0px;
}

.text-highlight {
    border-bottom: solid 6px white;
    font-size: 120%;
    font-family: 'Righteous', sans-serif;
}

.message-wrapper {
    position: absolute;
    top: 19%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: fit-content;
    text-align: center;
}

.alert {
    border: solid #39217d;
    padding: 20px;
    background-color: rgb(57, 33, 125, 0.9);
    list-style: none;
    font-size: 120%;
}

.alert p,
.alert li {
    font-size: 100%;
    color: white;
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
}

/* code predominantly taken from W3Schools --> more info in README */
.alert-close-button {
    color: white;
    font-weight: bold;
    float: right;
    font-size: 22px;
    cursor: pointer;
    transition: 0.3s;
}

.alert-close-button:hover {
    color: #03c0d0;
}

.section-alert {
    list-style: none;
    margin: 20px 0px;
    border: solid #39217d;
    border-radius: 5px;
    padding: 10px;
    background-color: rgb(57, 33, 125, 0.8);
    list-style: none;
    font-size: 120%;
}

.section-alert p,
.section-alert li {
    font-size: 75%;
    color: white;
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
}

button {
    border-radius: 5px;
    padding: 6px 8px;
    background-color: black;
    cursor: pointer;
    color: white;
    font-size: 90%;
    font-family: 'Righteous', sans-serif;
    color: white;
    font-weight: normal;
    border: 0px;
}

button:hover {
    background-color: white;
    color: black;
    font-weight: bold;
    border: 0px;
}

button a {
    border-radius: 5px;
    padding: 6px 8px;
    background-color: black;
    cursor: pointer;
    color: white;
    font-family: 'Righteous', sans-serif;
    color: white;
    font-weight: normal;
}

button a:hover {
    background-color: white;
    color: black;
    font-weight: bold;
    border: 0px;
}

.button {
    border-radius: 5px;
    padding: 10px;
    background-color: black;
    cursor: pointer;
    font-family: 'Righteous', sans-serif;
    color: white;
    font-size: 90%;
    font-weight: normal;
    border: 0px;
}

.button:hover {
    color: black;
    background-color: white;
    font-weight: bold;
    border: 0px;
}

.song-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 10px;
}

.song-buttons button:hover {
    background-color: #03c0d0;
}

input,
textarea {
    padding: 8px;
    border: solid 3px black;
    border-radius: 5px;
}

.site-form {
    display: grid;
    grid-template-rows: 1fr;
    gap: 5px;
}

.site-form .button,
.site-form label {
    justify-self: center;
}

.site-form .button {
    margin-top: 10px;
    padding: 10px;
    border: 0px;
}

.site-form label {
    font-weight: bold;
}

.site-form br {
    display: none;
}

.song-form input,
.song-form textarea {
    text-transform: capitalize;
}

.helptext, 
.errorlist,
.nonfield {
    list-style: none;
    margin: 5px 0px 10px 0px;
    border: solid #39217d;
    border-radius: 5px;
    padding: 4px 6px;
    background-color: rgb(57, 33, 125, 0.8);
    font-weight: normal;
    font-size: 75%;
    color: white;
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
}

.helptext span {
    list-style: none;
    font-size: 75%;
    color: white;
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
}

.helptext ul,
.helptext li,
.errorlist li,
.nofield li {
    list-style: none;
    font-size: 100%;
    color: white;
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
}

.page-header {
    margin-bottom: 10px;
}

.page-header-with-button {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 10px;
    align-items: center;
}

.page-header-title {
    font-size: 200%;
}

.page-header-title-with-button {
    font-size: 200%;
    justify-self: start;
}

.page-header-item {
    justify-self: end;
    display: grid;
}

.page-content ul {
    list-style: none;
}

.page-content li {
    padding: 10px 0px;
}

/* max-height and overflow-y code taken from W3Schools --> see README */
.song-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px;
    justify-items: center;
    max-height: 800px;
    overflow-y: auto;
}

.song-list-title {
    margin-bottom: 10px;
    text-align: center;
}

.song-list-item {
    display: grid;
    grid-template-columns: auto;
    gap: 20px;
    justify-items: center;
    height: fit-content;
    width: fit-content;
}

.song-list-song {
    display: grid;
    grid-template-columns: auto;
    gap: 20px;
    justify-items: center;
}

.song-list-song a {
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
    border: solid 3px transparent;
    border-radius: 5px;
    padding: 2px 4px;
}

.song-list-song a:hover {
    background-color: white;
    color: black;
    border: solid 3px black;
    border-radius: 5px;
    font-weight: normal;
    padding: 2px 4px;
}

/* max-height and overflow-y code taken from W3Schools --> see README */
.user-songs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 20px 0px;
    max-height: 600px;
    overflow-y: auto;
}

/* max-height and overflow-y code taken from W3Schools --> see README */
.songs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin: 20px 0px;
    max-height: 800px;
    overflow-y: auto;
}

.song {
    padding: 20px;
    border: solid 4px black;
    border-radius: 5px;
    background-color: white;
}

.song:hover {
    border: solid 4px white;
}

.song-card,
.song-card a {
    display: grid;
    grid-template-rows: auto;
    gap: 10px;
    justify-items: center;
}

.song-detail {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 20px;
    cursor: default;
    padding: 20px 0px;
}

.song-info {
    padding: 20px;
    border: solid 4px black;
    border-radius: 5px;
    background-color: white;
}

.song-info p {
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
}

/* max-height and overflow-y code taken from W3Schools --> see README */
.song-lyrics {
    display: grid;
    justify-items: center;
    font-weight: bold;
    line-height: 260%;
    white-space: pre-line;
    overflow-y: auto;
    max-height: 800px;
    width: 1200px;
}

.song-lyrics p {
    text-align: center;
}

.jukebox {
    padding: 50px;
    border: solid 10px black;
    border-radius: 100px 100px 10px 10px;
    width: fit-content;
    background: #03c0d0;
}

.jukebox-item {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 40px;
    justify-items: center;
}

.jukebox-songs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.jukebox-song {
    padding: 20px;
    border: solid 4px black;
    border-radius: 5px;
    background-color: white;
}

.jukebox-song:hover {
    border: solid 4px white;
}

/* jukebox animation code taken from css tricks --> more info in README */
.jukebox-image {
    --s: 280px;

    display: grid;
    width: var(--s);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: calc(var(--s)/20);
    border-radius: 50%;
    position: relative;
    clip-path: circle(49.5%);
    background: black;
}

.jukebox-image::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: inherit;
    border-radius: inherit;
    background: repeating-conic-gradient(black 0 30deg, black 0 60deg);
    -webkit-mask: linear-gradient(#fff 0 0, #fff 0 0) content-box, linear-gradient(#fff 0 0, #fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.jukebox-image>img {
    grid-area: 1/1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    transform-origin: 50% 120.7%;
}

.jukebox-image::after,
.jukebox-image>img {
    animation: m 8s infinite cubic-bezier(.5, -0.2, .5, 1.2);
}

.jukebox-image>img:nth-child(2) {
    animation-delay: -2s
}

.jukebox-image>img:nth-child(3) {
    animation-delay: -4s
}

.jukebox-image>img:nth-child(4) {
    animation-delay: -6s
}

@keyframes m {

    0%,
    3% {
        transform: rotate(0)
    }

    22%,
    27% {
        transform: rotate(-90deg)
    }

    47%,
    52% {
        transform: rotate(-180deg)
    }

    72%,
    77% {
        transform: rotate(-270deg)
    }

    98%,
    100% {
        transform: rotate(-360deg)
    }
}

/* footer */
footer {
    min-height: 50px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    background-color: #03c0d0;
    padding: 20px;
    gap: 20px;
    align-items: center;
}

.footer-item {
    padding: 20px;
    text-align: center;
}

footer li {
    list-style-type: none;
    font-family: 'Righteous', sans-serif;
    font-weight: normal;
}

#footer-logo {
    justify-self: start;
}

#footer-logo p {
    font-family: 'Righteous', sans-serif;
    font-size: 130%;
}

#footer-copyright {
    font-weight: bold;
    font-size: small;
}

#footer-text {
    font-size: 90%;
    text-align: center;
}

.footer-socials {
    justify-self: end;
}

.footer-item i {
    font-size: 110%;
}

.footer-socials i:hover {
    color: #39217d;
}

/* responsive design */
.responsive-wrapper {
    display: none;
}

/* 1440px and down */
@media only screen and (max-width: 1440px) {
    header {
        grid-template-columns: repeat(2, auto);
        gap: 0px;
        padding: 10px;
    }

    .header-item,
    .footer-item {
        padding: 10px;
    }

    nav,
    nav ul {
        justify-self: start;
    }

    nav li {
        margin-right: 20px;
        margin-left: 0px;
    }

    .message-wrapper {
        top: 25%;
    }

    .homepage-image-content {
        width: 80%;
    }

    .songs {
        grid-template-columns: 1fr 1fr;
        max-height: 600px;
    }

    .song-lyrics {
        max-height: 600px;
        width: 600px;
    }

    footer {
        gap: 0px;
        padding: 10px;
    }
}

/* 1024px and down */
@media only screen and (max-width: 1024px) {
    body * {
        font-size: 15px;
    }

    h1, h2, h3, h4 {
        font-size: 20px;
    }

    .header-logo i {
        font-size: 280%;
    }

    .alert-close-button {
        font-size: 20px;
    }

    .wrapper {
        justify-items: center;
        text-align: center;
    }

    .song-detail {
        grid-template-columns: 1fr;
    }

    .jukebox {
        justify-self: center;
    }
}

/* 768px and down */
@media only screen and (max-width: 768px) {
    header,
    footer {
        grid-template-columns: repeat(1, 1fr);
    }

    header {
        text-align: center;
    }

    nav ul,
    nav {
        justify-self: center;
    }

    .nav-search-bar {
        grid-template-columns: 1.5fr 1fr;
    }

    .nav-search-bar input {
        justify-self: end;
        text-align: center;
    }

    .nav-search-bar button {
        justify-self: start;
    }

    /* code taken from Stack Overflow - more details in README */
    .homepage-image-container,
    .hero-image-container {
        background-attachment: scroll;
    }

    .homepage-search-bar input {
        text-align: center;
    }

    .hero-image-content {
        width: fit-content;
        height: fit-content;
    }

    .songs,
    .song-list {
        grid-template-columns: 1fr;
    }

    .user-songs {
        max-height: 400px;
    }

    .song-lyrics {
        max-height: 600px;
        width: 400px;
    }

    .message-wrapper {
        top: 30%;
    }

    .alert-close-button {
        font-size: 16px;
    }

    .footer-socials,
    #footer-logo {
        justify-self: center;
    }
}

/* 425px and down */
@media only screen and (max-width: 425px) {
    h1, h2, h3, h4 {
        font-size: 15px;
    }

    .header-logo i {
        font-size: 220%;
    }

    .header-item {
        padding: 10px;
    }

    nav ul {
        display: grid;
        gap: 5px;
        grid-template-columns: repeat(4, 1fr);
        align-items: center;
    }

    nav li {
        margin-right: 0px;
    }

    nav li a {
        font-size: 120%;
    }

    nav button,
    .logout,
    .login {
        font-size: 110%;
    }

    .nav-search-bar {
        grid-template-columns: 1fr;
    }

    .nav-search-bar,
    .nav-search-bar input,
    .nav-search-bar button {
        justify-self: center;
        width: 100%;
    }

    .login-button {
        font-size: 115%;
    }

    .login a,
    .logout button {
        font-size: 100%;
    }

    .homepage-image-content {
        width: 80%;
    }

    .homepage-search-bar {
        grid-template-columns: 1fr;
    }

    .page-header-title-with-button,
    .page-header-item {
        justify-self: center;
    }

    .page-header-with-button {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .user-songs {
        grid-template-columns: 1fr;
    }

    .song-list {
        gap: 10px;
        max-height: 600px;
    }

    .song-list-item {
        margin: 10px 0px;
    }

    .jukebox-image {
        width: 100%;
    }

    .song-lyrics {
        width: 200px;
    }
}

/* 375px and down */
@media only screen and (max-width: 375px) {
    .header-logo a {
        font-size: 230%;
    }

    .header-logo i {
        font-size: 210%
    }
    
    .message-wrapper {
        top: 35%;
    }

    .alert {
        padding: 10px;
    }

    .jukebox-image {
        width: 110%;
    }

    .song-lyrics {
        width: 150px;
    }
}

/* 320px and down */
@media only screen and (max-width: 320px) {
    nav ul {
        grid-template-columns: repeat(3, 1fr);
    }

    .homepage-image-content {
        width: 90%;
    }

    .jukebox-image {
        width: 130%;
    }

    .song-lyrics {
        width: 100px;
    }
}