/* --- 1. YOUR COMPLETE ORIGINAL DESIGN --- */
body { background-color: #0f0f0f; color: white; font-family: 'Segoe UI', sans-serif; margin: 0; overflow-x: hidden; }

nav { display: flex; justify-content: space-between; padding: 15px 5%; background: rgba(0,0,0,0.9); position: sticky; top: 0; z-index: 100; }
.logo span { color: #ff0000; font-weight: bold; }

.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.85);
    padding: 2px 10px;
    width: 280px;
    transition: width 0.3s ease;
    height: 35px;
    justify-content: space-between;
}

.search-icon-svg { color: white; margin-right: 10px; flex-shrink: 0; }
#search { 
    background: transparent !important; 
    border: none !important; 
    color: #000000 !important; /* Changed from white to black */
    outline: none !important; 
    width: 100%; 
    font-size: 0.85rem; 
    font-family: 'Segoe UI', sans-serif; 
    padding: 0 !important; 
}
#search::placeholder { color: #808080; font-weight: 400; }
.clear-icon { color: #ccc; font-size: 1.4rem; cursor: pointer; line-height: 1; margin-left: 5px; }
.clear-icon:hover { color: white; }

.row { padding: 20px 5% 0 5%; }
.row h2 { font-size: 1.4rem; margin-bottom: 10px; color: #e5e5e5; }
.movie-grid { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 20px; scroll-behavior: smooth; }
.movie-grid::-webkit-scrollbar { display: none; }

.movie-card { flex: 0 0 200px; cursor: pointer; transition: transform 0.3s; }
.movie-card:hover { transform: scale(1.1); z-index: 5; }
.movie-card img { width: 100%; border-radius: 4px; }

/* --- THE MODAL (With the Scroll Fix kept) --- */
.modal { display: none; position: fixed; z-index: 1000; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); overflow-y: auto; }
.netflix-details { background: #181818; width: 850px; max-width: 95%; margin: 30px auto; border-radius: 10px; position: relative; overflow: hidden; }
.details-banner { height: 450px; background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.banner-text { padding: 30px; width: 100%; background: linear-gradient(to top, #181818, transparent); }
.main-play-btn {
    display: inline-flex;         /* Keeps it inline so it doesn't take up the full width */
    align-items: center;
    justify-content: center;
    gap: 10px;
    
    background-color: #ffffff;    /* Clean white background */
    color: #000000;               /* Crisp black text */
    border: none;
    
    padding: 14px 36px;           /* Generous padding so it looks wide and premium */
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;           /* Clean, subtle rounded corners */
    cursor: pointer;
    
    /* POSITIONING AND ALIGNMENT CORRECTIONS */
    width: auto;                  /* Overrides any default full-width behavior */
    margin-top: 20px;             /* Pushes it safely down below the description paragraph */
    margin-left: 20px;
    margin-bottom: 15px;          /* Adds breathing room below the button */
    align-self: flex-start;       /* If the container uses flexbox, locks it strictly to the left */
    
    transition: background-color 0.2s ease;
}

/* Authentic premium hover interface fade */
.main-play-btn:hover {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

/* Active click feedback state */
.main-play-btn:active {
    transform: scale(0.98);
}
.details-body { padding: 30px; }
.episode-item { padding: 15px; border-bottom: 1px solid #333; cursor: pointer; }

/* Video Player Design */
.modal-content { width: 95%; max-width: 1100px; margin: 2% auto; position: relative; padding-top: 60px; }
iframe { width: 100%; aspect-ratio: 16/9; border: none; }
.server-list { background: #111; padding: 10px; display: flex; gap: 10px; border-bottom: 2px solid #ff0000; flex-wrap: wrap; }
.server-list button.active-server { background-color: #e50914 !important; color: white !important; border-color: #e50914 !important; font-weight: bold; }

.close, .close-details { 
    position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.6); 
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; font-size: 35px; cursor: pointer; z-index: 1100; 
    border: 2px solid #0f0000 !important; color: white !important; padding: 0; margin: 0;
}

/* Arrow Handles Design */
.row-container { position: relative; display: flex; align-items: center; }
.handle { 
    position: absolute; height: 100%; width: 4%; background: rgba(0, 0, 0, 0.5); 
    border: none; color: white; font-size: 2rem; z-index: 10; cursor: pointer; 
    opacity: 0; transition: opacity 0.3s, background 0.3s; 
}
.row-container:hover .handle { opacity: 1; }
.left-handle { left: 0; border-radius: 0 4px 4px 0; }
.right-handle { right: 0; border-radius: 4px 0 0 4px; }

/* Hero Section Design */
.hero { height: 80vh; color: white; background-size: cover; background-position: center center; display: flex; align-items: center; position: relative; margin-bottom: -50px; }
.hero::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, #0f0f0f 5%, transparent 70%); }
.hero-content { padding: 0 5%; max-width: 600px; z-index: 2; }
#hero-title { font-size: 4rem; margin-bottom: 0.5rem; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
#hero-overview { font-size: 1.2rem; line-height: 1.4; margin-bottom: 1.5rem; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.hero-buttons .play-btn { background: white; color: black; padding: 10px 30px; font-size: 1.2rem; font-weight: bold; border: none; border-radius: 4px; cursor: pointer; margin-right: 10px; }
.hero-buttons .info-btn { background: rgba(109, 109, 110, 0.7); color: white; padding: 10px 30px; font-size: 1.2rem; font-weight: bold; border: none; border-radius: 4px; cursor: pointer; }

/* --- READ MORE CLASSES --- */
.overview-collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more-btn { color: #b3b3b3; cursor: pointer; font-weight: bold; margin-top: 5px; display: block; }

/* Back Button */
.player-back-btn { position: absolute; top: 15px; left: 15px; background: rgba(0, 0, 0, 0.6); color: white; border: 1px solid rgba(255, 255, 255, 0.3); padding: 8px 15px; border-radius: 4px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; z-index: 1100; }

/* Visitor Text Wrapper */
.nav-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.visitor-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 10px;
}

/* --- THE NAV GRADIENT (Personalized Request) --- */
.nav { 
    position: fixed; top: 0; width: 100%; padding: 20px; z-index: 100; display: flex; justify-content: space-between; align-items: center; transition: background-color 0.5s ease-in;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 1.0) 0%, rgba(0, 0, 0, 1.0) 20%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0) 100%);
}

/* --- 2. THE RE-ADD OF ALL MOBILE RE-OPTIMIZATIONS --- */
@media screen and (max-width: 768px) {
    .nav { flex-direction: column !important; align-items: center; padding: 10px 0 !important; background: black; }
    .search-box { width: 90% !important; margin: 10px 0; }
    .hero { height: 50vh; }
    #hero-title { font-size: 2rem; }
    #hero-overview { display: none; }
    .movie-card { flex: 0 0 140px; }
    .netflix-details { width: 100% !important; margin: 0; border-radius: 0; }
}

/* Landscape Mode (sideways phone) */
@media screen and (max-width: 932px) and (orientation: landscape) {
    .nav { flex-direction: row !important; height: 50px !important; padding: 0 5% !important; }
    .nav-right { flex-direction: row !important; align-items: center !important; }
    .visitor-wrapper { display: none; }
    .search-box { width: 200px !important; height: 30px !important; }
}

/* Ensure the Search Results wrap into multiple rows */
#search-results {
    display: flex !important;
    flex-wrap: wrap !important; /* This is the "magic" line you are missing */
    gap: 20px;
    justify-content: center; /* Centers the cards on the screen */
    padding: 20px 5%;
    overflow-x: hidden !important; /* Prevents that annoying side-scrolling */
}

/* Make sure search cards have a set size so they grid properly */
.search-card {
    flex: 0 0 180px !important; /* Adjust this number to make posters bigger or smaller */
    margin-bottom: 20px;
}

/* Mobile adjustment for Search Results */
@media screen and (max-width: 768px) {
    #search-results {
        gap: 10px;
        justify-content: space-around;
    }
    .search-card {
        flex: 0 0 45% !important; /* Shows 2 posters side-by-side on mobile */
    }
}

/* --- 1. THE BEAUTIFUL SEASON SELECTOR --- */
.season-selector-container {
    margin: 25px 0;
    display: flex;
    align-items: center;
    gap: 15px; /* Adds nice space between 'Choose Season:' and the box */
}

#season-select {
    background-color: #141414; /* Darker, more premium feel */
    color: white;
    padding: 8px 12px;
    border: 1px solid #4d4d4d; /* Subtle border like the screenshot */
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

#season-select:hover {
    border-color: #b3b3b3;
}

/* --- 2. THE EPISODE LIST & RED NUMBERING --- */
.episodes-container {
    margin-top: 20px;
    border-top: 1px solid #404040; /* Thin, clean line */
}

.episode-item {
    padding: 18px 0; /* More vertical breathing room */
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.05); /* Very subtle hover highlight */
}

/* The specific Red Numbering you liked */
.ep-num {
    color: #e50914; /* Your signature Netflix Red */
    font-weight: 800; /* Bolder for impact */
    font-size: 1.1rem;
    margin-right: 15px;
    min-width: 25px; /* Keeps numbers aligned even when hitting 10+ */
    display: inline-block;
}

/* Episode Title text next to the number */
.ep-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 400;
}

