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

body {
    font-family: 'Inter', sans-serif;
    background-color: #141414;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0));
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 95%;
    padding: 0 20px;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e50914;
}

.logo span {
    letter-spacing: -1px;
}

.logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav {
    display: flex;
    gap: 1.5rem;
    margin-left: 2rem;
    flex-grow: 1;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s, opacity 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    opacity: 0.8;
}

.search-container {
    position: relative;
    width: 60%;
    max-width: 600px;
    margin: 0.5rem auto;
    order: 2;
}

.search-input {
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid #444;
    border-radius: 25px;
    padding: 0.75rem 3rem 0.75rem 1.5rem;
    color: #ffffff;
    width: 100%;
    font-size: 1.1rem;
    transition: width 0.3s ease-in-out, background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.search-input:focus {
    width: 100%;
    background-color: #333;
    border-color: #e50914;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-icon {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

.main {
    padding-top: 10rem;
    margin-top: 0;
}

.hero {
    background-image: linear-gradient(to top, rgba(20, 20, 20, 1) 0, rgba(20, 20, 20, 0) 50%, rgba(20, 20, 20, 1) 100%), url('./hero_background.png');
    background-size: cover;
    background-position: center center;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 5%;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, #141414, transparent);
}

.hero-content {
    max-width: 50%;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    color: #fff;
}

.hero-content p {
    font-size: 1.4rem;
    color: #ffffff;
    font-weight: 400;
    max-width: 600px;
}

.cta-button {
    display: inline-block;
    background-color: #e50914;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 1.5rem;
}

.cta-button:hover {
    background-color: #ff0000;
    transform: scale(1.05);
}

.content-section {
    padding: 3rem 0;
    margin-top: -100px;
    position: relative;
    z-index: 10;
}

.featured-section {
    padding: 3rem 0;
    display: none; /* Hiding old section */
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #e5e5e5;
    font-weight: 600;
}

.movies-grid, .content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.movie-card {
    background: #181818;
    border-radius: 8px; /* Slightly larger border-radius for a smoother look */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s;
    cursor: pointer;
    display: flex; /* Use flexbox for centering content */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    text-align: center;
    padding: 1rem; /* Add some padding */
    min-height: 270px; /* Ensure cards have a consistent minimum height */
    position: relative; /* Needed for z-index on hover */
    border: 1px solid #282828; /* Subtle border */
}

.movie-card:hover {
    transform: translateY(-5px) scale(1.02); /* Slight lift and scale on hover */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6); /* More prominent shadow */
    z-index: 100;
    border-color: #e50914; /* Highlight border on hover */
}

.movie-title-display {
    color: #e5e5e5;
    word-wrap: break-word; /* Allow long titles to wrap */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5; /* Limit to 5 lines for long titles */
    -webkit-box-orient: vertical;
}

.movie-title-display .movie-title {
    font-size: 1.5rem; /* Make title bigger */
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3; /* Adjust line height for readability */
}

.movie-title-display .movie-year {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.movie-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #e5e5e5;
}

.movie-year {
    color: #a0a0a0;
    font-size: 0.8rem;
}

.content-count {
    font-size: 1.2rem;
    color: #a0a0a0;
    font-weight: 400;
    margin-left: 0.75rem;
}

.movie-count {
    font-size: 1rem;
    color: #cccccc;
    margin-left: 0.5rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: 2% auto;
    width: 80%;
    max-width: 1100px;
    height: 85vh;
}

.close {
    position: absolute;
    right: 15px;
    top: -45px;
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.close:hover {
    color: #e50914;
}

#moviePlayer {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.footer {
    background: #141414;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid #222;
    margin-top: 4rem;
    color: #808080;
}

.footer-cta-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-cta-buttons .cta-button {
    margin: 0; /* Override default margin from .cta-button */
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

.tv-modal-content {
    background-color: #1a1a1a;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    position: relative;
}

.close-tv {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-tv:hover {
    color: #e50914;
}

.tv-show-title {
    color: #fff;
    margin-bottom: 30px;
    font-size: 2rem;
}

.season {
    margin-bottom: 30px;
}

.season-title {
    color: #e5e5e5;
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.episode-btn {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}

.episode-btn:hover {
    background-color: #e50914;
    border-color: #e50914;
}

@media (max-width: 768px) {
    .header {
        background: #141414;
    }
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        order: 3;
        gap: 1rem;
        justify-content: center;
        width: 100%;
        margin-left: 0;
    }

    .search-container {
        width: 90%;
        margin-top: 1rem;
    }
    
    .search-input {
        width: 100%;
        font-size: 1rem;
        padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    }
    .search-input:focus {
        width: 100%;
    }
    
    .search-icon {
        right: 1rem;
        font-size: 1rem;
    }
    
    .movies-grid, .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Adjust minmax for smaller screens */
        gap: 0.75rem; /* Slightly larger gap */
    }

    .movie-card {
        min-height: 200px; /* Adjust min height for smaller screens */
        padding: 0.75rem;
    }

    .movie-title-display .movie-title {
        font-size: 1.2rem; /* Adjust title size for smaller screens */
    }

    .movie-title-display .movie-year {
        font-size: 0.9rem;
    }

    .hero {
        height: 60vh;
    }

    .hero-content {
        max-width: 80%;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .tv-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
    
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .episode-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .footer-cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}