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

/* body styles */
body {
    background-color: #121212;
    color: white;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    color: rgb(255, 253, 253);
    padding: 20px;
    background-color: rgb(6, 6, 6);
}

input,
select {
    padding: 8px;
    font-size: 16px;
    margin: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar  */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #111;
    padding: 10px 20px;
    flex-wrap: wrap;
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}

/* hover effect */
.nav-links a:hover,
.nav-links a.active {
    text-decoration: underline;
}

/*  Home Page  */
#filterSection {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
    text-align: center;
    padding: 10px;
    background-color: #111;
}

#resetFilters {
    background-color: red;
    color: white;
    padding: 8px 12px;
    border: none;
    margin: 5px;
    border-radius: 4px;
    cursor: pointer;
}

#movieContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    flex: 1;
}

/* movie cards */

.movie-card {
    background-color: white;
    border: 1px solid gray;
    margin: 10px;
    width: 180px;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.movie-card:hover {
    transform: scale(1.05);
}

/*top-rated */
.movie-info h3,
.movie-info p {
    color: #111;

}

/* image */

.movie-card img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    border-radius: 4px;
}

.movie-info h3 {
    font-size: 16px;
    margin: 10px 0 5px 0;

}

.movie-info p {
    font-size: 14px;
    color: darkslategray;
}


/* error message */

#errorMessage {
    color: red;
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
}


/* About Page */
.background-wrapper {
    background-image: url('../img/horror-movie-collage.webp');
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    position: relative;
    z-index: 0;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.about-content {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 2rem;
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.about-content h1 {
    margin-bottom: 1rem;
    color: #f7f4f4;
}

.about-content p {
    margin: 0.8rem 0;
    color: #333;
}

.about-container a {
    color: #101111;
    text-decoration: underline;
}


/* Movie Details Page */
.movie-details-container {
    padding: 30px 20px;
    text-align: center;
    max-width: 900px;
    margin: auto;
    animation: fadeIn 0.5s ease-in;
}

.movie-details-container h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: white;
}

.movie-details-container p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: white;
    margin-bottom: 30px;
}

.movie-details-container .trailer-container iframe {
    max-width: 100%;
    height: 315px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.movie-details-container #backButton {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 20px;
    background-color: #303fe5;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.movie-details-container #backButton:hover {
    background-color: #333;
}


/* footer */
footer {
    background-color: rgb(16, 16, 16);
    text-align: center;
    font-size: 14px;
    color: #939191;
    padding: 10px;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    width: 100%;
}

/* Movie Details Page */
.movie-details-container {
    padding: 30px 20px;
    text-align: center;
    max-width: 900px;
    margin: auto;
    animation: fadeIn 0.5s ease-in;
}

.movie-details-container h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: white;
}

.movie-details-container p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: white;
    margin-bottom: 30px;
}

.movie-details-container .trailer-container iframe {
    max-width: 100%;
    height: 315px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.movie-details-container #backButton {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 20px;
    background-color: #303fe5;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.movie-details-container #backButton:hover {
    background-color: #333;
}


/*  Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    background-color: white;
    padding: 20px;
    max-width: 90%;
    width: 600px;
    border-radius: 8px;
    position: relative;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

/* responsiveness */
@media (max-width: 768px) {
    .movie-details-container h2 {
        font-size: 1.6rem;
    }

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

    .movie-details-container .trailer-container iframe {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .movie-details-container h2 {
        font-size: 1.3rem;
    }

    .movie-details-container p {
        font-size: 0.95rem;
    }

    .movie-details-container #backButton {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .movie-details-container .trailer-container iframe {
        height: 200px;
    }
}