/* --- 3. SEARCH RESULTS GRID (As requested before) --- */
#search-results {
    display: flex !important;
    flex-wrap: wrap !important; /* Forces grid layout */
    gap: 20px;
    padding: 30px 5%;
    justify-content: flex-start;
}

.search-card {
    flex: 0 0 180px !important;
    width: 100% !important;
}

/* --- PERFECT SEARCH GRID ALIGNMENT --- */
#search-results {
    display: grid !important;
    /* This forces the posters into a clean grid that fills the screen */
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 25px !important;
    padding: 40px 5% !important;
    justify-items: center; /* Centers each card inside its grid space */
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden !important;
}

/* Force all search cards to be uniform */
.search-card {
    width: 100% !important;
    max-width: 200px; /* Prevents posters from getting too huge on big screens */
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.search-card:hover {
    transform: scale(1.08);
    z-index: 10;
}

/* Ensure all images are the same height/width */
.search-card img {
    width: 100% !important;
    aspect-ratio: 2 / 3; /* Standard movie poster ratio */
    object-fit: cover; /* Crops images slightly so they all match perfectly */
    border-radius: 4px;
}

/* Mobile Alignment (2 posters per row) */
@media (max-width: 600px) {
    #search-results {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 20px 10px !important;
    }
}

/* 1. Add the 5% padding to the row to match Trending Now */
#continue-row {
    padding: 20px 5% 0 5% !important;
}

