/* ============================================================
   FILESDL - OPTIMIZED style.css
   CHANGES: Removed spacePan animation, floating astronaut/planet,
   floatUI animation, reduced backdrop-filter on img-placeholder
   for zero scroll lag. All design preserved.
   ============================================================ */

html { scroll-behavior: smooth; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

body {
    background-color: #080312;
    background-image:
        radial-gradient(at 20% 30%, rgba(124, 58, 237, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(216, 180, 254, 0.1) 0px, transparent 50%),
        url('https://www.transparenttextures.com/patterns/stardust.png');
    /* REMOVED: animation: spacePan 60s linear infinite — caused scroll lag */
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    user-select: none; -webkit-user-select: none;
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    -webkit-overflow-scrolling: touch;
    color: #f8fafc;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(147, 51, 234, 0.05) 0%, rgba(0,0,0,0) 80%);
    z-index: -1; pointer-events: none;
}

/* REMOVED: body::after floating astronaut — caused paint lag */
/* REMOVED: #app-container::before floating planet — caused paint lag */
/* REMOVED: @keyframes spacePan, floatAstronaut, floatPlanet */

#app-container { overflow-x: hidden; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* ============================================================
   MOVIE CARDS
   ============================================================ */
.movie-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
    will-change: transform;
    transform: translateZ(0);
    contain: layout style paint;
}
.movie-card:hover { transform: translateY(-4px) translateZ(0); z-index: 10; }
.movie-card:hover .img-placeholder-container {
    border-color: rgba(216, 180, 254, 0.8) !important;
    box-shadow: 0 15px 35px rgba(168, 85, 247, 0.5), inset 0 0 25px rgba(216, 180, 254, 0.2) !important;
}

img { pointer-events: none; backface-visibility: hidden; }
#sidenav { transition: transform 0.3s ease-in-out; }
.info-label { font-weight: bold; color: #9ca3af; }
.info-value { color: #e5e7eb; }

/* ============================================================
   IMAGE PLACEHOLDER CONTAINER
   CHANGE: Removed backdrop-filter:blur — main scroll lag cause
   ============================================================ */
.img-placeholder-container {
    position: relative;
    background-color: #111;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 1.2rem !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5) !important;
    background: rgba(20, 10, 40, 0.6) !important;
    /* REMOVED: backdrop-filter: blur(10px) — biggest scroll lag culprit */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.img-placeholder-container::before {
    content: "FilesDL";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 1px;
    z-index: 0;
    pointer-events: none;
    color: rgba(216, 180, 254, 0.2) !important;
    text-shadow: 0 0 10px rgba(216, 180, 254, 0.1);
}
.img-placeholder-container img {
    position: relative;
    z-index: 1;
    opacity: 0;
    border-radius: 0.5rem;
    transition: opacity 0.4s ease-in-out;
    will-change: opacity;
}
.img-placeholder-container img.loaded { opacity: 1 !important; }

/* ============================================================
   SWIPER / BANNER
   ============================================================ */
.swiper { width: 100%; height: 100%; border-radius: 0.75rem; }
.swiper-slide {
    position: relative; background: #111; overflow: hidden; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(216, 180, 254, 0.2) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6) !important;
    will-change: transform, opacity;
}
.swiper-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; opacity: 0; transition: opacity 0.4s; }
.swiper-slide img.loaded { opacity: 1 !important; }
.banner-gradient { position: absolute; bottom: 0; left: 0; width: 100%; height: 60%; background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, transparent 100%); z-index: 10; }
.banner-content { position: absolute; bottom: 20px; left: 20px; z-index: 20; max-width: 80%; }
.banner-page-indicator {
    position: absolute; top: 15px; right: 15px; color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; z-index: 30; letter-spacing: 1px;
    background: rgba(30, 15, 60, 0.8) !important;
    border: 1px solid rgba(216, 180, 254, 0.4) !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5) !important;
}
.banner-mobile-fix { width: 100%; max-width: 100vw; box-sizing: border-box; overflow: hidden; }
.banner-container-responsive {
    width: 100%; max-width: 100%; aspect-ratio: 16 / 9; box-sizing: border-box; overflow: hidden;
}
@media (min-width: 768px) { .banner-container-responsive { aspect-ratio: 21 / 9; max-height: 450px; } }

/* ============================================================
   CATEGORY BAR
   ============================================================ */
.category-bar-container {
    background: rgba(20, 10, 40, 0.3) !important;
    backdrop-filter: blur(8px);
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
    padding: 15px; width: 100%;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}
.cat-btn { padding: 8px 20px; border-radius: 9999px; font-weight: 700; font-size: 0.90rem; cursor: pointer; transition: all 0.3s ease; text-decoration: none; display: inline-block; text-align: center; margin-bottom: 5px; letter-spacing: 0.5px; }
.cat-btn:active { transform: scale(0.95); }
.cat-btn-active {
    background: linear-gradient(135deg, #a855f7, #7c3aed) !important;
    color: #fff !important; border: none;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.6) !important;
}
.cat-btn-normal {
    background: rgba(30, 20, 50, 0.5) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    color: #94a3b8;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.3) !important;
}
.cat-btn-normal:hover {
    background: rgba(168, 85, 247, 0.2) !important;
    color: white; border-color: #d8b4fe !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4) !important;
}

.rank-number { position: absolute; bottom: -20px; left: -10px; font-size: 90px; font-weight: 900; color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, 0.4); z-index: 20; line-height: 1; font-family: sans-serif; pointer-events: none; filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.8)); }

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrapper { position: relative; max-width: 600px; margin: 0 auto; z-index: 50; }
#home-search-input, .admin-input, .glass-input-premium {
    width: 100%;
    background: rgba(10, 5, 25, 0.5) !important;
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.6), inset -2px -2px 5px rgba(168, 85, 247, 0.1) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    border-radius: 50px !important;
    padding: 14px 45px 14px 55px; color: #f8fafc !important; font-size: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
