/* ========== DevTools Hub — Full Sci-Fi / Futuristic theme ========== */
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700;800&family=Exo+2:wght@400;500;600;700&display=swap");

:root {
  --sf-bg: #020617;
  --sf-panel: rgba(15, 23, 42, 0.75);
  --sf-border: rgba(56, 189, 248, 0.28);
  --sf-cyan: #22d3ee;
  --sf-blue: #3b82f6;
  --sf-purple: #a855f7;
  --sf-glow: 0 0 28px rgba(34, 211, 238, 0.4);
  --sf-text: #e2e8f0;
  --sf-muted: #94a3b8;
}

html, body {
  background: var(--sf-bg) !important;
  color: var(--sf-text) !important;
  font-family: "Exo 2", system-ui, sans-serif !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(59, 130, 246, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 95% 15%, rgba(168, 85, 247, 0.14), transparent 50%),
    radial-gradient(ellipse 45% 35% at 5% 85%, rgba(34, 211, 238, 0.1), transparent 50%),
    radial-gradient(ellipse 30% 20% at 70% 70%, rgba(99, 102, 241, 0.08), transparent);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

.header, .hero, .section, .footer, .mh-root, main {
  position: relative;
  z-index: 1;
}

.header {
  background: rgba(2, 6, 23, 0.88) !important;
  border-bottom: 1px solid var(--sf-border) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 4px 40px rgba(34, 211, 238, 0.1);
}

.header a, .logo, .nav a {
  font-family: "Orbitron", sans-serif !important;
  letter-spacing: 0.05em;
}

.logo, .header .brand, .logo-text {
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.55);
  background: linear-gradient(90deg, #67e8f9, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav a:hover {
  color: var(--sf-cyan) !important;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

.hero {
  position: relative !important;
  min-height: 560px !important;
  overflow: hidden !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  padding: 90px 0 70px !important;
}

#hero3d-canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.hero .container {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  font-family: "Orbitron", sans-serif !important;
  letter-spacing: 0.06em;
  background: rgba(34, 211, 238, 0.1) !important;
  border: 1px solid rgba(34, 211, 238, 0.35) !important;
  color: var(--sf-cyan) !important;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
  margin-bottom: 20px !important;
}

.hero h1 {
  font-family: "Orbitron", sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(2rem, 5vw, 3.2rem) !important;
  line-height: 1.15 !important;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #f8fafc 0%, #67e8f9 45%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(34, 211, 238, 0.25));
  margin-bottom: 14px !important;
}

.hero-sub {
  color: var(--sf-muted) !important;
  font-size: 1.05rem !important;
  max-width: 480px;
}

.hero-3d, .hero-visual {
  display: none !important;
}

.search-box {
  background: rgba(15, 23, 42, 0.7) !important;
  border: 1px solid var(--sf-border) !important;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.04) !important;
  backdrop-filter: blur(12px);
  border-radius: 14px !important;
}

.search-box:focus-within {
  border-color: rgba(34, 211, 238, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.3), 0 0 28px rgba(34, 211, 238, 0.2) !important;
}

.search-box input {
  color: #f1f5f9 !important;
  font-family: "Exo 2", sans-serif !important;
}

.hero-stats .stat {
  background: rgba(15, 23, 42, 0.55) !important;
  border: 1px solid var(--sf-border) !important;
  border-radius: 12px !important;
  padding: 12px 18px !important;
  backdrop-filter: blur(8px);
}

.stat-num {
  font-family: "Orbitron", sans-serif !important;
  color: var(--sf-cyan) !important;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
}

.section-title, .section-header h2 {
  font-family: "Orbitron", sans-serif !important;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #e2e8f0, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-alt {
  background: rgba(15, 23, 42, 0.35) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.12);
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

.tool-card, .category-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.55)) !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(14px) saturate(1.15);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
  position: relative;
  overflow: hidden;
}

.tool-card::before, .category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), transparent);
  opacity: 0.7;
}