/* 2. Match the grid layout and remove the extra top/bottom padding that made it look "ugly" */
#continue-grid {
    display: flex !important;
    overflow-x: auto !important;
    gap: 10px !important;
    padding: 0 0 20px 0 !important; /* Matches your .movie-grid padding */
    scroll-behavior: smooth;
    width: 100%;
}

/* 3. Ensure the cards in Continue Watching are the exact same size as Trending Now */
#continue-grid .movie-card {
    position: relative !important;
    flex: 0 0 180px !important;
    height: 270px !important; /* Fixed height to match 2:3 ratio */
    background-color: #1a1a1a !important; /* Dark grey placeholder */
    border-radius: 4px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
/* 4. Ensure images follow the same border and ratio */
#continue-grid .movie-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* 5. Hide the scrollbar just like the other rows */
#continue-grid::-webkit-scrollbar {
    display: none !important;
}

/* --- PERFECT RED BOX LABELS --- */
#continue-grid .movie-card {
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.continue-label-box {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: #e50914 !important; /* Signature Red */
    color: white !important;
    padding: 6px 0 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    text-align: center !important;
    z-index: 10 !important;
    text-transform: uppercase !important;
    /* Added a top border to separate it from dark posters */
    border-top: 1px solid rgba(255,255,255,0.1) !important;
}

/* This prevents the text from appearing twice or outside the card */
#continue-grid .movie-card span, 
#continue-grid .movie-card div:not(.continue-label-box) {
    display: none !important;
}

#continue-grid .movie-card img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

#continue-row button:hover {
    color: white !important;
    text-decoration: underline;
}

#ph-top10 {
    display: flex;
    padding: 20px 0 20px 60px; /* Reduced left padding to match smaller numbers */
    gap: 40px;                 /* Consistent spacing between cards */
    overflow-x: auto;
    align-items: flex-end;
}

#ph-top10 .movie-card {
    position: relative;
    counter-increment: top10-counter;
    flex: 0 0 160px;           /* Fixed poster width */
    height: 240px;             /* Fixed poster height */
    z-index: 1;
}

#ph-top10 .movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

#ph-top10 .movie-card::before {
    content: counter(top10-counter);
    position: absolute;
    
    /* Position Adjustments */
    bottom: 0px;               /* Sits right on the bottom edge */
    left: -40px;               /* Pushed left so it only partially overlaps */
    
    /* HALF SIZE ADJUSTMENT */
    font-size: 70px;           /* Reduced from 160px/130px to roughly half */
    font-weight: 900;
    font-family: 'Arial Black', sans-serif;
    line-height: 1;
    
    /* Styling */
    color: #000;               /* Solid black center */
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.8); /* Thinner stroke for smaller size */
    
    z-index: -1;               /* Keeps it behind the image */
    letter-spacing: -4px;      /* Tightens double digits */
}

#ph-top10 .movie-card:nth-child(n+10)::before {
    font-size: 43px;      /* Smaller size so two digits fit in the same spot */
    left: -45px;          /* Slight nudge to the left for better centering */
    letter-spacing: -6px; /* Squeezes the '1' and '0' closer together */
    bottom: 5px;          /* Nudges it up slightly so it doesn't look too low */
}

.main-logo-img {
    height: 35px; /* Matches your search-box height for perfect alignment */
    width: auto;
    display: block;
    object-fit: contain;
}

/* Footer Visitor Alignment */
#footer-visitor {
    white-space: nowrap;
}

