/* ============================================
   REGEX TESTER — PREMIUM HERO & TOOL STYLES
   Futuristic glassmorphism + neon glow design
   ============================================ */

/* ─── Google Fonts (additional) ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ─── CSS Variables ─── */
:root {
  --hero-bg: #07070f;
  --hero-glow-primary: #3b82f6;
  --hero-glow-secondary: #8b5cf6;
  --hero-glow-tertiary: #06b6d4;
  --hero-text: #ffffff;
  --hero-text-muted: #94a3b8;
  --hero-text-dim: #64748b;
  --hero-card-bg: rgba(15, 15, 30, 0.6);
  --hero-card-border: rgba(59, 130, 246, 0.15);
  --hero-card-border-hover: rgba(59, 130, 246, 0.35);
  --hero-accent: #3b82f6;
  --hero-accent-secondary: #8b5cf6;
  --hero-success: #22c55e;
  --hero-error: #ef4444;
  --hero-match-bg: rgba(34, 197, 94, 0.2);
  --hero-match-border: rgba(34, 197, 94, 0.4);
}

/* ─── Particles ─── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--hero-glow-primary);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
  box-shadow: 0 0 6px var(--hero-glow-primary), 0 0 12px rgba(59, 130, 246, 0.3);
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* ─── Hero Header ─── */
.hero-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 20px 32px;
  margin-bottom: 32px;
}

/* ─── Hero Badge ─── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 50px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--hero-glow-primary);
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
  animation: fadeInDown 0.6s ease-out both;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hero-glow-primary);
  animation: badgePulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--hero-glow-primary);
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--hero-glow-primary); }
  50% { opacity: 0.4; box-shadow: 0 0 16px var(--hero-glow-primary); }
}

/* ─── Hero Logo ─── */
.hero-logo-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: fadeInDown 0.6s ease-out 0.1s both;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hero-glow-primary);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-logo svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.hero-logo:hover {
  transform: scale(1.05) rotate(-3deg);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.hero-logo-glow {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
  animation: logoGlow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes logoGlow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* ─── Hero Title ─── */
.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  animation: fadeInDown 0.6s ease-out 0.2s both;
}

.hero-title-text {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: -2px;
  background: linear-gradient(135deg, #e2e8f0 0%, #ffffff 50%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.05;
}

.hero-title-accent {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--hero-glow-primary), var(--hero-glow-secondary), var(--hero-glow-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.05;
  position: relative;
}

.hero-title-accent::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--hero-glow-primary), var(--hero-glow-secondary));
  border-radius: 2px;
  opacity: 0.5;
  filter: blur(4px);
}

/* ─── Hero Subtitle ─── */
.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--hero-text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.2px;
  animation: fadeInDown 0.6s ease-out 0.3s both;
}

/* ─── Hero Stats ─── */
.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(15, 15, 30, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  animation: fadeInDown 0.6s ease-out 0.4s both;
  transition: all 0.3s ease;
}

.hero-stats:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.08);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-stat-value {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--hero-glow-primary), var(--hero-glow-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.hero-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--hero-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

/* ─── Tool Card ─── */
.tool-card {
  position: relative;
  overflow: visible !important;
  animation: fadeInUp 0.7s ease-out 0.5s both;
}

.tool-card .card-glow {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--hero-glow-primary), var(--hero-glow-secondary), var(--hero-glow-tertiary), var(--hero-glow-primary));
  background-size: 300% 300%;
  animation: gradientBorder 4s ease-in-out infinite;
  z-index: -1;
  opacity: 0.3;
  filter: blur(4px);
  transition: opacity 0.4s ease;
}

.tool-card:hover .card-glow {
  opacity: 0.6;
}

@keyframes gradientBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── Input Groups ─── */
.input-group {
  margin-bottom: 20px;
}

.input-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}

.input-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hero-text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.input-label svg {
  opacity: 0.6;
}

/* ─── Flags Input ─── */
.flags-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flags-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--hero-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flags-input {
  width: 100px !important;
  padding: 6px 10px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.82rem !important;
  text-align: center;
  letter-spacing: 2px;
  background: rgba(59, 130, 246, 0.06) !important;
  border-color: rgba(59, 130, 246, 0.15) !important;
  border-radius: 8px !important;
  color: var(--hero-glow-primary) !important;
  font-weight: 600 !important;
}

.flags-input:focus {
  border-color: var(--hero-glow-primary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.08) !important;
}

/* ─── Regex Input ─── */
.input-with-preview {
  position: relative;
}

