/* ===========================
    Global Styles & Resets
   =========================== */
*,
*::after,
*::before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
    Body Layout
   =========================== */
body {
    background-color: #121212;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    font-family: "Inter", sans-serif;
}

/* ===========================
    Main Content
   =========================== */
main#search-results,
main#watchlist-results {
    background-color: #212121;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 260px);
    flex: 1;
    padding: 60px 4% 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    font-family: "Inter", sans-serif;
    color: #fff;
    position: relative;
}

/* ===========================
    Placeholder Section
   =========================== */
.placeholder {
    margin-top: 15vh;
    color: #999;
}

.placeholder img {
    width: 100px;
    margin-bottom: 10px;
}

#watchlist-results .placeholder img {
    width: 80px;
    opacity: 0.25;
    margin-bottom: 10px;
}

/* ===========================
    Header & Navigation
   =========================== */
header {
    height: 220px;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('imgs/movie-posters.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    z-index: -1;
}

nav {
    width: 100%;
    height: 90%;
    padding: 0 4%;
    display: flex;
    margin: 0 auto;
    justify-content: space-between;
    align-items: center;
}

nav button {
    border: 1px solid #fff;
    background-color: transparent;
    color: #fff;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: "Inter", sans-serif;
}

nav button:hover {
    background-color: #fff;
    color: #121212;
}

/* ===========================
    Heading Styles
   =========================== */
h1 {
    color: #fff;
    font-family: "Limelight", sans-serif;
    font-weight: 400;
    font-style: normal;
    text-transform: capitalize;
    font-size: clamp(1.2rem, 8vw, 4rem);
}

/* ===========================
    Search Form
   =========================== */
#search-form {
    width: 600px;
    max-width: 95%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #2E2E2F;
    border-radius: 20px;
    margin-bottom: -20px;
    z-index: 1;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1)
}

.search-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    margin-left: 16px;
    background-image: url('imgs/icon-search.png');
    background-size: cover;
    background-position: center;
    pointer-events: none;
    opacity: 0.5;
}

#search-input,
#search-input:focus {
    flex: 1;
    border: none;
    background-color: transparent;
    color: #fff;
    padding: .8em 1.2em .8em 48px;
    font-size: 1rem;
    font-family: "Inter", sans-serif;
    margin-left: 0;
    position: relative;
}

#search-button {
    border: none;
    height: 100%;
    background-color: #4b4b4b;
    color: #fff;
    padding: 8px 24px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: "Inter", sans-serif;
}

#search-button:hover {
    background-color: #fff;
    color: #121212;
}

/* ===========================
    Movie Card Styles
   =========================== */
.movie-card {
    width: 100%;
    max-width: 920px;
    background: linear-gradient(#2c2c2c, #212121, #1c1c1c);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.6),0 -1px 2px 0 rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px;
    position: relative;
}

img.movie-poster {
    width: 200px;
    aspect-ratio: 5/7;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.movie-info {
    flex: 1;
    text-align: left;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 24px;
}

.movie-title,
.movie-data {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    font-size: .875rem;
    font-weight: 300;
}

.movie-title h2 {
    font-weight: 400;
    font-size: 2rem;
}

.movie-title .movie-rating {
    display: flex;
    font-size: 1.2rem;
}

.movie-data {
    color: #ccc;
}

/* ===========================
    Ratings Icons
   =========================== */
.movie-card .imdb-rating,
.movie-card .tomato-rating {
    position: relative;
    margin-left: 30px;
}

.movie-card .imdb-rating::before,
.movie-card .tomato-rating::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    width: 16px;
    height: 16px;
    background-size: cover;
    background-position: center;
    pointer-events: none;
    margin-left: -22px;
}

.movie-card .imdb-rating::before {
    background-image: url('imgs/icon-star.png');
}

.movie-card .tomato-rating::before {
    background-image: url('imgs/icon-tomato.svg');
}

/* ===========================
    Add Button
   =========================== */
.movie-card .add-button,
.movie-card .remove-button {
    position: absolute;
    top: 12px;
    right: 12px;
    border: 1px solid #fff;
    background-color: transparent;
    color: #fff;
    padding: 8px 14px 8px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: "Inter", sans-serif;
}

.movie-card .remove-button {
    background-color: #fff;
    color: #212121;
}

.movie-card .add-button::before,
.movie-card .remove-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-size: cover;
    background-position: center;
    margin-top: 6px;
    margin-left: 6px;
    pointer-events: none;
    background-image: url('imgs/icon-add.png');
    transition: all 0.3s ease;
}

.movie-card .remove-button::before {
    background-image: url('imgs/icon-remove.png');
}

.movie-card .add-button:hover {
    background-color: #fff;
    color: #121212;
}

.movie-card .remove-button:hover {
    background-color: #990000;
    color: #fff;
}

.movie-card .add-button:hover::before,
.movie-card .remove-button::before {
    filter: invert(1);
}

.movie-card .remove-button:hover::before {
    filter: invert(0);
}

/* ===========================
    Footer
   =========================== */
footer {
    width: 100%;
    height: 40px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 12px;
    font-family: monospace;
}

/* ===========================
    Media Queries
   =========================== */
@media (max-width: 700px) {
    nav {
        flex-direction: column;
        justify-content: center;
    }

    .movie-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-bottom: 50px;
    }

    img.movie-poster {
        width: 150px;
        aspect-ratio: 5/7;
    }

    .movie-info {
        text-align: center;
        padding: 0;
        gap: 10px;
    }

    .movie-title {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .movie-title h2 {
        font-size: 1.5rem;
    }

    .movie-title p {
        font-size: 1rem;
    }

    .movie-data {
        margin: 0 auto;
    } 

    .movie-card .add-button,
    .movie-card .remove-button {
        top: auto;
        bottom: 12px;
        right: 50%;
        transform: translateX(50%);
        padding: 6px 12px 6px 28px;
        font-size: 12px;
    }

    .movie-card .add-button::before,
    .movie-card .remove-button::before {
        width: 16px;
        height: 16px;
        margin-top: 4px;
        margin-left: 4px;
    }
}