/* --- Optimized Mobile Navigation --- */
@media screen and (max-width: 768px) {
    nav { 
        flex-direction: row !important;
        align-items: center !important; 
        padding: 8px 12px !important; /* Slightly tighter padding to save width */
        background: rgba(0,0,0,0.95) !important;
        justify-content: space-between !important;
        gap: 8px; /* Adds a physical gap between the 3 main elements */
    }

    /* 1. The Logo */
    .main-logo-img {
        height: 28px !important; /* Shrunk slightly from 35px to free up space */
        width: auto;
    }

    /* 2. The Search Box */
    .search-box { 
        width: 110px !important; /* Reduced from 150px to prevent crowding */
        margin: 0 !important;
        height: 30px !important;
        flex-shrink: 1; /* Allows it to shrink if the screen is very narrow */
    }

    #search {
        font-size: 0.75rem !important; 
        padding: 4px 8px !important;
    }

    /* 3. The Get App Button */
    nav a[href="download.html"] {
        font-size: 0.65rem !important; /* Micro-text for professional look */
        padding: 4px 6px !important;
        white-space: nowrap; /* Keeps "Get App" on one line */
        border: 1px solid #e50914;
        border-radius: 4px;
        color: #e50914;
        text-transform: uppercase;
        font-weight: bold;
    }

    /* Standard mobile adjustments for content */
    .hero { height: 50vh; }
    #hero-title { font-size: 1.8rem; }
    #hero-overview { display: none; }
    .movie-card { flex: 0 0 130px; }
}

/* Very Small Phones (iPhone 13 mini or older) */
@media screen and (max-width: 380px) {
    .search-box {
        width: 90px !important;
    }
    .main-logo-img {
        height: 24px !important;
    }
}

/* Prevent Nav from overlapping Hero buttons */
nav {
    max-height: 80px; 
    pointer-events: none; /* Allows clicks to pass through the empty space of the nav */
}

nav a, nav .search-box, nav img {
    pointer-events: auto; /* Re-enables clicks for the actual buttons/links */
}

.hero-content {
    position: relative;
    z-index: 10; /* Lifts your Play/Info buttons above the background */
}

/* --- NEW GAME SECTION STYLES --- */
/* The actual Input Box with Magnifying Glass */
#game-search {
    width: 100%;
    padding: 15px;
    padding-right: 45px; /* Added space so text doesn't hit the icon */
    background: #0f0f0f; 
    border: none;
    color: white;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    font-size: 1.1rem;

    /* Add Magnifying Glass Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239d00ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center; /* Positions it 15px from the right */
}



/*software */
.category-header {
    background: linear-gradient(90deg, #1a1a1a, #252525) !important;
    color: #e50914; /* Instaflix Red */
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 25px !important;
    border-left: 4px solid #e50914; /* Red accent bar */
    pointer-events: none;
    margin-top: 15px;
}

/* Styling for Software Rows (Smaller & Clean) */
.software-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px; /* Thinner rows */
    background: #111;
    border-bottom: 1px solid #222;
    transition: 0.2s ease;
}

.software-info {
    font-size: 0.95rem; /* Smaller than header */
    color: #ccc; /* Slightly dimmed for better hierarchy */
    font-weight: 400;
}

.software-row:hover {
    background: #181818;
}

.software-row:hover .software-info {
    color: #fff;
}

/* Smaller, tighter download button to match the row */
.download-button {
    background-color: #e50914;
    color: white;
    text-decoration: none;
    padding: 6px 18px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* --- FIXED NAVIGATION STYLES --- */
.main-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 3%;
    background: rgba(0,0,0,0.95);
    position: sticky;
    top: 0;
    z-index: 1000; /* Increased to stay above all elements */
    gap: 10px;
    pointer-events: auto !important; /* FIXED: Ensures bar is clickable */
}

.nav-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.nav-links-group { display: flex; align-items: center; gap: 8px; }
.nav-center { display: flex; justify-content: center; flex: 1; }
.nav-right-search { display: flex; justify-content: flex-end; flex: 1; }