.regex-input {
  width: 100%;
  padding: 14px 18px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.95rem !important;
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(59, 130, 246, 0.15) !important;
  border-radius: 12px !important;
  color: var(--hero-text) !important;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.regex-input:focus {
  border-color: var(--hero-glow-primary) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 0 30px rgba(59, 130, 246, 0.06) !important;
  background: rgba(0, 0, 0, 0.4) !important;
}

.regex-input::placeholder {
  color: var(--hero-text-dim);
  font-size: 0.85rem;
  opacity: 0.5;
}

.input-border-glow {
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--hero-glow-primary), var(--hero-glow-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.regex-input:focus ~ .input-border-glow {
  opacity: 0.3;
}

/* ─── Textarea ─── */
.textarea-wrapper {
  position: relative;
}

#regexText {
  width: 100%;
  padding: 14px 18px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.88rem !important;
  line-height: 1.7 !important;
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(59, 130, 246, 0.12) !important;
  border-radius: 12px !important;
  color: var(--hero-text) !important;
  outline: none;
  resize: vertical;
  min-height: 120px;
  transition: all 0.3s ease;
}

#regexText:focus {
  border-color: var(--hero-glow-primary) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 0 30px rgba(59, 130, 246, 0.06) !important;
  background: rgba(0, 0, 0, 0.4) !important;
}

#regexText::placeholder {
  color: var(--hero-text-dim);
  opacity: 0.4;
}

.textarea-border-glow {
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--hero-glow-primary), var(--hero-glow-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

#regexText:focus ~ .textarea-border-glow {
  opacity: 0.3;
}

/* ─── Action Bar ─── */
.action-bar {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--hero-glow-primary), var(--hero-glow-secondary)) !important;
  border: none !important;
  color: #fff !important;
  padding: 12px 28px !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
  transition: all 0.3s ease !important;
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4) !important;
}

.btn-primary:active {
  transform: translateY(0) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--hero-text-muted) !important;
  padding: 12px 24px !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  border-radius: 12px !important;
  transition: all 0.3s ease !important;
  gap: 8px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: var(--hero-text) !important;
  transform: translateY(-2px) !important;
}

/* ─── Results Panel ─── */
.results-panel {
  margin-top: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  min-height: 80px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.results-panel:not(:empty) {
  border-color: rgba(59, 130, 246, 0.2);
}

.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--hero-text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  min-height: 60px;
  opacity: 0.6;
}

/* ─── Match Highlighting ─── */
#regexResult .match {
  background: var(--hero-match-bg);
  border: 1px solid var(--hero-match-border);
  border-radius: 3px;
  padding: 1px 4px;
  margin: 0 1px;
  font-weight: 600;
  color: var(--hero-success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.15);
}

#regexResult .no-match {
  color: var(--hero-text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

#regexResult .match-count {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hero-success);
}

#regexResult .error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hero-error);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ─── Animations ─── */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-header {
    padding: 24px 16px 24px;
    margin-bottom: 24px;
  }

  .hero-logo {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }

  .hero-logo svg {
    width: 28px;
    height: 28px;
  }

  .hero-logo-glow {
    width: 80px;
    height: 80px;
  }

  .hero-title {
    gap: 8px;
  }

  .hero-title-text,
  .hero-title-accent {
    font-size: clamp(2rem, 7vw, 3rem);
    letter-spacing: -1.5px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    padding: 0 8px;
    margin-bottom: 24px;
  }

  .hero-stats {
    padding: 12px 20px;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-stat-value {
    font-size: 1.1rem;
  }

  .hero-stat-label {
    font-size: 0.65rem;
  }

  .hero-stat-divider {
    display: none;
  }

  .input-group-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .flags-wrapper {
    width: 100%;
  }

  .flags-input {
    flex: 1;
    width: auto !important;
  }

  .action-bar {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .results-panel {
    padding: 16px;
    font-size: 0.8rem;
  }
}

@media (max-width: 540px) {
  .hero-header {
    padding: 16px 12px 20px;
    margin-bottom: 20px;
  }

  .hero-badge {
    font-size: 0.65rem;
    padding: 4px 12px;
  }

  .hero-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .hero-logo svg {
    width: 24px;
    height: 24px;
  }

  .hero-logo-glow {
    width: 68px;
    height: 68px;
  }

  .hero-title-text,
  .hero-title-accent {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    letter-spacing: -1px;
  }

  .hero-subtitle {
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .hero-stats {
    padding: 10px 16px;
    gap: 12px;
    border-radius: 12px;
  }

  .hero-stat-value {
    font-size: 1rem;
  }

  .regex-input {
    font-size: 0.85rem !important;
    padding: 12px 14px !important;
  }

  #regexText {
    font-size: 0.82rem !important;
    padding: 12px 14px !important;
    min-height: 100px;
  }

  .results-panel {
    padding: 14px;
    font-size: 0.78rem;
    line-height: 1.6;
  }
}
