/* FULL HEIGHT FIX */
html, body {
  height: 100%;
}

/* BODY - DEEP DARK BACKGROUND */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  min-height: 100dvh; 
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #020202, #0a1128, #020202);
  color: #ffffff;
  overflow-x: hidden;
}

/* 🌫️ GLOWING FALLING PARTICLES - LAYER 1 (Fast & Bright) */
body::before {
  content: "";
  position: fixed;
  top: -100vh;
  left: 0;
  width: 100vw;
  height: 300vh;
  background-image:
    radial-gradient(circle at 15vw 25vh, rgba(0,191,255,1) 0%, transparent 4px),
    radial-gradient(circle at 75vw 15vh, rgba(141,124,255,1) 0%, transparent 5px),
    radial-gradient(circle at 45vw 65vh, rgba(255,255,255,1) 0%, transparent 3px),
    radial-gradient(circle at 85vw 85vh, rgba(0,191,255,1) 0%, transparent 6px),
    radial-gradient(circle at 25vw 95vh, rgba(141,124,255,1) 0%, transparent 4px),
    radial-gradient(circle at 55vw 5vh, rgba(255,255,255,1) 0%, transparent 3px),
    radial-gradient(circle at 95vw 45vh, rgba(0,191,255,1) 0%, transparent 5px),
    radial-gradient(circle at 5vw 75vh, rgba(141,124,255,1) 0%, transparent 4px);
  background-size: 100vw 100vh;
  z-index: -2;
  filter: drop-shadow(0 0 10px #00bfff) blur(0.5px);
  animation: fallDown 12s linear infinite;
  pointer-events: none;
}

/* 🌫️ GLOWING FALLING PARTICLES - LAYER 2 (Slow & Soft Parallax) */
body::after {
  content: "";
  position: fixed;
  top: -100vh;
  left: 0;
  width: 100vw;
  height: 300vh;
  background-image:
    radial-gradient(circle at 10vw 10vh, rgba(0, 191, 255, 0.6) 0%, transparent 8px),
    radial-gradient(circle at 80vw 40vh, rgba(141, 124, 255, 0.6) 0%, transparent 10px),
    radial-gradient(circle at 40vw 80vh, rgba(255, 255, 255, 0.4) 0%, transparent 6px),
    radial-gradient(circle at 90vw 20vh, rgba(0, 191, 255, 0.5) 0%, transparent 9px),
    radial-gradient(circle at 30vw 60vh, rgba(141, 124, 255, 0.5) 0%, transparent 8px);
  background-size: 100vw 100vh;
  z-index: -3;
  filter: drop-shadow(0 0 15px #8d7cff) blur(2px);
  animation: fallDown 20s linear infinite;
  pointer-events: none;
}

/* 🔥 ANIMATION FOR ENDLESS FALLING */
@keyframes fallDown {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

/* CONTAINER */
.container {
  width: 600px;
  margin: auto;
  margin-top: 50px;
  background: transparent;
  padding: 20px;
  flex: 1;
  min-height: calc(100dvh - 80px); 
}

/* TOP BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* TITLE */
h1 {
  margin: 0;
  font-weight: bold;
  letter-spacing: 1px;
}

/* =========================================
   🔘 TOP CORNER LOGO
   ========================================= */
.top-corner-logo {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-link {
  text-decoration: none;
  display: inline-block;
}

.logo-link:hover .top-corner-logo {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.8);
}

/* 🔙 BACK BUTTON - GLASSMORPHISM */
.back-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  transition: 0.3s;

  /* Premium Glass */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.1);
}

/* 🔥 AD STYLE */
.ad {
  margin-bottom: 15px;
  text-align: center;
}

/* 🔍 INTEGRATED SEARCH CONTAINER - SLICK INNER BLEND */
.search-container {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  border-radius: 12px;
  position: relative;
  
  /* Semi-transparent overlay to reveal background textures */
  background: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  /* Premium theme glowing border tint */
  border: 1px solid rgba(0, 191, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

/* Inner field visual glow expansion when focused */
.search-container:focus-within {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(0, 191, 255, 0.6);
  box-shadow: 0 0 25px rgba(0, 191, 255, 0.3);
}

/* TRANSPARENT SEARCH BAR INPUT */
#search {
  flex: 1;
  padding: 14px 18px;
  border: none;
  outline: none;
  background: transparent !important; /* Removes default block texture */
  font-size: 16px;
  color: white;
}

#search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* 🎯 FIXED & BLENDED MAGNIFIER ICON BUTTON */
.search-btn {
  background: rgba(255, 255, 255, 0.05) !important; /* Premium subtle highlight background pill box */
  border: none;
  outline: none;
  
  /* Perfect centering and layout alignment values */
  padding: 0 22px;
  height: 44px; /* Hard boundaries to perfectly contain inside center height */
  margin-right: 4px; /* Small clean boundary gap from outer right framework edge */
  align-self: center; /* Forces total vertical symmetry execution */
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  font-size: 22px; /* Amplifies visual footprint safely */
  color: rgba(255, 255, 255, 0.75);
  border-radius: 10px; /* Aligns curve values cleanly inside container geometry */
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* High-end hover color swap and neon aura flare */
.search-btn:hover {
  background: rgba(0, 191, 255, 0.15) !important; /* Subtle cyan neon capsule pop */
  color: #00bfff;
  text-shadow: 0 0 12px rgba(0, 191, 255, 0.8);
  transform: scale(1.05);
}

/* 📁 FILE CARD - PREMIUM GLASSMORPHISM */
.file {
  padding: 18px;
  margin: 12px 0;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  width: 100%; 
  box-sizing: border-box; 

  /* Premium Glass */
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Forces long text/URLs to wrap inside the search list */
.file > div {
  flex: 1;
  min-width: 0; 
  padding-right: 15px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.file:hover {
  transform: translateY(-5px) scale(1.01);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.file strong {
  font-size: 1.1rem;
  color: #ffffff;
}

.file small {
  color: rgba(255, 255, 255, 0.6);
  display: block;
  margin-top: 4px;
}

/* FILE BUTTON */
.file button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #007bff, #00bfff);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(0, 191, 255, 0.3);
}

.file button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 191, 255, 0.5);
}

/* FILTERS - GLASSMORPHISM */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.filters button {
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  color: white;

  /* Premium Glass */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.filters button:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.15);
}

/* THEME BUTTON */
#themeToggle {
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  color: white;

  /* Premium Glass */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#themeToggle:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.15);
}

/* -------- PAGINATION UPGRADE -------- */
.page-info {
  margin-bottom: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.pagination {
  text-align: center;
  margin-top: 30px;
  padding-bottom: 20px;
}

.pagination button {
  margin: 5px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  color: white;
  font-weight: bold;

  /* Premium Glass */
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination button:hover {
  transform: scale(1.1);
  background: rgba(0, 191, 255, 0.4);
  border-color: rgba(0, 191, 255, 0.6);
}

.pagination button:disabled {
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.3);
  border-color: transparent;
  cursor: not-allowed;
  transform: none;
}

.active-page {
  background: linear-gradient(135deg, #ff5500, #ff8800) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 15px rgba(255, 85, 0, 0.4);
}

/* DETAILS PAGE */
.details-page {
  text-align: center;
}

.preview img {
  width: 250px;
  border-radius: 14px;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.info {
  margin: 15px 0;
  color: rgba(255, 255, 255, 0.8);
}

.download-btn {
  display: block;
  margin: 20px auto;
  padding: 14px;
  width: 60%;
  background: linear-gradient(135deg, #ff5500, #ff8800);
  color: white;
  font-weight: bold;
  text-decoration: none;
  border-radius: 10px;
  transition: 0.3s;
  box-shadow: 0 6px 20px rgba(255, 85, 0, 0.3);
}

.download-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 85, 0, 0.5);
}

.nav-buttons {
  margin-top: 20px;
}

.nav-buttons button {
  margin: 5px;
  padding: 10px 15px;
}

/* =========================================
   🕵️‍♂️ CUSTOM MYSTERY BOX MODAL STYLES
   ========================================= */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.custom-modal-box {
  background: #1a1a1a;
  border: 2px solid #00bfff;
  border-radius: 12px;
  padding: 25px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.4);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}
.custom-modal-overlay.active .custom-modal-box {
  transform: translateY(0);
}
.custom-modal-title {
  color: #00bfff;
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 10px;
}
.custom-modal-desc {
  color: #ccc;
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.4;
}
.custom-modal-input {
  width: 90%;
  padding: 12px;
  background: #0d0d0d;
  border: 1px solid #444;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.2s;
}
.custom-modal-input:focus {
  border-color: #00bfff;
}
.custom-modal-buttons {
  display: flex;
  gap: 10px;
}
.custom-modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}
.custom-modal-btn:hover {
  opacity: 0.8;
}
.btn-cancel {
  background: #333;
  color: white;
}
.btn-submit {
  background: #00bfff;
  color: #000;
}

/* MOBILE FIX */
@media (max-width: 768px) {
  .container {
    width: 95%;
    margin-top: 20px;
    flex: 1;
    min-height: calc(100dvh - 60px); 
  }

  .file {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .file button {
    width: 100%;
    padding: 12px;
  }

  .back-btn {
    top: 10px;
    right: 10px;
  }
}

/* =========================================
   ☀️ LIGHT MODE THEME OVERRIDES (WITH EFFECTS)
   ========================================= */
body.light-mode {
  background: linear-gradient(to right, #fcfcfc, #f5f5f5);
  color: #1e293b; 
}

/* ❄️ Light Mode Particles - Soft floating snow/bubbles */
body.light-mode::before {
  display: block !important; 
  background-image:
    radial-gradient(circle at 15vw 25vh, rgba(255,255,255,0.9) 0%, transparent 5px),
    radial-gradient(circle at 75vw 15vh, rgba(100,149,237,0.4) 0%, transparent 7px),
    radial-gradient(circle at 45vw 65vh, rgba(255,255,255,1) 0%, transparent 4px),
    radial-gradient(circle at 85vw 85vh, rgba(135,206,235,0.5) 0%, transparent 8px),
    radial-gradient(circle at 25vw 95vh, rgba(255,255,255,0.8) 0%, transparent 5px);
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.8)) blur(0.5px);
}

body.light-mode::after {
  display: block !important; 
  background-image:
    radial-gradient(circle at 10vw 10vh, rgba(255,255,255,0.6) 0%, transparent 10px),
    radial-gradient(circle at 80vw 40vh, rgba(176,196,222,0.5) 0%, transparent 12px),
    radial-gradient(circle at 40vw 80vh, rgba(255,255,255,0.5) 0%, transparent 8px),
    radial-gradient(circle at 90vw 20vh, rgba(135,206,235,0.4) 0%, transparent 11px);
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.6)) blur(2px);
}