/* Navigation Items */
.nav-item {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-item:hover { color: #ff0000 !important; }

.nav-sep { color: #ff0000; font-weight: bold; font-size: 0.9rem; }

/* Get App Button */
/* --- THE SHINING GET APP BUTTON --- */
.get-app-btn {
    color: #ff0000;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.75rem;
    border: 1px solid #ff0000;
    padding: 5px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
    
    /* Animation settings */
    position: relative;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4); 
    animation: circlingRedShine 8s infinite ease-in-out;
}

/* --- SEARCH BAR ENHANCEMENTS --- */
.search-box-container {
    display: flex;
    align-items: center;
    background: #ffffff !important; /* White box */
    border: 1px solid #ccc;
    padding: 5px 12px;
    border-radius: 4px;
    width: 100%;
    max-width: 180px;
    min-width: 80px;
    cursor: text;
    
}

#search {
    background: transparent !important;
    border: none !important;
    color: #1a1a1a !important; /* Dark text you can actually see */
    font-size: 0.85rem;
    width: 100%;
    outline: none;
    margin-left: 8px;
    font-weight: 600;
}

.search-input {
    background: transparent !important;
    border: none !important;
    color: #1a1a1a !important; /* Dark gray/black so you can see it on white */
    font-size: 0.85rem;
    width: 100%;
    outline: none;
    margin-left: 8px;
    font-weight: 600; /* Makes the typed text a bit bolder and easier to read */
}

/* This fixes the "Search" placeholder text color so it's not too bright */
.search-input::placeholder {
    color: #757575 !important;
    font-weight: normal;
}

/* Magnifying Glass Icon */
.search-icon { 
    color: #000000 !important; /* Black icon */
    width: 18px !important; 
    height: 18px !important;
    flex-shrink: 0;
}

/* --- MOBILE ADJUSTMENT --- */
@media (max-width: 768px) {
    .search-box-container { 
        max-width: 110px; /* Scaled for mobile */
        padding: 4px 8px;
    }
    .search-icon {
        width: 15px !important;
        height: 15px !important;
    }
}
/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .main-navbar { padding: 8px 10px; }
    .nav-item { font-size: 0.65rem; }
    .main-logo-img { height: 20px; }
    .get-app-btn { font-size: 0.6rem; padding: 4px 8px; }
    .search-box-container { max-width: 150px; }
    .nav-links-group { gap: 5px; }
}

