/* Futuristic Neon Theme */
body {
    font-family: 'Arial', sans-serif;
    text-align: center;
    background-color: #0a0a0a;
    color: #00eaff;
    padding: 20px;
    overflow-x: hidden;
}

h1 {
    font-size: 2.5em;
    text-shadow: 0 0 10px #00eaff, 0 0 20px #00eaff;
    margin-bottom: 20px;
}

p {
    font-size: 1.2em;
    color: #c0c0c0;
}

.search-box {
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(32, 32, 32, 0.8);
    border: 2px solid #00eaff;
    border-radius: 12px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 0 10px #00eaff;
    margin: 0 auto;
}

#movies-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    transition: filter 0.3s ease; /* Smooth blur effect transition */
}

/* Movie container */
.movie-container {
    width: 150px;
    height: 300px;
    background: rgba(32, 32, 32, 0.8);
    border: 2px solid #00eaff;
    border-radius: 12px;
    box-shadow: 0 0 10px #00eaff;
    transition: transform 0.3s, box-shadow 0.3s;
    color: #c0c0c0;
    cursor: pointer;
    overflow: hidden;
    text-align: center;
}

.movie-container:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #00eaff;
}

.movie-container img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    transition: transform 0.3s;
    cursor: pointer;
}

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

.movie-container h3 {
    font-size: 1.1em;
    margin: 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 30px;
}

.movie-info {
    padding: 20px;
    position: relative;
    background: rgba(32, 32, 32, 0.9);
    border-radius: 12px;
    box-shadow: 0 0 15px #00eaff;
}

.close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    background: red;
    color: white;
    border: none;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px red;
}

.close-btn:hover {
    background: darkred;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    margin-top: 15px;
    max-width: 100%; /* Ensure iframe is responsive */
    max-height: 80vh; /* Limit iframe height */
    box-shadow: 0 0 15px #00eaff;
}

/* New Styling for Movie Overlay (when clicked) */
#movie-overlay {
    display: none; /* Initially hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Dark background */
    z-index: 999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

#movie-overlay iframe {
    width: 100%;
    height: 100%;
    max-width: 90%;
    max-height: 90%;
}

#movie-overlay.active {
    display: flex; /* Show overlay when active */
}

/* Blur effect for the background */
.blur-background {
    filter: blur(10px);
    pointer-events: none; /* Disable interaction with blurred content */
}

/* Media Queries */
@media (max-width: 1024px) {
    .search-box {
        width: 90%;
    }

    .movie-container {
        width: 140px;
        height: 270px;
    }

    h1 {
        font-size: 2em;
    }

    iframe {
        max-height: 60vh; /* Adjust iframe height on medium screens */
    }
}

@media (max-width: 768px) {
    .movie-container {
        width: 120px;
        height: 240px;
    }

    iframe {
        max-height: 60vh; /* Adjust iframe height on small screens */
    }

    h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .movie-container {
        width: 100px;
        height: 200px;
    }

    iframe {
        max-height: 55vh; /* Adjust iframe height on very small screens */
    }

    h1 {
        font-size: 1.5em;
    }
}
