/* --- 1. Variables & Base --- */
:root {
    --primary: #007bff;
    --accent: #00d4ff;
    --bg: #0b0f1a;
    --card-bg: #161e2e;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --container-width: 1200px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent side-scrolling on mobile */
}

/* --- 2. Layout Utility --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px; /* Standard 20px padding for mobile */
}

/* --- 3. Responsive Header --- */
header {
    padding: 15px 0;
    border-bottom: 1px solid #1e293b;
    position: sticky;
    top: 0;
    background: rgba(11, 15, 26, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.3rem; font-weight: 800; }
.logo span { color: var(--primary); }

.nav-links { display: none; } /* Hide menu on mobile by default */

/* --- 4. Hero Section (Mobile First) --- */
.hero {
    padding: 60px 20px;
    text-align: center;
}

.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero p { color: var(--text-dim); margin-bottom: 30px; }

.search-bar {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 50px; /* Rounded pill for better thumb-feel */
    border: 1px solid #334155;
    background: var(--card-bg);
    color: white;
}

/* --- 5. Responsive Grid (The Magic) --- */
.pack-grid {
    display: grid;
    /* 1 column on mobile, 2 on tablet, 3-4 on desktop */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

/* --- 6. Pack Cards --- */
.pack-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9; /* Keeps images consistent */
    background: #243049;
}

.pack-info { padding: 15px; flex-grow: 1; }

.download-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
}

/* --- 7. MEDIA QUERIES (Handling Larger Devices) --- */

/* For Tablets (768px and up) */
@media (min-width: 768px) {
    .hero h1 { font-size: 3rem; }
    .nav-links { display: flex; list-style: none; gap: 20px; }
    .nav-links a { color: var(--text); text-decoration: none; font-size: 0.9rem; }
}

/* For Laptops/Desktops (1024px and up) */
@media (min-width: 1024px) {
    .pack-grid { gap: 30px; }
    .hero { padding: 100px 0; }
}


/* Download Page Specifics */
.download-container {
    max-width: 800px;
    margin: 40px auto;
    text-align: center;
}

.ad-placeholder {
    background: #1e293b;
    border: 1px dashed #334155;
    padding: 20px;
    margin: 20px 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.pack-details {
    text-align: left;
    margin-bottom: 30px;
}

.pack-details h1 { margin-bottom: 20px; }

.description {
    margin-top: 20px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
}

.hidden {
    display: none !important;
}

#wait-message {
    font-weight: bold;
    color: var(--accent);
    padding: 20px;
}   



/* 1. Reset HTML and Body to full height */
html, body {
    height: 100%;
    margin: 0;
}

/* 2. Turn Body into a Flex Container */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Viewport Height */
}

/* 3. Tell the Main section to take all available space */
main {
    flex: 1; /* This pushes the footer to the bottom */
}

/* 4. Footer Styling */
footer {
    text-align: center;
    padding: 30px 20px;
    background: #0f172a;
    border-top: 1px solid #1e293b;
    color: var(--text-dim);
    font-size: 0.8rem;
}
.ad-placeholder {
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* This prevents ads from pushing the page to the side */
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

/* By default, hide the mobile ad (for PC view) */
.mobile-ad {
    display: none;
}

/* By default, show the desktop ad */
.desktop-ad {
    display: block;
    text-align: center;
}

/* MOBILE FIX: When screen is smaller than 768px */
@media (max-width: 768px) {
    .desktop-ad {
        display: none; /* Hide the big PC banner */
    }
    .mobile-ad {
        display: block; /* Show the small mobile banner */
        text-align: center;
        width: 100%;
    }
    
    /* Prevent any accidental overflow */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }
}


.category-bar {
    display: flex;
    overflow-x: auto; /* Allows swiping left/right on mobile */
    gap: 12px;
    padding: 15px 5px;
    white-space: nowrap; /* Prevents buttons from jumping to the next line */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iPhone */
    scrollbar-width: none; /* Hides ugly scrollbar on Firefox */
}

/* Hides scrollbar for Chrome/Safari */
.category-bar::-webkit-scrollbar {
    display: none; 
}

.filter-btn {
    background: #1e293b; /* Dark card color */
    color: #94a3b8; /* Dimmed text */
    border: 1px solid #334155;
    padding: 8px 22px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #334ee7; /* Your Blue color */
    color: white;
    border-color: #334ee7;
    box-shadow: 0 4px 10px rgba(51, 78, 231, 0.3);
}

.category-bar {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 20px 0; /* Add more padding to push the grid down */
    margin-bottom: 10px; /* Force space between bar and grid */
    position: relative; /* Ensures it stays in the normal document flow */
    z-index: 10; /* Keeps it "above" the cards visually */
    width: 100%;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

/* Ensure the grid doesn't overlap */
.movie-grid, .pack-grid {
    clear: both; /* Prevents floating elements from overlapping */
    display: grid;
    margin-top: 10px;
}




.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
}

.page-btn {
    background: #161e2e;
    color: white;
    border: 1px solid #334155;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.page-btn:hover {
    border-color: #334ee7;
}

/* The style for the active/current page number */
.page-number.active {
    background: #334ee7;
    border-color: #334ee7;
}

.page-number {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    background: #161e2e;
    cursor: pointer;
    border: 1px solid #334155;
}


/* --- New Episode Grid Styling --- */
.episode-grid {
    display: grid;
    /* This creates the grid: 3-4 buttons per row on mobile, more on PC */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin: 25px 0;
    width: 100%;
}

.episode-btn {
    display: block;
    width: 100%;
    background: #1e293b; /* Matches your card color */
    color: #ffffff;
    padding: 12px 5px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #334155;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s ease;
}

/* State: While the 10s timer is running */
.episode-btn.loading {
    background: #161e2e;
    color: #94a3b8;
    cursor: not-allowed;
    border-style: dashed;
}

/* State: When timer hits 0 and it becomes a Download Link */
.episode-btn.download-ready {
    background: #334ee7; /* Your primary blue */
    border-color: #334ee7;
    box-shadow: 0 0 15px rgba(51, 78, 231, 0.4);
}

/* Single Download Area Fix */
#single-download-area {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}




