/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Body */
body {
    margin: 0;
    font-family: "Inter", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: max(23vh, 140px);
    background-image: url("./icons/header.png");
    background-size: cover;
    background-color: #0e0e0e;
    padding: 0 7.5%;
    color: white;
}

button {
    cursor: pointer;
}

h1 {
    font-weight: 800;
    font-size: clamp(2.585rem, 4.75vw, 3.5rem);
}

header a {
    color: white;
    font-weight: bold;
    font-size: clamp(0.95rem, 2vw, 1.35rem);
}

/* Main */
main {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: center;
}

/* Search Component */
#search-component {
    display: flex;
    margin: -20px auto 0;
    width: 84vw;
}

#search-input-container {
    width: 74%;
    position: relative;
}

#search-icon {
    width: clamp(14px, 1.6vw, 18px);
    height: clamp(14px, 1.6vw, 18px);
    position: absolute;
    left: clamp(15px, 2vw, 20px);
    top: 50%;
    transform: translateY(-55%);
    pointer-events: none;
}

#search-input {
    width: 100%;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    padding: 0 10px 2px clamp(40px, 5.5vw, 60px);
}

#search-input::placeholder {
    color: #6b7280;
}

#search-button {
    width: 26%;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    color: #374151;
    background-color: #f9fafb;
}

#search-input,
#search-button {
    border: 1px solid #d1d5db;
    height: clamp(45px, 5.5vw, 50px);
    font-size: clamp(0.875rem, 2.5vw, 1.19rem);
    font-weight: 500;
}

/* Movie List */
ul {
    list-style-type: none;
    padding: 0 5vw;
    margin: 5vh 0 0 0;
    display: flex;
    flex-wrap: wrap;
    row-gap: 20px;
    column-gap: 30px;
}

/* Movie Item */
li {
    display: flex;
    align-items: center;
    gap: 21px;
    flex: 1 1 423px;
    min-width: min(423px, 100%);
    max-width: 1000px;
}

li * {
    margin: 0;
}

.movie-poster {
    width: 99px;
    height: 147px;
    flex-shrink: 0;
}

.movie-info-container {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.movie-header-info-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.movie-title {
    font-size: 18px;
    font-weight: 500;
    color: black;
}

.movie-rating {
    font-size: 12px;
    word-spacing: 3px;
    color: #111827;
}

.movie-midinfo-container {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
    color: #111827;
}

.movie-add-or-remove-button {
    background-color: transparent;
    border: none;
    display: inline-flex;
    gap: 3px;
    align-items: self-end;
    font-size: inherit;
    color: inherit;
}

.movie-add-or-remove-button * {
    pointer-events: none;
}

.movie-add-or-remove-button img {
    width: 16px;
    height: 16px;
    margin-right: 2px;
}

.movie-added-button {
    cursor: default;
    pointer-events: none;
}

.movie-added-button img {
    display: none;
}

.movie-plot {
    font-size: 14px;
    color: #6b7280;
}

/* Add/Remove Icons */
.add-or-remove-icon {
    filter: invert(15%) sepia(17%) saturate(0%) hue-rotate(182deg)
        brightness(101%) contrast(85%);
    aspect-ratio: 1 / 1;
}

/* Empty Placeholder */
#empty-placeholder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin-top: -13vh;
}

#empty-placeholder-a {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #363636;
    font-size: clamp(0.85rem, 1.75vw, 1.85rem);
    font-weight: bold;
}

#strip-icon {
    width: clamp(65px, 7vw, 90px);
    aspect-ratio: 7 / 6.15;
    height: auto;
}

#empty-placeholder-title {
    margin: 10px 0 0 0;
    font-size: clamp(1.125rem, 2.5vw, 2.65rem);
    max-width: 70vw;
    color: #dfdddd;
    font-weight: bold;
    text-align: center;
}

#empty-placeholder-a img {
    margin-top: 2px;
    width: max(14px, 1.65vw);
    height: auto;
}

#spinner-bg {
    background-color: white;
    z-index: 1000;
    width: 100%;
    height: 73%;
    position: absolute;
    inset: 0;
    margin: auto auto 0;
    display: none;
}

#spinner {
    position: absolute;
    inset: 0 0 10% 0;
    width: max(150px, 20vw);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: auto;
}

#spinner svg {
    animation: rotate 1s linear infinite;
}

#spinner circle {
    animation:
        color 2s ease-in-out infinite,
        dash 1.5s ease-in-out infinite;
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes color {
    100%,
    0% {
        stroke: #4285f4;
    }
    25% {
        stroke: #de3e35;
    }
    50% {
        stroke: #f7c223;
    }
    75% {
        stroke: #1da760;
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124;
    }
}

#show-more-button {
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
    background-color: transparent;
    padding: 20px 0 15px;
    color: black;
    border: none;
    display: none;
    font-weight: 500;
    font-size: clamp(0.95rem, 2vw, 1.35rem);
}

#show-more-button:disabled {
    cursor: progress;
    opacity: 0.5;
}
