/*
 * NEON HORIZON — Cyberpunk theme for StepheyBot Search (SearXNG)
 * Polish pass: preserve identity, retarget 2026 simple theme DOM,
 * tighten contrast/motion, drop dead selectors.
 */

:root {
  --neon-cyan: #00fff9;
  --neon-pink: #ff00ff;
  --neon-purple: #b967ff;
  --neon-blue: #01cdfe;
  --neon-yellow: #fffb96;
  --neon-orange: #ff6b35;
  --neon-green: #05ffa1;

  --text-primary: #e8f4ff;
  --text-secondary: #a8b4d4;
  --text-muted: #7a86a8;

  --bg-void: #0a0a0f;
  --bg-deep: #0d0d1a;
  --bg-dark: #12121f;
  --bg-card: rgba(18, 18, 35, 0.85);
  --bg-card-hover: rgba(28, 28, 52, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(10, 10, 20, 0.88);
  --bg-header: rgba(10, 10, 20, 0.72);

  --gradient-neon: linear-gradient(
    90deg,
    var(--neon-cyan),
    var(--neon-pink),
    var(--neon-purple)
  );

  --glow-cyan: 0 0 6px #00fff9, 0 0 14px #00fff980;
  --glow-pink: 0 0 6px #ff00ff, 0 0 14px #ff00ff80;
  --glow-subtle: 0 0 12px rgba(0, 255, 249, 0.25),
    0 0 28px rgba(255, 0, 255, 0.12);

  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 24px rgba(0, 255, 249, 0.12),
    0 0 48px rgba(255, 0, 255, 0.08);

  --border-glass: 1px solid rgba(255, 255, 255, 0.1);
  --border-neon: 1px solid rgba(0, 255, 249, 0.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --space: 0.25rem;
}

/* ============================================
   STAGE
   ============================================ */
html {
  background: var(--bg-void) !important;
  color-scheme: dark;
}

body {
  background:
    radial-gradient(
      ellipse 80% 50% at 20% 40%,
      rgba(185, 103, 255, 0.14) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 60% 40% at 80% 60%,
      rgba(0, 255, 249, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 50% 30% at 50% 80%,
      rgba(255, 0, 255, 0.07) 0%,
      transparent 50%
    ),
    linear-gradient(180deg, var(--bg-void) 0%, var(--bg-deep) 50%, #0f0a1e 100%) !important;
  background-attachment: fixed !important;
  color: var(--text-primary) !important;
  font-family: "Inter", "SF Pro Display", system-ui, -apple-system, sans-serif !important;
  min-height: 100vh !important;
  position: relative !important;
}

/* Grid + CRT overlays stay decorative, never steal clicks */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background-image: linear-gradient(
      rgba(0, 255, 249, 0.025) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(0, 255, 249, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

body::after {
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

#main_index,
#main_results,
#main_preferences,
#main_info {
  position: relative;
  z-index: 1;
}

/* ============================================
   TOP LINKS + SEARCH HEADER
   ============================================ */
#links_on_top a {
  color: var(--text-secondary) !important;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
    text-shadow 0.2s var(--ease);
}

#links_on_top a:hover,
#links_on_top a:focus-visible {
  color: var(--neon-cyan) !important;
  background: rgba(0, 255, 249, 0.08);
  text-shadow: 0 0 10px rgba(0, 255, 249, 0.35);
}

#links_on_top svg {
  color: inherit !important;
  fill: none;
}

#search_header {
  background: var(--bg-header) !important;
  backdrop-filter: blur(18px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
  border-bottom: 1px solid rgba(0, 255, 249, 0.18) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(255, 0, 255, 0.08) !important;
  position: relative !important;
}

#search_header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-neon);
  background-size: 200% 100%;
  animation: gradient-shift 4s ease infinite;
}

/* Homepage wordmark — circuit lockup replaces the stock PNG */
.index .title {
  background: url("./img/stephey-search.svg?v=3") center / contain no-repeat !important;
  width: min(46rem, 94vw);
  aspect-ratio: 1280 / 248;
  min-height: 0 !important;
  height: auto !important;
  margin: 2.25rem auto 0.35rem !important;
  position: relative;
}

.index .title h1 {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ============================================
   SEARCH BOX
   ============================================ */
#search,
.search_box {
  position: relative;
  z-index: 10;
}

#q {
  background: var(--bg-input) !important;
  backdrop-filter: blur(10px) !important;
  border: 2px solid rgba(185, 103, 255, 0.32) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text-primary) !important;
  font-size: 1.05rem !important;
  padding: 0.95rem 1.35rem !important;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease) !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.28) !important;
}

#q:focus,
#q:focus-visible {
  border-color: var(--neon-cyan) !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(0, 255, 249, 0.18), var(--glow-subtle) !important;
  outline: none !important;
}

