/* Fix width math everywhere */
*, *::before, *::after { box-sizing: border-box; }

:root{
  --obsidian: #0b0d0c;
  --charcoal: #121614;
  --necro:    #15ff00;
  --crimson:  #8b1e1e;
  --moon:     #d9ddd7;

  --muted: rgba(217,221,215,0.78);
  --glass: rgba(18,22,20,0.58);
  --glass-strong: rgba(18,22,20,0.72);
  --border: rgba(21,255,0,0.45);
  --glow: 0 0 18px rgba(21,255,0,0.22);
}

html, body { height: 100%; }

/* ✅ Search page background overrides global style.css */
html, body{
  background-image: url("../assets/backgrounds/search-bg-desktop.png") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  background-color: var(--obsidian) !important;
}

/* layout */
body{
  margin: 0;
  color: var(--moon);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ✅ Fog video can never steal clicks */
.fog-video{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  pointer-events: none !important;
  z-index: 0;
  opacity: 0.75;
  mix-blend-mode: screen;
}

/* Make UI above fog */
header, main, footer{
  position: relative;
  z-index: 10;
}

/* Mobile background */
@media (max-width: 768px){
  html, body{
    background-image: url("../assets/backgrounds/search-bg-mobile.jpg") !important;
    background-attachment: scroll !important;
  }
  .fog-video{ opacity: 0.12; }
}

/* ====== Search Page Layout ====== */
main {
  display: flex;
  justify-content: center;
  padding: 30px;
  flex: 1;
}

.search-container{
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;

  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  padding: 20px;
  border-radius: 16px;

  border: 2px solid var(--border);
  box-shadow: var(--glow), 0 10px 40px rgba(0,0,0,0.55);
}

.filters{
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 25px;

  background: rgba(18,22,20,0.78);
  padding: 15px;
  border-radius: 12px;

  border: 1px solid rgba(21,255,0,0.35);
  box-shadow: 0 0 10px rgba(21,255,0,0.12);
}

.filters label{
  display: flex;
  flex-direction: column;
  font-weight: 700;
  color: var(--moon);
}

.filters input,
.filters select{
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;

  border: 1px solid rgba(21,255,0,0.35);
  background: rgba(0,0,0,0.40);
  color: var(--moon);
  outline: none;
}

.filters input:focus,
.filters select:focus{
  border-color: rgba(21,255,0,0.75);
  box-shadow: 0 0 0 3px rgba(21,255,0,0.15);
}

.filter-btn{
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(21,255,0,0.55);

  background: rgba(21,255,0,0.12);
  color: var(--moon);
  font-weight: 800;

  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.filter-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(21,255,0,0.25);
  background: rgba(21,255,0,0.18);
}

/* Results grid */
.user-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: start;
  width: 100%;
}

.user-card {
  background: #000;
  border: 2px solid #5eff7e;
  border-radius: 12px;
  box-shadow: 0 0 6px rgba(21,255,0,0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
  min-width: 0;
}
.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(21,255,0,0.7);
}

.user-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.user-info {
  padding: 10px 12px 12px;
  text-align: center;
  min-width: 0;
}

.user-info h3 {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  color: #7fff00;
}

.user-info .meta {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
}

.user-info .match {
  margin: 0 10px 10px;
  font-weight: 600;
}

.status.online  { color: #00ff00; }
.status.recent  { color: #ffff00; }
.status.ghosted { color: #888; }

.view-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  background: #111;
  color: #15ff00;
  font-weight: bold;
  border: 2px solid #15ff00;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.view-btn:hover {
  background: #15ff00;
  color: #111;
}

@media (max-width: 480px) {
  .user-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* ===========================
   ✅ HARD FIX: dropdown clickable on Search page
   =========================== */
header { overflow: visible !important; z-index: 99990; }
.header-right { position: relative; z-index: 99991; }
.user-menu { position: relative; z-index: 99992; overflow: visible !important; }