/* General Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #141414; /* Deep dark background */
    color: #EAEAEA; /* Light text color */
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Header Styling --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #1F1F1F;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: #E50914; /* Netflix Red accent */
}

/* Desktop Navigation */
.nav-links {
    display: flex; /* Ensure horizontal layout on desktop */
    align-items: center;
}

.nav-links a {
    margin-left: 25px;
    font-size: 1.1em;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #E50914;
}

.menu-toggle {
    display: none; /* Hide on desktop, shown in mobile media query */
    background: none;
    border: none;
    color: #EAEAEA;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0; /* Clean up padding */
}

/* --- Hero Section Styling --- */
.hero-section {
    /* Always ensure a fallback color for the background */
    background: #000 url('hero-bg.jpg') center/cover no-repeat; 
    background-blend-mode: multiply; /* Helps darkening the image */
    background-color: rgba(0, 0, 0, 0.7); /* Darkening layer */
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: 2.5em;
    margin-bottom: 25px;
}

.slider-bg-blur {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(50px) brightness(0.3);
    z-index: 1;
}

/* Search Box Styling */
.search-box {
    display: flex;
    width: 100%;
    max-width: 500px;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.search-input {
    flex-grow: 1;
    padding: 15px 20px;
    border: none;
    font-size: 1em;
    outline: none;
    background-color: #2D2D2D;
    color: #EAEAEA;
}

.search-button {
    padding: 15px 20px;
    background-color: #E50914;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #F40F1F;
}

/* --- Movie Grid and Cards --- */
.movie-section {
    padding: 40px 5%;
}

.section-title {
    font-size: 2em;
    margin-bottom: 30px;
    border-left: 5px solid #E50914;
    padding-left: 15px;
}

.movie-grid {
    display: grid;
    /* Default: 2 columns for smaller screens */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 20px;
    /* Forces cards to fill the available height in their grid cell */
    grid-auto-rows: 1fr; 
}

.movie-card {
    background-color: #1F1F1F;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    /* Display flex column to push the movie-info to the bottom of the card */
    display: flex;
    flex-direction: column;
    height: 100%; /* Important for grid-auto-rows: 1fr to work */
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.4);
}

/* Aspect Ratio Container for Poster */
.movie-poster-container {
    position: relative;
    width: 100%;
    /* 150% padding-top creates a 2:3 poster aspect ratio (standard movie poster) */
    padding-top: 150%; 
    overflow: hidden;
}

/* The image fills the container */
.movie-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    display: block;
    object-fit: cover; /* Ensures image covers the area without distorting */
}

.movie-info {
    padding: 15px;
    /* Pushes the info block to the bottom of the card, accommodating variable image heights */
    margin-top: auto; 
}

.movie-info h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-info p {
    font-size: 0.9em;
    color: #A0A0A0;
}

footer{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55px;
  display: flex;
  justify-content: center;
  background-color: #393E46;
  align-items: center;
  z-index: 999;
  gap: 15px;
  
}
footer img{
  margin-left: 18px;
  height: 45px;
  width: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease-in-out;
  
}
footer img:hover{
  background-color: rgb(151, 151, 150);
}

/* Desktop and Larger Tablets */
@media (min-width: 768px) {
    .movie-grid {
        /* Larger screens: 4 columns */
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    }
    
    .hero-title {
        font-size: 3.5em;
    }
}

/* Mobile and Smaller Tablets */
@media (max-width: 767px) {
    /* --- Header & Navigation for Mobile --- */
    .main-header {
        /* Allow logo and toggle button to sit on the first line, menu below */
        flex-wrap: wrap; 
        padding: 15px 5%;
    }

    .nav-links {
        /* Overriding desktop display:flex */
        display: none; 
        width: 100%; 
        flex-direction: column;
        text-align: center;
        padding-top: 10px;
        background-color: #1F1F1F;
    }
    
    .nav-links a {
        margin: 10px 0;
        padding: 10px;
        margin-left: 0; /* Remove left margin for block display */
        border-bottom: 1px solid #2d2d2d;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .menu-toggle {
        display: block; /* Show the hamburger icon */
    }
    
    /* JavaScript will add the 'active' class to show the menu */
    .nav-links.active {
        display: flex; /* Show the navigation links stacked vertically */
    }

    /* --- Other Mobile Adjustments --- */
    .hero-section {
        height: 50vh;
    }

    .hero-title {
        font-size: 2em;
    }

    .search-box {
        max-width: 90%;
    }

    .section-title {
        font-size: 1.5em;
    }

    .movie-grid {
        /* Make columns slightly smaller on very small screens */
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    }
}