#q::placeholder {
  color: var(--text-muted) !important;
  opacity: 1 !important;
}

#send_search,
#clear_search {
  background: linear-gradient(
    135deg,
    var(--neon-pink) 0%,
    var(--neon-purple) 100%
  ) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease) !important;
  box-shadow: 0 4px 14px rgba(255, 0, 255, 0.35) !important;
}

#clear_search {
  background: rgba(185, 103, 255, 0.2) !important;
  box-shadow: none !important;
}

#send_search:hover,
#send_search:focus-visible {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px rgba(255, 0, 255, 0.45),
    0 0 28px rgba(185, 103, 255, 0.25) !important;
}

#send_search svg,
#clear_search svg {
  color: #fff !important;
}

/* ============================================
   CATEGORY BUTTONS (2026: button.category_button)
   ============================================ */
.search_categories {
  border-bottom: 1px solid rgba(185, 103, 255, 0.18) !important;
  padding: 0.4rem 0 !important;
}

button.category.category_button {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 0.55rem !important;
  color: var(--text-secondary) !important;
  margin: 0 0.15rem !important;
  padding: 0.55rem 0.85rem !important;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), text-shadow 0.2s var(--ease) !important;
  position: relative !important;
}

button.category.category_button:hover,
button.category.category_button:focus-visible {
  background: rgba(0, 255, 249, 0.08) !important;
  border-color: rgba(0, 255, 249, 0.28) !important;
  color: var(--neon-cyan) !important;
}

button.category.category_button.selected {
  background: rgba(0, 255, 249, 0.1) !important;
  border-color: rgba(0, 255, 249, 0.35) !important;
  color: var(--neon-cyan) !important;
  text-shadow: 0 0 10px rgba(0, 255, 249, 0.4) !important;
}

button.category.category_button.selected::after {
  content: "" !important;
  position: absolute !important;
  bottom: -1px !important;
  left: 12% !important;
  width: 76% !important;
  height: 3px !important;
  background: var(--gradient-neon) !important;
  border-radius: 3px 3px 0 0 !important;
  box-shadow: 0 0 10px var(--neon-cyan) !important;
}

button.category.category_button svg {
  color: inherit !important;
}

.category_name {
  color: inherit !important;
}

/* ============================================
   RESULTS
   ============================================ */
article.result {
  background: var(--bg-card) !important;
  backdrop-filter: blur(10px) !important;
  border: var(--border-glass) !important;
  border-left: 3px solid var(--neon-purple) !important;
  border-radius: var(--radius-lg) !important;
  margin-bottom: 1.1rem !important;
  padding: 1.25rem 1.4rem !important;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease), box-shadow 0.25s var(--ease) !important;
  position: relative !important;
  overflow: hidden !important;
}

article.result::before {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.035),
    transparent
  );
  transition: left 0.7s ease;
  pointer-events: none;
}

article.result:hover::before {
  left: 150%;
}

article.result:hover {
  background: var(--bg-card-hover) !important;
  border-color: rgba(0, 255, 249, 0.22) !important;
  border-left-color: var(--neon-cyan) !important;
  transform: translateX(6px) translateY(-1px) !important;
  box-shadow: var(--shadow-card), 0 0 24px rgba(0, 255, 249, 0.08) !important;
}

article.result h3 a {
  color: var(--neon-cyan) !important;
  font-weight: 600 !important;
  font-size: 1.08rem !important;
  text-decoration: none !important;
  transition: color 0.2s var(--ease), text-shadow 0.2s var(--ease) !important;
}

article.result h3 a:hover,
article.result h3 a:focus-visible {
  color: var(--neon-pink) !important;
  text-shadow: var(--glow-pink) !important;
}

.highlight {
  color: var(--neon-yellow) !important;
  background: rgba(255, 251, 150, 0.08) !important;
  border-radius: 2px;
  padding: 0 0.1em;
}

.url_wrapper,
.url_header {
  color: var(--neon-purple) !important;
  font-size: 0.84rem !important;
}

.url_i1,
.url_i2,
.url_o1,
.url_o2 {
  color: inherit !important;
}

article.result .content {
  color: var(--text-secondary) !important;
  line-height: 1.65 !important;
  margin-top: 0.45rem !important;
}

article.result .engines {
  color: var(--neon-green) !important;
  font-size: 0.72rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
}

/* ============================================
   SIDEBAR / INFOBOX / ANSWERS
   ============================================ */
#sidebar,
.sidebar-collapsible {
  background: rgba(13, 13, 26, 0.55) !important;
  border: 1px solid rgba(185, 103, 255, 0.2) !important;
  border-radius: var(--radius-lg) !important;
}

.sidebar-collapsible summary.title {
  color: var(--neon-pink) !important;
}