#home-search-input:focus, .admin-input:focus, .glass-input-premium:focus {
    background: rgba(30, 15, 60, 0.6) !important;
    border-color: #d8b4fe !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4), inset 2px 2px 5px rgba(0,0,0,0.5) !important;
    outline: none !important;
    transform: scale(1.02);
}
#home-search-input::placeholder { color: #9ca3af; }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, 0.6); font-size: 18px; pointer-events: none; z-index: 10; }
#search-suggestions-container { position: absolute; top: calc(100% + 10px); left: 0; right: 0; background: rgba(15, 15, 15, 0.98); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 1rem; max-height: 400px; overflow-y: auto; z-index: 999; box-shadow: 0 10px 30px rgba(0,0,0,0.9); display: none; }
#search-suggestions-container::-webkit-scrollbar { width: 6px; }
#search-suggestions-container::-webkit-scrollbar-track { background: rgba(25, 25, 25, 0.5); border-radius: 10px; }
#search-suggestions-container::-webkit-scrollbar-thumb { background: #a855f7; border-radius: 10px; }
.suggestion-item { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); cursor: pointer; transition: background 0.2s; }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: rgba(168, 85, 247, 0.15); }
.suggestion-info { min-width: 0; flex: 1; }
.suggestion-info h4 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-info p { margin: 0; font-size: 0.78rem; }

/* ============================================================
   GLASS BACKGROUNDS
   ============================================================ */
.bg-\[\#111\], .bg-\[\#1a1a1a\], .bg-\[\#0d0d0d\], .bg-\[\#222\], .bg-\[\#333\] {
    background: rgba(20, 10, 40, 0.45) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(216, 180, 254, 0.15) !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    border-radius: 1.5rem !important;
}

/* REMOVED: @keyframes floatUI and its animation on page divs — caused jank */