.donation-modal {
    position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center;
}
.donation-content {
    background: #111; padding: 30px; border-radius: 15px; border: 1px solid #ff0000;
    text-align: center; max-width: 350px; position: relative; color: white;
}
.qr-img { width: 220px; border-radius: 10px; margin: 15px 0; border: 4px solid white; }
.donation-content p { font-size: 0.85rem; color: #bbb; line-height: 1.4; }
.done-btn {
    margin-top: 15px; background: transparent; border: 1px solid #e1dcdc;
    color: #c9c3c3; padding: 8px 20px; border-radius: 5px; cursor: pointer; transition: 0.3s;
}
.done-btn:hover { border-color: #ff0000; color: white; }
.close-popup { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: #e1dcdc; }


/* Base styling for the Coffee Button */
.coffee-btn {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    transition: transform 0.2s ease;
    margin-left: 5px;
    
    /* Animation settings */
    border-radius: 8px; /* Para sumunod ang glow sa shape ng button */
    animation: coffeePulse 8s infinite ease-in-out; /* Pulse every 5 seconds */
}
.coffee-btn:hover {
    transform: scale(1.08);
}

.coffee-desktop {
    height: 30px; /* Adjust this value until it looks level with your text */
    width: auto;
    vertical-align: middle;
}

.coffee-mobile {
    display: none; /* Hidden on desktop */
    height: 28px;
    width: auto;
    vertical-align: middle;
}

/* Mobile View Adjustments */
@media (max-width: 768px) {
    .coffee-desktop {
        display: none;
    }
    .coffee-mobile {
        display: block; /* Shows only the small logo on mobile devices */
    }
    
    /* Optional: If nav links get too tight on mobile */
    .nav-links-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

.gcash-logo-container {
    text-align: center;
    margin-bottom: 5px; /* Space between logo and QR */
}

.gcash-logo-img {
    height: 40px; /* Adjust height as needed */
    width: auto;
}

.qr-img {
    width: 200px; /* Keeps the QR code a consistent size */
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

@media (max-width: 768px) {
    /* 1. Fix the Navbar Layout */
    .main-navbar {
        padding: 5px 10px;
        justify-content: space-between;
    }

    .nav-left {
        gap: 5px; /* Reduce gap between logo and links */
    }

    .nav-links-group {
        font-size: 0.7rem; /* Make text smaller to fit */
        gap: 5px;
    }

    .nav-sep {
        margin: 0 2px;
    }

    /* 2. Fix the Coffee Button size for iPhone 13 */
    .coffee-mobile {
        height: 24px; /* Slightly smaller to prevent pushing other items */
    }

    /* 3. Adjust the Search Bar to fit the remaining space */
    .nav-right-search {
        flex: 1;
        margin-left: 5px;
        min-width: 80px; /* Allow it to shrink if needed */
    }

    .search-box-container {
        max-width: 120px; 
        height: 30px;
        padding: 2px 8px;
    }

    /* 4. Fix the Get App button size */
    .get-app-btn {
        font-size: 10px;
        padding: 4px 8px;
        margin: 0 5px;
    }

    /* 5. Fix Continue Watching Grid for Mobile */
    .movie-grid {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
    }

    .movie-card {
        min-width: 130px; /* Forces cards to be a reasonable size on small screens */
    }
    
    .movie-card img {
        height: 190px; /* Adjust height for mobile aspect ratio */
    }
}

/* --- 1. CORE OVERFLOW FIX --- */
html, body { 
    max-width: 100%; 
    overflow-x: hidden; /* This kills the sideways scroll */
    position: relative;
}

/* --- 2. MOBILE-FIRST NAVIGATION --- */
.main-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 3%;
    background: rgba(0,0,0,0.95);
    position: fixed !important;
    top: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box; /* Ensures padding doesn't add to width */
}

/* Fix for the links group pushing the screen wide */
.nav-links-group { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-wrap: nowrap; /* Keeps items on one line, we shrink text instead */
}

/* --- 3. THE MOBILE MASTER OVERRIDE --- */
@media screen and (max-width: 768px) {
    /* Navbar: Reduce gaps to prevent overflow */
    .main-navbar { 
        padding: 8px 5px !important; 
        gap: 4px !important; 
    }
    
    .nav-left { gap: 4px !important; }
    .nav-links-group { gap: 3px !important; }

    /* Shrink text so it doesn't push the navbar out */
    .nav-item { font-size: 0.55rem !important; }
    .nav-sep { font-size: 0.55rem; margin: 0; }
    .main-logo-img { height: 20px !important; }
    .coffee-mobile { height: 20px !important; }

    /* The Search Box is usually what causes the scroll */
    .search-box-container { 
        max-width: 80px !important; /* Smaller to fit everything */
        flex-shrink: 1; 
        padding: 2px 4px !important;
    }

    #search { font-size: 0.65rem !important; }
    .get-app-btn { font-size: 0.5rem !important; padding: 3px 5px !important; }

    /* Ensure rows don't push the screen */
    .row { 
        padding: 15px 3% 0 3% !important; 
        width: 100%;
        box-sizing: border-box;
    }

    /* Keep movie cards from going off-screen before scroll kicks in */
    .movie-grid {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth mobile scroll */
    }
}

/* --- 4. TOP 10 OVERFLOW FIX --- */
#ph-top10 {
    display: flex;
    padding-left: 50px !important; /* Ensure enough room for the #1 number */
    width: 100%;
    box-sizing: border-box;
}

/* --- 5. SEARCH RESULTS GRID FIX --- */
/* --- SEARCH RESULTS GRID (Fixed for Desktop & Mobile) --- */
#search-results {
    display: grid !important;
    /* This automatically picks the best number of columns (5-6 on desktop) */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 25px !important;
    padding: 40px 5% !important;
    justify-items: center; 
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden !important;
}

/* Force cards to stay a consistent size so they don't stretch weirdly */
.search-card {
    width: 100% !important;
    max-width: 200px; 
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.search-card {
    width: 100% !important;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease;
    /* Remove any background or box-shadow that creates the gray box */
    background-color: transparent !important; 
    background: none !important;
    box-shadow: none !important;
}

/* Mobile Alignment (2 posters per row) */
@media (max-width: 600px) {
    #search-results {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 20px 10px !important;
    }

    /* FIX: Prevents cropping on mobile search cards */
.search-card img {
        aspect-ratio: auto !important; 
        object-fit: contain !important; 
        /* Ensure the image itself has no background */
        background-color: transparent !important;
        background: none !important;
        /* Optional: adds a little crispness to the edges */
        filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.5));
    }
    
    .search-card {
        max-width: 100%; /* Allows it to fill the half-screen width properly */
    }
}

.app-promo-overlay {
    position: fixed;
    z-index: 2000000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Darker for better focus */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
.app-promo-overlay {
    /* ... your existing styles ... */
    transition: opacity 0.5s ease-in-out;
}
}

.app-promo-box {
    background: #1a1a1a;
    border: 2px solid #e50914; /* Thicker red border */
    border-radius: 16px;
    padding: 30px;
    width: 85%;
    max-width: 340px;
    text-align: center;
    color: white;
    position: relative;
}

/* White X Button */
.app-promo-x {
    position: absolute;
    right: 15px; top: 10px;
    background: none; border: none;
    color: #ffffff; /* White color */
    font-size: 32px; 
    cursor: pointer;
    line-height: 1;
}