#infoboxes .infobox,
.infobox {
  background: linear-gradient(
    135deg,
    rgba(185, 103, 255, 0.1) 0%,
    rgba(0, 255, 249, 0.05) 100%
  ) !important;
  backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(185, 103, 255, 0.28) !important;
  border-radius: 1.1rem !important;
  box-shadow: var(--shadow-glow) !important;
  padding: 1.4rem !important;
  position: relative !important;
  overflow: hidden !important;
}

.infobox::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-neon);
}

.infobox h2 {
  color: var(--neon-pink) !important;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.35) !important;
}

.infobox img {
  border-radius: var(--radius-md) !important;
  border: 2px solid rgba(0, 255, 249, 0.28) !important;
}

#answers .answer,
.answer {
  background: linear-gradient(
    135deg,
    rgba(5, 255, 161, 0.1) 0%,
    rgba(0, 255, 249, 0.05) 100%
  ) !important;
  border: 1px solid rgba(5, 255, 161, 0.28) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--neon-green) !important;
  padding: 1.25rem !important;
  margin-bottom: 1.25rem !important;
  box-shadow: 0 0 24px rgba(5, 255, 161, 0.12) !important;
}

/* ============================================
   PAGINATION + AUTOCOMPLETE
   ============================================ */
.numbered_pagination {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 0.55rem !important;
  margin: 2rem 0 !important;
}

.numbered_pagination a,
.page_number,
.next_page,
.previous_page {
  background: var(--bg-card) !important;
  border: 1px solid rgba(185, 103, 255, 0.28) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: 0.65rem 1rem !important;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    transform 0.2s var(--ease), box-shadow 0.2s var(--ease) !important;
}

.numbered_pagination a:hover,
.page_number:hover,
.next_page:hover {
  background: rgba(185, 103, 255, 0.18) !important;
  border-color: var(--neon-purple) !important;
  box-shadow: 0 0 16px rgba(185, 103, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

.page_number_current {
  border-color: var(--neon-cyan) !important;
  color: var(--neon-cyan) !important;
  box-shadow: 0 0 14px rgba(0, 255, 249, 0.2) !important;
}

.autocomplete {
  background: rgba(13, 13, 26, 0.96) !important;
  backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(185, 103, 255, 0.3) !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
}

.autocomplete ul li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: var(--text-primary) !important;
  padding: 0.75rem 1.1rem !important;
  transition: background 0.15s var(--ease), color 0.15s var(--ease),
    padding-left 0.15s var(--ease) !important;
}

.autocomplete ul li:hover,
.autocomplete ul li[aria-selected="true"] {
  background: linear-gradient(90deg, rgba(0, 255, 249, 0.1), transparent) !important;
  color: var(--neon-cyan) !important;
  padding-left: 1.35rem !important;
}

/* ============================================
   PREFERENCES / FORMS
   ============================================ */
#main_preferences,
.preferences {
  background: var(--bg-card) !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 1.15rem !important;
  padding: 1.6rem !important;
}

#main_preferences h1,
#main_preferences h2 {
  color: var(--neon-pink) !important;
  text-shadow: 0 0 16px rgba(255, 0, 255, 0.28) !important;
}

select,
textarea,
input[type="text"],
input[type="number"],
input[type="password"] {
  background: var(--bg-input) !important;
  border: 1px solid rgba(185, 103, 255, 0.3) !important;
  border-radius: 0.5rem !important;
  color: var(--text-primary) !important;
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 12px rgba(0, 255, 249, 0.25) !important;
  outline: none !important;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--neon-pink) !important;
}

/* ============================================
   LINKS (scoped — don’t nuke icon buttons)
   ============================================ */
a:not(.category_button):not(#send_search):not(#clear_search) {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:not(.category_button):hover,
a:not(.category_button):focus-visible {
  color: var(--neon-pink);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink));
  border-radius: 10px;
  border: 2px solid var(--bg-void);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
}

/* ============================================
   IMAGES
   ============================================ */
.result-images img,
.thumbnail img {
  border-radius: var(--radius-md) !important;
  border: 2px solid transparent !important;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    transform 0.2s var(--ease) !important;
}

.result-images a:hover img,
.thumbnail:hover img {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 20px rgba(0, 255, 249, 0.35) !important;
  transform: scale(1.03) !important;
}

/* ============================================
   MOTION
   ============================================ */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  #search_header::after {
    animation: none !important;
    background-position: 50% 50% !important;
  }

  article.result:hover {
    transform: none !important;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  article.result {
    padding: 1rem !important;
    border-radius: var(--radius-md) !important;
  }

  article.result:hover {
    transform: none !important;
  }

  #q {
    font-size: 1rem !important;
    padding: 0.8rem 1rem !important;
    border-radius: var(--radius-md) !important;
  }

  button.category.category_button {
    padding: 0.45rem 0.6rem !important;
  }

  .category_name {
    font-size: 0.85rem !important;
  }
}