#main-header, #sidenav {
    background: rgba(10, 5, 25, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(216, 180, 254, 0.2) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
}
#sidenav { border-right: 1px solid rgba(216, 180, 254, 0.2) !important; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
#admin-panel { position: fixed; inset: 0; z-index: 100000; overflow-x: hidden; overflow-y: auto; }
.btn-icon-red { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); color: white; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 0.5rem; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.5); transition: transform 0.1s; }
.btn-icon-red:active { transform: scale(0.95); }
.code-editor { font-family: 'Courier New', Courier, monospace; white-space: pre; overflow-x: auto; }
#admin-lock-msg { display: none; font-size: 10px; background: #ef4444; color: white; padding: 2px 6px; border-radius: 4px; font-weight: bold; }
.modal-card { background: rgba(30, 30, 30, 0.98); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8); }
.toggle-checkbox:checked { right: 0; border-color: #ec4899; }
.toggle-checkbox:checked + .toggle-label { background-color: #ec4899; }
.toggle-checkbox { right: 0; z-index: 1; border-color: #444; transition: all 0.3s; }
.toggle-label { width: 3rem; height: 1.5rem; transition: background-color 0.3s; background-color: #333; }
.toggle-checkbox:checked { right: -1.5rem; border-color: white; }
@media (max-width: 768px) { #admin-page-movies .grid, #admin-page-series .grid { grid-template-columns: 1fr; } }

/* FLOATING PILL ADMIN MENU */
#floating-admin-menu {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 15px; border-radius: 60px;
    display: flex; align-items: center; gap: 10px;
    z-index: 99999; box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    overflow-x: auto; max-width: 95vw;
}
.admin-pill-btn {
    background: transparent; border: none; color: #9ca3af; font-size: 20px;
    width: 50px; height: 50px; border-radius: 50px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; flex-shrink: 0;
}
.admin-pill-btn:hover { color: #fff; }
.admin-pill-btn.active {
    background: #a855f7; color: #000; width: auto; padding: 0 25px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}
.admin-pill-btn span { display: none; font-size: 14px; margin-left: 10px; font-weight: bold; }
.admin-pill-btn.active span { display: inline-block; }

/* ADMIN INPUT OVERRIDES */
#admin-panel { user-select: auto !important; -webkit-user-select: auto !important; }
#admin-panel .admin-input, #admin-panel textarea, #admin-panel input, #admin-panel select {
    user-select: auto !important; -webkit-user-select: auto !important;
    background-color: #111111 !important; color: #ffffff !important;
    border: 1px solid #444 !important;
}
#admin-panel .admin-input:focus, #admin-panel textarea:focus, #admin-panel input:focus, #admin-panel select:focus {
    border-color: #a855f7 !important; box-shadow: 0 0 5px rgba(168, 85, 247, 0.4) !important; outline: none !important;
}
#admin-panel .admin-input::placeholder, #admin-panel textarea::placeholder, #admin-panel input::placeholder { color: #888888 !important; }
#admin-panel select option { background-color: #111111 !important; color: #ffffff !important; }
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #111111 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}
.admin-page { padding-bottom: 100px; }

/* MODALS */
#master-gate-modal > div > div, #admin-login-modal > div > div {
    background: rgba(20, 10, 40, 0.65) !important;
    backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(216, 180, 254, 0.3) !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.7), inset 0 0 20px rgba(168,85,247,0.1) !important;
    border-radius: 25px !important;
}
h2, h3, .site-name-display { text-shadow: 0 0 10px rgba(216, 180, 254, 0.4) !important; }

/* FLOATING WIDGET */
#dynamic-floating-widget {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    z-index: 2147483647 !important; pointer-events: none !important; display: block !important;
}
#dynamic-floating-widget * { pointer-events: auto; }

/* PWA INSTALL BANNER */
#pwa-install-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff; padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    box-shadow: 0 -4px 20px rgba(168,85,247,0.4);
    font-family: 'Inter', sans-serif;
}
#pwa-install-banner p { margin: 0; font-weight: 700; font-size: 14px; flex: 1; }
#pwa-install-banner button { font-size: 13px; font-weight: 800; border: none; cursor: pointer; border-radius: 8px; padding: 8px 14px; }
#pwa-btn-install { background: #fff; color: #7c3aed; }
#pwa-btn-dismiss { background: rgba(255,255,255,0.2); color: #fff; }

/* ANTI ADBLOCK */
#adblock-overlay * { box-sizing: border-box; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
#adblock-overlay {
    position: fixed; inset: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px) !important; -webkit-backdrop-filter: blur(8px) !important;
    display: none; justify-content: center; align-items: center;
    z-index: 999999999 !important; padding: 15px;
}
#adblock-box {
    width: 100%; max-width: 280px;
    background: rgba(25, 10, 45, 0.75) !important;
    backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(216, 180, 254, 0.3) !important;
    border-radius: 25px !important; padding: 25px 20px; text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), inset 0 0 20px rgba(168,85,247,0.2) !important;
    animation: popupShow 0.4s ease-out forwards;
}
#adblock-box img { width: 110px; height: auto; margin: 0 auto 12px; display: block; border-radius: 18px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
#adblock-box h2 {
    font-size: 20px; font-weight: 800; margin-bottom: 10px;
    background: linear-gradient(90deg, #d8b4fe, #a855f7, #c084fc) !important;
    background-size: 200% auto; -webkit-background-clip: text !important; -webkit-text-fill-color: transparent;
    animation: gradientBlink 2s ease-in-out infinite;
}
#adblock-box p { font-size: 13px; line-height: 1.5; color: #f1f5f9; margin-bottom: 15px; }
#adblock-box .note { font-size: 11px; color: #cbd5e1; background: rgba(0, 0, 0, 0.3); padding: 8px; border-radius: 10px; margin-bottom: 18px; border: 1px solid rgba(255, 255, 255, 0.05); }
#adblock-reload { width: 100%; border: none; background: linear-gradient(135deg, #a855f7, #6d28d9) !important; box-shadow: 0 8px 20px rgba(147, 51, 234, 0.5) !important; border: 1px solid rgba(216, 180, 254, 0.4); color: #fff; padding: 12px 0; border-radius: 10px; font-size: 15px; cursor: pointer; font-weight: 700; transition: opacity 0.3s ease; }
#adblock-reload:hover { opacity: 0.8; }

@keyframes popupShow { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes gradientBlink { 0% { opacity: 1; background-position: 0% 50%; } 50% { opacity: 0.6; background-position: 100% 50%; } 100% { opacity: 1; background-position: 0% 50%; } }

/* DOWNLOAD LINK BUTTON */
.download-link { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.download-link:hover { transform: translateY(-2px); }

