/* --- UNIVERSAL HEADER (ALWAYS PILL SHAPE) --- */

.universal-header {
  position: fixed; 
  top: 20px; /* Always floating with a top gap */
  left: 0; 
  right: 0; 
  margin: 0 auto; /* Perfectly centers it */
  width: 92%; /* Aligns beautifully with your theater-container */
  max-width: 1450px; 
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  
  /* OFF-SCROLL: Solid dark background matching your theme, no glass yet */
  background: #0A0A0B; 
  border-radius: 50px; /* Permanent Pill Shape */
  border: 1px solid rgba(255, 255, 255, 0.05); /* Very subtle border */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  
  /* Smooth transitions for the glassy effect */
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* --- ZAIRAKU-STYLE GLASSY EFFECT (ON SCROLL) --- */
.universal-header.scrolled {
  background: rgba(10, 10, 11, 0.55); /* High transparency dark tint */
  backdrop-filter: blur(28px); /* Heavy frosted glass blur */
  -webkit-backdrop-filter: blur(28px); /* Safari support */
  border: 1px solid rgba(255, 255, 255, 0.12); /* Slightly brighter glowing edge */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7); /* Deep floating shadow */
}

/* Mobile Adjustments */
@media (max-width: 1100px) {
  .universal-header {
    width: 94%;
    padding: 10px 16px;
    top: 15px;
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-toggle {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 35px;
  width: auto;
  border-radius: 6px;
  filter: drop-shadow(0 0 10px rgba(147, 51, 234, 0.5));
}

/* Header Search Bar (Shifted Right) */
.header-search {
  width: 100%;
  max-width: 350px; 
  margin-left: auto; 
  margin-right: 20px; 
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 15px 10px 45px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: 0.3s;
}

.header-search input:focus {
  outline: none;
  background: rgba(0,0,0,0.6);
  border-color: #8b5cf6;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.header-search > .material-icons-round {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #a1a1aa;
  font-size: 20px;
  pointer-events: none;
}

/* Live Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 15px);
  left: 0;
  right: 0;
  background: #0A0A0B;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  display: none; 
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  z-index: 200;
}

.search-dropdown.active {
  display: flex;
}

.live-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.live-result-item:last-child {
  border-bottom: none;
}

.live-result-item:hover {
  background: rgba(139, 92, 246, 0.15);
}

.live-result-item img {
  width: 45px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
}

.live-result-item h4 {
  font-size: 13px;
  color: #fff;
  margin: 0;
  font-weight: 600;
}

.advanced-search-btn {
  padding: 12px;
  text-align: center;
  color: #a855f7;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: 0.2s;
}
.advanced-search-btn:hover { color: #fff; background: rgba(139, 92, 246, 0.2); }

/* Bookmark Button */
.bookmark-btn {
  background: #8b5cf6;
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: 0.2s;
  white-space: nowrap;
}

.bookmark-btn:hover {
  background: #7c3aed;
  transform: scale(1.05);
}

/* =========================================
   MOBILE SEARCH TOGGLE (DESKTOP DEFAULT)
========================================= */
.mobile-search-toggle {
  display: none; /* Desktop par hidden rahega */
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  margin-left: auto;
  margin-right: 15px;
}

/* =========================================
   MOBILE SPECIFICS & EXTREME DARK GLASS BAR
========================================= */
@media (max-width: 768px) {
  
  .mobile-search-toggle { 
    display: flex; /* Mobile par visible ho jayega */
  }
  
  .header-search {
    position: absolute;
    top: 70px;
    left: 4%;
    right: 4%;
    width: 92%;
    max-width: 100%;
    margin: 0;
    display: none; 
    z-index: 250; /* Search bar stays below sidebar */
  }

  /* EXTREME DARK GLASSY EFFECT (Normal State) */
  .header-search input {
    background: rgba(5, 5, 8, 0.85) !important;
    backdrop-filter: blur(40px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(150%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8) !important;
    padding: 14px 15px 14px 45px;
    font-size: 15px;
    color: #ffffff !important;
    transition: all 0.3s ease;
  }
  
  /* MAINTAIN EXTREME DARK GLASS DURING SEARCHING/CLICKING */
  .header-search input:focus {
    background: rgba(2, 2, 5, 0.94) !important;
    backdrop-filter: blur(50px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(150%) !important;
    border: 1px solid rgba(139, 92, 246, 0.9) !important;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), 0 20px 50px rgba(0, 0, 0, 0.9) !important;
    outline: none;
  }
  
  .header-search.mobile-active {
    display: block;
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }
}

/* =========================================
   GLOBAL ANIMATIONS
========================================= */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}
/* --- PREFIXED SIDEBAR MENU --- */
.univ-sidebar-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 199; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.univ-sidebar-overlay.active { opacity: 1; pointer-events: all; }

.univ-sidebar { position: fixed; top: 0; left: -300px; width: 280px; height: 100vh; background: #0A0A0B; z-index: 200; transition: left 0.3s ease; display: flex; flex-direction: column; box-shadow: 10px 0 30px rgba(0,0,0,0.5); border-right: 1px solid rgba(255, 255, 255, 0.05); }
.univ-sidebar.active { left: 0; }

.univ-sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.univ-sidebar-header h2 { font-size: 20px; color: #a855f7; margin: 0; }

.univ-close-menu { background: transparent; border: none; color: #fff; cursor: pointer; }

.univ-sidebar-menu { padding: 15px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }

.univ-menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: #a1a1aa; text-decoration: none; border-radius: 12px; font-weight: 600; font-size: 15px; transition: 0.2s; }
.univ-menu-item:hover { background: rgba(139, 92, 246, 0.15); color: #fff; }

.univ-menu-item.univ-label-btn { background: rgba(255,255,255,0.03); border: 1px solid rgba(255, 255, 255, 0.05); margin-bottom: 5px; }
.univ-menu-item.univ-label-btn:hover { background: rgba(139, 92, 246, 0.2); border-color: #8b5cf6; }

.univ-menu-divider { height: 1px; background: rgba(255, 255, 255, 0.05); margin: 10px 0; }