.tool-card:hover, .category-card:hover {
  transform: translateY(-6px) scale(1.02) !important;
  border-color: rgba(34, 211, 238, 0.55) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(34, 211, 238, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.tool-card .tool-name, .tool-card h3, .tool-card strong {
  font-family: "Exo 2", sans-serif !important;
  color: #f1f5f9 !important;
}

.tool-card .tool-desc, .tool-card p, .tool-card small {
  color: var(--sf-muted) !important;
}

.badge.working {
  background: rgba(34, 211, 238, 0.15) !important;
  color: var(--sf-cyan) !important;
  border: 1px solid rgba(34, 211, 238, 0.3);
  font-family: "Orbitron", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.filter-btn {
  font-family: "Orbitron", sans-serif !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.06em;
  background: rgba(15, 23, 42, 0.7) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  color: var(--sf-muted) !important;
  border-radius: 999px !important;
  transition: all 0.2s ease !important;
}

.filter-btn:hover, .filter-btn.active {
  background: rgba(34, 211, 238, 0.12) !important;
  border-color: rgba(34, 211, 238, 0.5) !important;
  color: var(--sf-cyan) !important;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}

.btn, button.btn {
  font-family: "Orbitron", sans-serif !important;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #0ea5e9, #6366f1) !important;
  border: none !important;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.35) !important;
  border-radius: 10px !important;
}

.btn:hover {
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.55) !important;
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: none !important;
  color: var(--sf-cyan) !important;
}

.modal-content {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 0 60px rgba(34, 211, 238, 0.15), 0 25px 80px rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(20px);
  border-radius: 18px !important;
}

.modal-header {
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
}

.modal-title {
  font-family: "Orbitron", sans-serif !important;
  letter-spacing: 0.03em;
}

.footer {
  background: rgba(2, 6, 23, 0.95) !important;
  border-top: 1px solid var(--sf-border) !important;
}

.footer a:hover {
  color: var(--sf-cyan) !important;
}

.search-dropdown {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid var(--sf-border) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(34, 211, 238, 0.12) !important;
  backdrop-filter: blur(16px);
  border-radius: 12px !important;
}

.search-dropdown-item:hover {
  background: rgba(34, 211, 238, 0.1) !important;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0ea5e9, #7c3aed);
  border-radius: 4px;
}

@media (max-width: 768px) {
  .hero { min-height: 420px !important; padding: 70px 0 50px !important; }
  .hero h1 { font-size: 1.75rem !important; }
  .tool-card:hover { transform: translateY(-3px) !important; }
}


/* ===== FIX: search dropdown above stats ===== */
.hero .container {
  position: relative;
  z-index: 5;
}
.search-box {
  position: relative !important;
  z-index: 40 !important;
}
.search-dropdown,
#searchDropdown {
  position: absolute !important;
  left: 0;
  right: 0;
  top: calc(100% + 8px) !important;
  z-index: 100 !important;
  max-height: min(360px, 50vh);
  overflow-y: auto;
  display: none;
}
.search-dropdown.open,
#searchDropdown.open {
  display: block !important;
}
.hero-stats {
  position: relative;
  z-index: 2 !important;
  margin-top: 20px;
}
/* when search open, push stats down feel via dropdown covering */
.hero {
  overflow: visible !important;
}
.hero .container {
  overflow: visible !important;
}


/* ===== Search overlay fix ===== */
.search-box { position: relative !important; z-index: 40 !important; }
.search-box.is-open { z-index: 60 !important; }
.search-dropdown {
  z-index: 70 !important;
  position: absolute !important;
  left: 0; right: 0;
  top: calc(100% + 8px) !important;
  max-height: min(360px, 50vh);
  overflow-y: auto;
}
.hero-stats {
  position: relative;
  z-index: 5 !important;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.hero-stats.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* ===== Glowing homepage text ===== */
.hero h1 {
  animation: sfGlowPulse 3s ease-in-out infinite;
}
@keyframes sfGlowPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(34,211,238,0.35)) drop-shadow(0 0 28px rgba(168,85,247,0.2)); }
  50% { filter: drop-shadow(0 0 22px rgba(34,211,238,0.65)) drop-shadow(0 0 48px rgba(168,85,247,0.4)); }
}
.hero-sub {
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.25);
}

/* ===== Matrix / code rain background (replaces heavy Three.js) ===== */
#hero3d-canvas { display: none !important; }
.hero-code-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.55;
}
.hero-code-bg pre {
  position: absolute;
  top: 0;
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #22d3ee;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
  white-space: pre;
  animation: codeScroll 40s linear infinite;
  opacity: 0.35;
}
.hero-code-bg pre.p2 {
  left: 55%;
  color: #a855f7;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.45);
  animation-duration: 55s;
  animation-direction: reverse;
  opacity: 0.28;
}
@keyframes codeScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.hero-arch {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  opacity: 0.7;
  font-family: "JetBrains Mono", monospace;
  color: #67e8f9;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.6);
  font-size: 11px;
  line-height: 1.35;
  max-width: 280px;
  white-space: pre;
}
@media (max-width: 900px) {
  .hero-arch { display: none; }
  .hero-code-bg { opacity: 0.3; }
}

/* Search: never under stats */
.hero-stats.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  transition: opacity 0.15s ease;
}
.search-box {
  position: relative !important;
  z-index: 80 !important;
}
.search-dropdown {
  z-index: 90 !important;
  position: absolute !important;
  left: 0; right: 0;
  top: calc(100% + 8px) !important;
  max-height: min(360px, 50vh);
  overflow-y: auto;
}
.hero-stats {
  position: relative;
  z-index: 5 !important;
  transition: opacity 0.15s ease;
}

/* Glowing hero text */
.hero h1 {
  animation: textGlow 3s ease-in-out infinite alternate;
}
@keyframes textGlow {
  from { filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.35)); }
  to { filter: drop-shadow(0 0 28px rgba(168, 85, 247, 0.55)) drop-shadow(0 0 40px rgba(34, 211, 238, 0.35)); }
}
.hero-badge {
  animation: badgePulse 2.5s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 12px rgba(34, 211, 238, 0.2); }
  50% { box-shadow: 0 0 22px rgba(34, 211, 238, 0.45); }
}

/* Matrix / coding rain canvas */
#code-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}


/* CRITICAL: modal must overlay entire page — never position:relative */
.modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  display: none;
}
.modal.open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.modal-content {
  position: relative !important;
  z-index: 10001 !important;
  max-height: 90vh !important;
  overflow: auto !important;
  pointer-events: auto !important;
}
