/* ===================== Grezz — Futuristic Theme ===================== */

:root {
  --bg-void: #05060a;
  --bg-panel: rgba(18, 20, 32, 0.6);
  --border-glow: rgba(0, 255, 209, 0.25);
  --neon-teal: #00ffd1;
  --neon-purple: #a855f7;
  --neon-pink: #ff2e88;
  --text-primary: #e7f6ff;
  --text-dim: #8b93a7;
  --critical: #ff4d6d;
  --warning: #ffb020;
  --info: #4fd1ff;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ---------- Animated background: aurora blobs + grid ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,255,209,0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(168,85,247,0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(255,46,136,0.08), transparent 60%),
    var(--bg-void);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0,255,209,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,209,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black 40%, transparent 90%);
  animation: grid-drift 30s linear infinite;
}

@keyframes grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 48px 96px, 96px 48px; }
}

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  z-index: -1;
  animation: float 14s ease-in-out infinite;
}
.orb-1 { width: 420px; height: 420px; background: var(--neon-teal); top: -100px; left: -120px; animation-delay: 0s; }
.orb-2 { width: 360px; height: 360px; background: var(--neon-purple); top: 30%; right: -140px; animation-delay: -4s; }
.orb-3 { width: 320px; height: 320px; background: var(--neon-pink); bottom: -120px; left: 30%; animation-delay: -8s; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  33% { transform: translateY(30px) translateX(20px) scale(1.08); }
  66% { transform: translateY(-20px) translateX(-25px) scale(0.95); }
}

/* ---------- Glass panels ---------- */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
}

.glass-glow {
  position: relative;
}
.glass-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  padding: 1px;
  background: linear-gradient(120deg, var(--neon-teal), var(--neon-purple), var(--neon-pink), var(--neon-teal));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradient-spin 6s linear infinite;
  opacity: 0.6;
  pointer-events: none;
}
@keyframes gradient-spin {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(5,6,10,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo-text {
  background: linear-gradient(90deg, var(--neon-teal), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Hero ---------- */
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(90deg, var(--neon-teal) 0%, var(--neon-purple) 50%, var(--neon-pink) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine {
  to { background-position: 200% center; }
}

.typing-caret {
  display: inline-block;
  width: 3px;
  background: var(--neon-teal);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Buttons ---------- */
.btn-neon {
  position: relative;
  background: linear-gradient(90deg, var(--neon-teal), var(--neon-purple));
  color: #05060a;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 0.9em 1.8em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 20px rgba(0,255,209,0.25);
}
.btn-neon:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 34px rgba(0,255,209,0.45), 0 0 60px rgba(168,85,247,0.25);
}
.btn-neon:active { transform: translateY(0) scale(0.99); }
.btn-neon:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.url-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  color: var(--text-primary);
  padding: 0.95em 1.2em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.url-input:focus {
  outline: none;
  border-color: var(--neon-teal);
  box-shadow: 0 0 0 4px rgba(0,255,209,0.12);
}

/* ---------- Score gauge ---------- */
.gauge-ring {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.gauge-ring circle.progress {
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 8px currentColor);
}
.gauge-number {
  font-size: 3rem;
  font-weight: 800;
}

/* ---------- Category bars ---------- */
.cat-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-teal), var(--neon-purple));
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(0,255,209,0.5);
}

/* ---------- Cards ---------- */
.issue-card, .rec-card {
  border-left: 3px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.issue-card:hover, .rec-card:hover {
  transform: translateX(4px);
  background: rgba(255,255,255,0.04);
}
.sev-critical { border-left-color: var(--critical); }
.sev-warning { border-left-color: var(--warning); }
.sev-info { border-left-color: var(--info); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25em 0.7em;
  border-radius: 999px;
}
.badge-critical { background: rgba(255,77,109,0.15); color: var(--critical); }
.badge-warning { background: rgba(255,176,32,0.15); color: var(--warning); }
.badge-info { background: rgba(79,209,255,0.15); color: var(--info); }

/* ---------- Loading spinner (HTMX indicator) ---------- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }
.htmx-request.btn-neon-label { opacity: 0; }

.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(5,6,10,0.25);
  border-top-color: #05060a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reveal-on-load animation ---------- */
.reveal {
  animation: reveal-up 0.6s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal-delay-1 { animation-delay: 0.08s; }
.reveal-delay-2 { animation-delay: 0.16s; }
.reveal-delay-3 { animation-delay: 0.24s; }

/* ---------- Ad slot styling ---------- */
.ad-slot {
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 90px;
}
.ad-slot-label {
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--bg-void);
  padding: 0 8px;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ---------- Logo ---------- */
.logo-float {
  animation: logo-float 5s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(0,255,209,0.25));
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

#chat-log::-webkit-scrollbar { width: 6px; }
#chat-log::-webkit-scrollbar-thumb { background: rgba(0,255,209,0.3); border-radius: 4px; }

/* ---------- Cursor glow ---------- */
#cursor-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,209,0.10), transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  will-change: left, top;
}
@media (hover: none) { #cursor-glow { display: none; } }

/* ---------- Mobile nav ---------- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16,1,0.3,1);
}
.mobile-menu.open { max-height: 240px; }

/* ---------- Card tilt-on-hover ---------- */
.tilt-card {
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), box-shadow 0.35s ease;
  transform-style: preserve-3d;
}
.tilt-card:hover {
  box-shadow: 0 20px 40px -20px rgba(0,255,209,0.25);
}

/* ---------- Skeleton loading ---------- */
.skeleton-line {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Scroll reveal (IntersectionObserver-driven) ---------- */
.reveal-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- FAQ accordion ---------- */
.faq-item summary {
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .faq-chevron { transition: transform 0.3s ease; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-item[open] .faq-answer { animation: reveal-up 0.35s ease both; }

/* ---------- Loading status cycler ---------- */
.loading-status {
  font-size: 0.8rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: rgba(0,255,209,0.25); border-radius: 6px; }