.app-promo-icon {
    width: auto;            /* Allow width to adjust naturally */
    height: 80px;          /* Set a fixed height that fits the box */
    max-width: 200px;      /* Prevent it from getting too wide */
    margin-bottom: 15px;
    object-fit: contain;   /* Scaled to fit without cropping */
    background: transparent; 
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.app-promo-btn {
    display: block;
    background: #e50914;
    color: white;
    text-decoration: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 20px;
    font-size: 16px;
}

/* More Visible Close Button */
.app-promo-close-visible {
    display: block;
    width: 100%;
    background: transparent;
    color: #ffffff;
    border: 1px solid #555; /* Subtle border to make it look like a button */
    padding: 10px;
    border-radius: 8px;
    margin-top: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
    font-weight: bold;
}

.app-promo-close-visible:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #888;
}

/* --- THE CIRCLING RED SHINE ANIMATION --- */
@keyframes circlingRedShine {
    0% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
        border-color: rgba(255, 0, 0, 0.5);
    }
    50% {
        /* This creates the intense "circling" glow effect */
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.9), 
                    0 0 25px rgba(255, 0, 0, 0.6), 
                    0 0 35px rgba(255, 0, 0, 0.3);
        border-color: rgba(255, 0, 0, 1);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
        border-color: rgba(255, 0, 0, 0.5);
    }
}

/* --- COFFEE BUTTON PULSE ANIMATION --- */
@keyframes coffeePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0px rgba(255, 221, 0, 0); /* No glow at start */
    }
    /* Ang pulse ay mangyayari sa gitna ng 5-second cycle */
    50% {
        transform: scale(1.05); /* Bahagyang lalaki ang button */
        box-shadow: 0 0 15px rgba(255, 221, 0, 0.7), /* Yellowish glow para sa coffee theme */
                    0 0 25px rgba(255, 221, 0, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0px rgba(255, 221, 0, 0);
    }
}

/* --- PREMIUM NETFLIX-RED CIRCLE CLOSE BUTTONS --- */
.close-details, #player-modal .close {
    background-color: #e50914 !important; /* Signature Netflix Red */
    color: #ffffff !important;            /* Crisp White X */
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;        /* Forces a perfect circle geometry */
    opacity: 1 !important;                /* Makes it completely solid and visible */
    
    /* Absolute Positioning over the poster/canvas */
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;             /* Ensures it sits safely on top of all images */
    
    /* Perfect Center Alignment Mechanics */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Typography & Icon Centering Tweaks */
    font-size: 24px !important;
    font-weight: bold !important;
    line-height: 0 !important;            /* Eliminates default font line heights pushing the X down */
    padding-bottom: 4px !important;       /* Subtle pixel adjustment because the '×' glyph naturally floats high */
    
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease !important;
}

/* Hover Micro-Interaction */
.close-details:hover, #player-modal .close:hover {
    background-color: #b20710 !important; /* Sleek darker red when hovered */
    transform: scale(1.1) !important;     /* Smoothly pops out slightly */
}

/* --- OVERHAULED PLAYER CONTROLS & NAVIGATION --- */
#tv-controls {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 600px;
    margin: 15px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

/* Force dark premium styling, overriding browser defaults */
#tv-controls button {
    flex: 1;
    min-width: 0;
    padding: 12px 6px !important; /* Slightly taller for easy mobile tapping */
    font-size: 0.8rem !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    background-color: #1a1a1a !important; /* True dark background */
    color: #ffffff !important;            /* Crisp white text */
    border: 1px solid #333333 !important; /* Subtle border */
    border-radius: 6px !important;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    transition: background-color 0.2s, border-color 0.2s;
}

/* Hover/Active highlight for the navigation buttons */
#tv-controls button:hover, 
#tv-controls button:active {
    background-color: #262626 !important;
    border-color: #e50914 !important; /* Signature Red */
}

/* Give the Episode List button a distinct dark accent */
#tv-controls #ep-list-btn {
    background-color: #222222 !important;
    border-color: #444444 !important;
}
#tv-controls #ep-list-btn:hover {
    background-color: #e50914 !important;
    border-color: #e50914 !important;
}

/* --- OVERHAULED SERVER CONTAINER --- */
.server-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 25px auto 15px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

/* Fixes the text smashing against the buttons */
.server-notice-text {
    font-size: 0.8rem;
    color: #b3b3b3;
    text-align: center;
    margin: 0 0 14px 0;
    line-height: 1.4;
    width: 100%;
}

.notice-icon {
    margin-right: 4px;
}

/* Container specifically holding the "SELECT SERVER:" label and the actual buttons */
.server-inner-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.server-label {
    font-size: 0.75rem;
    color: #8c8c8c;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
    display: block;
    width: 100%; /* Centers label on top of buttons on mobile */
    text-align: center;
    margin-bottom: 4px;
}

/* Base style for server individual buttons */
.server-btn {
    background-color: #1a1a1a !important;
    color: #cccccc !important;
    border: 1px solid #333333 !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-weight: bold;
    cursor: pointer;
    min-width: 90px;
    text-align: center;
    transition: all 0.2s ease;
}