/* Bright, clean frosted glass for all cards and inputs */
body.light-mode .file,
body.light-mode .search-container,
body.light-mode .back-btn,
body.light-mode .pagination button,
body.light-mode #themeToggle {
  background: rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #0f172a;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* 🔥 FIX: Force Movie Titles and Headings to be dark and visible! */
body.light-mode h1, 
body.light-mode h2, 
body.light-mode .file strong {
  color: #0f172a !important; 
  background: none;
  -webkit-text-fill-color: #0f172a; 
}

/* Fix Search Bar Text */
body.light-mode #search {
  color: #0f172a !important;
}

body.light-mode #search::placeholder {
  color: rgba(15, 23, 42, 0.5) !important;
}
    
/* Fix Search Button */
body.light-mode .search-btn {
  color: #0284c7 !important;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.5) !important;
}

body.light-mode .search-btn:hover {
  background: rgba(2, 132, 199, 0.1) !important;
}

/* Fix Secondary Text (Categories, file sizes, page info) */
body.light-mode .file small,
body.light-mode .page-info,
body.light-mode .info,
body.light-mode p {
  color: #475569 !important;
}

/* Keep the primary action buttons (Watch/Download) colorful */
body.light-mode .file button,
body.light-mode .download-btn {
  color: #ffffff !important;
}
