/* ... [Keep your existing CSS variables at the top] ... */
:root {
    --bg: #050816;
    --bg-elevated: #0b1020;
    --bg-soft: #141a2a;
    --accent: #6366f1;
    --accent-soft: rgba(99, 102, 241, 0.1);
    --accent-strong: #4f46e5;
    --accent-danger: #f97373;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-subtle: rgba(148, 163, 184, 0.25);
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.6);
    --radius-lg: 18px;
    --radius-full: 999px;
    --nav-height: 64px;
}

* { box-sizing: border-box; }

/* FIX: Kill the white bar on mobile overscroll */
html {
    background-color: #000; 
    height: 100%;
}

body {
    margin: 0; padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #111827 0, #020617 50%, #000 100%);
    color: var(--text-main);
    min-height: 100%;
    /* Ensure body fills screen */
    display: flex; 
    flex-direction: column;
}

/* Make app-shell grow to push footer down */
.app-shell {
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
}

main {
    flex: 1; /* This pushes the footer to the bottom */
}

/* ... [Keep all your existing Navbar, Hero, Card styles here] ... */

/* [Existing styles for .hero, .card, etc...] */
.navbar {
    height: var(--nav-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    background: rgba(5, 8, 22, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky; top: 0; z-index: 50;
}
.nav-left { display: flex; align-items: center; gap: 40px; }
.logo-pill { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-dot { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.logo-text-main { font-weight: 700; font-size: 18px; color: #fff; line-height: 1.2; }
.logo-text-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.nav-links { display: flex; gap: 8px; background: var(--bg-soft); padding: 4px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 13px; font-weight: 500; padding: 6px 16px; border-radius: var(--radius-full); transition: all 0.2s ease; }
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.nav-links a.nav-active { background: var(--bg-elevated); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); border: 1px solid var(--border-subtle); }

.hero { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 24px; max-width: 1200px; margin: 40px auto; padding: 0 24px; }
.hero-main-card {
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    border-radius: 24px; padding: 48px; position: relative; overflow: hidden;
    box-shadow: var(--shadow-soft); display: flex; flex-direction: column; justify-content: center;
}
.hero-title { font-size: 32px; font-weight: 700; margin: 0 0 12px; background: linear-gradient(to right, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 15px; color: var(--text-muted); margin: 0 0 32px; max-width: 400px; line-height: 1.5; }

.search-box-row { display: flex; gap: 12px; position: relative; z-index: 2; }
.input-wrapper { position: relative; flex: 1; display: flex; align-items: center; }
.search-input { width: 100%; background: var(--bg-soft); border: 1px solid var(--border-subtle); padding: 14px 16px; border-radius: 14px; color: #fff; font-size: 15px; transition: 0.2s; }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.select-wrapper { position: relative; }
.search-select { appearance: none; background: var(--bg-soft); border: 1px solid var(--border-subtle); color: #fff; padding: 0 36px 0 16px; height: 100%; border-radius: 14px; font-size: 14px; cursor: pointer; }
.search-button { background: var(--accent); color: #fff; border: none; padding: 0 24px; border-radius: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.search-button:hover { background: var(--accent-strong); }

.hero-side-card { background: linear-gradient(145deg, var(--bg-soft), var(--bg-elevated)); border-radius: 24px; border: 1px solid var(--border-subtle); padding: 32px; }
.hero-side-title { font-size: 18px; font-weight: 600; margin: 0 0 12px; color: #fff; }
.hero-side-sub { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 0 0 24px; }
.hero-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 11px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-subtle); padding: 6px 12px; border-radius: 8px; color: var(--text-muted); }

.section-title-row { display: flex; justify-content: space-between; align-items: baseline; max-width: 1200px; margin: 0 auto 20px; padding: 0 24px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto 60px; padding: 0 24px; }
.card { background: var(--bg-elevated); border-radius: 20px; border: 1px solid var(--border-subtle); overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; position: relative; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); border-color: var(--accent); }
.card-poster-wrapper { aspect-ratio: 2/3; overflow: hidden; background: #000; position: relative; }
.card-poster-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.4s ease; }
.card:hover .card-poster-wrapper img { scale: 1.05; }
.card-content { padding: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 13px; color: var(--text-muted); }

.detail-layout { display: grid; grid-template-columns: 300px 1fr; gap: 40px; max-width: 1100px; margin: 40px auto; padding: 0 24px; }
.detail-poster { border-radius: 24px; overflow: hidden; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-soft); aspect-ratio: 2/3; }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: 42px; font-weight: 800; margin: 0 0 16px; line-height: 1.1; background: linear-gradient(to bottom right, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tagline { font-size: 18px; color: var(--accent); font-style: italic; margin-bottom: 24px; display: block; }
.overview-text { line-height: 1.7; color: #cbd5e1; font-size: 16px; margin-bottom: 30px; }

.ai-output { background: rgba(30, 41, 59, 0.5); border: 1px solid var(--accent); border-radius: 16px; padding: 24px; margin-top: 30px; }
.ai-output h3 { margin: 0 0 12px; color: var(--accent); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.ai-output-content { font-size: 15px; line-height: 1.6; color: #fff; }

.toggle-container { display: flex; align-items: center; gap: 12px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-soft); border: 1px solid var(--border-subtle); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: var(--text-muted); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); border-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); background-color: #fff; }
.toggle-label-text { font-size: 13px; color: var(--text-muted); font-weight: 500; cursor: pointer; }

/* --- NEW: Footer Styles --- */
.site-footer {
    background: #020308; /* Super dark */
    border-top: 1px solid var(--border-subtle);
    padding: 40px 24px 60px; /* Extra padding bottom for iOS home bar */
    margin-top: auto; /* Pushes to bottom */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-logo { font-weight: 700; color: white; font-size: 16px; text-decoration: none; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.copyright { color: #4b5563; font-size: 12px; margin-top: 10px; }

/* iOS Smart Banner */
.ios-promo-banner {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(28, 28, 30, 0.95); backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.15); padding: 12px 16px;
    z-index: 1000; align-items: center; justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4); animation: slideUp 0.3s ease-out;
}
.ios-banner-content { display: flex; align-items: center; gap: 12px; }
.ios-app-icon { width: 48px; height: 48px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; color: white; }
.ios-info h4 { margin: 0; font-size: 14px; font-weight: 600; color: #fff; }
.ios-info p { margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
.ios-action-btn { background: #fff; color: #000; border: none; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Mobile Tweaks */
@media (max-width: 768px) {
    .hero { display: flex; flex-direction: column; padding: 0 16px; margin-top: 20px; }
    .hero-main-card { padding: 24px; }
    .hero-side-card { display: none; } /* Hide marketing on mobile */
    .hero-title { font-size: 26px; }
    .search-box-row { flex-direction: column; gap: 10px; }
    .input-wrapper, .select-wrapper, .search-select, .search-button { width: 100%; height: 48px; }
    .results-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px; }
    .navbar { padding: 0 16px; }
    .logo-text-sub, .toggle-label-text { display: none; }
    .detail-layout { display: flex; flex-direction: column; margin-top: 20px; gap: 20px; }
    .detail-poster { width: 160px; margin: 0 auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
    .detail-info { text-align: center; }
    .detail-info h1 { font-size: 28px; }
}
/* Align header elements */
.ai-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Style for the CACHED pill */
.cache-status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1); /* Soft Accent Background */
    color: var(--accent); /* Accent Text Color */
    border: 1px solid rgba(99, 102, 241, 0.5);
    /* Ensure it doesn't wrap on small screens */
    white-space: nowrap; 
}