/* Header Search Adjustment */
.logo-group { display: flex; align-items: center; gap: 20px; flex-grow: 1; }
.header-search { max-width: 250px; height: 35px; border-radius: 5px; }
.header-search .search-input { padding: 5px 10px; font-size: 0.9em; }

/* 1. Force the Hero Section to have a physical size */
.hero-slider-section {
    position: relative !important;
    width: 100% !important;
    height: 500px !important; /* Adjust this to your liking */
    background: #000 !important;
    overflow: hidden !important;
    display: block !important;
}

/* 2. Force the Background Blur to appear */
#sliderBg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
    filter: blur(40px) brightness(0.4) !important;
    z-index: 1 !important; /* Lowest layer */
    display: block !important;
    transition: background-image 1s ease-in-out, opacity 1s ease-in-out !important;
}

/* Ensure the slider container actually occupies space */
.slider-content {
    position: relative !important;
    width: 100% !important;
    height: 100% !important; /* This uses the 60vh from the hero section */
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Force sharp image to be visible */
#sliderImg {
    max-height: 80% !important;
    width: auto !important;
    z-index: 5;
    position: relative;
    opacity: 1 !important;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out !important;
}
/* 5. Ensure text is on the very top */
.slider-overlay {
    position: absolute !important;
    bottom: 10% !important;
    left: 5% !important;
    z-index: 10 !important; /* Highest layer */
}
#movieRating {
    color: #f5c518; /* IMDb Yellow */
    font-weight: 700;
    font-size: 1.1rem;
}

/* PLAY BUTTON STYLING */
.play-btn-circle {
    display: flex;
    width: 60px;
    height: 60px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    margin-top: 15px;
    transition: 0.3s;
    position: relative;
}

.play-btn-circle:hover {
    background: #E50914;
    color: #fff;
    transform: scale(1.1);

}
.req-link {
    display: inline-block;
    background: #0088cc;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 5px;
    transition: 0.3s;
}

.req-link:hover {
    background: #006699;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.filter-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 5px;
    margin-bottom: 10px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.filter-bar::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome */

.filter-chip {
    white-space: nowrap;
    background: #222;
    color: #888;
    border: 1px solid #333;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
}

.filter-chip.active {
    background: #0088cc;
    color: white;
    border-color: #0088cc;
}

.top10-wrapper { display: flex; gap: 40px; overflow-x: auto; padding: 20px 60px; scrollbar-width: none; }
.top10-wrapper::-webkit-scrollbar { display: none; }
.top10-card { position: relative; flex: 0 0 140px; height: 210px; }
.rank-num { 
    position: absolute; left: -45px; bottom: -15px; 
    font-size: 110px; font-weight: 900; z-index: -1; 
    font-family: 'Arial Black', sans-serif; color: #121212;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.6);
}

/* WATCHLIST BUTTON (HEARTS) */
.movie-poster-container { position: relative; }
.watchlist-btn {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.6); border: none; color: #e50914;
    width: 35px; height: 35px; border-radius: 50%;
    cursor: pointer; z-index: 10; transition: 0.3s;
}
.watchlist-btn:hover { background: #e50914; color: white; transform: scale(1.1); }

/* FILTER CHIPS */
.filter-bar { display: flex; gap: 10px; overflow-x: auto; padding: 15px 5px; margin-bottom: 20px; }
.filter-chip { 
    white-space: nowrap; background: #222; color: #888; border: 1px solid #333;
    padding: 8px 18px; border-radius: 20px; cursor: pointer; transition: 0.3s;
}
.filter-chip.active { background: #0088cc; color: white; border-color: #0088cc; }

.hidden { display: none; }


/* --- STICKY HEADER --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- SKELETON SHIMMER EFFECT --- */
.skeleton {
    background: #1a1a1a;
    background-image: linear-gradient(90deg, #1a1a1a 0px, #2a2a2a 40px, #1a1a1a 80px);
    background-size: 600px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.navbar {
    z-index: 9999 !important;
    position: fixed;
    top: 0;
}