.server-btn:hover {
    background-color: #262626 !important;
    border-color: #555555 !important;
    color: #ffffff !important;
}

/* Highlight Selected Active Server */
.server-btn.active, 
.server-list button.active-server {
    background-color: #e50914 !important;
    border-color: #e50914 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

/* --- RESPONSIVE TWEAKS FOR PHONE SCREENS --- */
@media (max-width: 480px) {
    #tv-controls {
        gap: 6px;
        padding: 0 8px;
    }
    
    #tv-controls button {
        font-size: 0.75rem !important;
        padding: 10px 4px !important;
    }

    .server-inner-row {
        gap: 8px;
    }

    .server-btn {
        flex: 1; /* Allows buttons to share the row evenly on mobile screens */
        min-width: 40px;
        padding: 8px 3px !important;
        font-size: 0.7rem !important;
    }
}

/* Prevents automatic zoom-on-focus for form inputs on mobile */
input, select, textarea {
    font-size: 16px !important;
}

.hide-chat {
    display: none !important;
}

/* Popup Overlay background */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Keeps it above everything else */
    backdrop-filter: blur(3px);
}

/* Small styled container box */
.custom-popup-box {
    background: #181818;
    border: 1px solid #333;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-family: 'Segoe UI', sans-serif;
}

.custom-popup-box h4 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 1.15rem;
}

.custom-popup-box p {
    color: #b3b3b3;
    font-size: 0.88rem;
    line-height: 1.4;
    margin: 0 0 20px 0;
}

/* Flex layout for the actions buttons row */
.custom-popup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Action button styles */
.custom-popup-actions button {
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.popup-btn-cancel {
    background: #333;
    color: #fff;
}

.popup-btn-cancel:hover {
    background: #444;
}

.popup-btn-confirm {
    background: #e50914; /* Streaming red brand color */
    color: #fff;
}

.popup-btn-confirm:hover {
    background: #b80710;
}

/* Ultra-Slim & Clean Red Support Banner Container */
.support-banner-container {
    /* Changed background to RGBA format with 0.9 opacity */
    background: linear-gradient(90deg, rgba(220, 25, 36, 0.9) 0%, rgba(128, 5, 11, 0.9) 100%);
    width: 100%;
    padding: 4px 0;             /* Padding handled internally now */
    height: 32px;
    display: flex;
    justify-content: center;    /* Centers the inner block content */
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    animation: fadeInDown 0.5s ease-out;
}

/* New inner wrapper to pull elements away from the screen edge */
.banner-inner-content {
    width: 90%;
    max-width: 1100px;          /* Matches the max-width of your Chat Lounge layout */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.banner-content-left {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent !important;
    box-shadow: none !important;
}

.banner-icon {
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.banner-text {
    color: #ffffff;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1px;
    line-height: 1;
    background: transparent !important;
    box-shadow: none !important;
}

.banner-content-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Slim, Low-Profile Donate Button */
.banner-donate-btn {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.banner-donate-btn:hover {
    background: #e6e6e6;
}

/* Compact Close Icon Button */
.banner-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.banner-close-btn:hover {
    color: #ffffff;
}

/* Smooth entry animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for mobile screens */
/* Responsive adjustments for mobile screens (Two-Line Layout) */
/* Perfect 2-Line Mobile View Adjustment */
@media (max-width: 600px) {
    .support-banner-container {
        height: auto !important;
        padding: 8px 10px !important;
    }

    /* Force the new inner container to stack vertically in exactly 2 rows */
    .banner-inner-content {
        width: 100% !important;
        flex-direction: column !important;
        gap: 6px !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* LINE 1: Keep icons and text perfectly inline horizontally */
    .banner-content-left {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        gap: 4px !important;
    }

    .banner-text {
        font-size: 0.69rem !important;
        white-space: nowrap !important; /* Forces the entire sentence to stay on one line */
        text-align: center !important;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .pulsing-heart-icon,
    .banner-content-left img {
        width: 12px !important;
        height: 12px !important;
    }

    /* LINE 2: Keep Donate Button and 'X' inline horizontally right below */
    .banner-content-right {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        gap: 14px !important; /* Space between Donate button and 'X' */
    }

    .banner-donate-btn {
        padding: 2px 14px !important;
        font-size: 0.75rem !important;
        height: 22px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .banner-close-btn {
        font-size: 1rem !important;
        display: inline-flex !important;
        align-items: center !important;
    }
}


/* Remove browser focus ring on video elements and containers */
video,
video:focus,
video:focus-visible,
video:active,
.iframe-container,
.iframe-container:focus,
.iframe-container:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.iframe-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9 !important; /* Locks container to standard widescreen height */
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-player {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Keeps 4:3 video centered with black bars on sides */
}

