/* RESET CSS */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

/* VARIABLES */
:root {
    --background-dark: rgb(30, 30, 30);
    --text-color: rgb(245, 245, 245);
}

/* GENERAL */
html {
    -ms-overflow-style: none;
    overflow: -moz-scrollbars-none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    display: none;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-dark);
}

main {
    flex: 1;
}

/* HEADER */
header {
    position: fixed;
    width: 100%;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(90deg, rgba(235, 0, 65, 0.9) 0%, rgba(145, 0, 255, 0.9) 100%);
    backdrop-filter: blur(0.5rem);
    -webkit-backdrop-filter: blur(0.5rem);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

header h1 {
    font-size: 3rem;
    font-weight: 600;
    line-height: normal;
    text-align: center;
    color: var(--text-color);
}

#search-container {
    position: relative;
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-color);
    border: none;
    border-radius: 2rem;
    outline: none;
    background-color: var(--background-dark);
}

button {
    position: absolute;
    right: 0.5rem;
    padding: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    outline: none;
    background-color: transparent;
    cursor: pointer;
}

/* RESULTS */
#results-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    justify-content: center;
}

#no-result {
    position: absolute;
    width: 100%;
    padding-top: 1rem;
    font-size: 2rem;
    text-align: center;
    color: var(--text-color);
}

.card {
    padding-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    overflow: hidden;
    border-radius: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease-in-out;
}

.card:hover {
    transform: scale(1.025);
}

.card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.card h2 {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card h3 {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 200;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .image-wrapper {
    width: 100%;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.card .image-wrapper .spinner {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid rgba(245, 245, 245, 0.3);
    border-top-color: var(--text-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    z-index: 1;
}

.card .image-wrapper img.artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* FOOTER */
footer {
    width: 100%;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.5);
}

footer ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

footer ul a {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

footer ul a:hover {
    transform: translateY(-0.25rem);
}