/* ========================================
   NeonRush Pulse Flow Theme
   Custom CSS - Keyframes, Animations & Prose
   ======================================== */

/* CSS Custom Properties */
:root {
  --neon-primary: #00f0ff;
  --neon-secondary: #ff00e5;
  --neon-accent: #39ff14;
  --neon-gold: #ffd700;
  --dark-bg: #0a0a14;
  --dark-surface: #12121f;
  --dark-card: #1a1a2e;
  --dark-border: #2a2a4a;
  --text-bright: #f0f0ff;
  --text-muted: #a0a0c0;
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.4);
  --glow-magenta: 0 0 20px rgba(255, 0, 229, 0.4);
  --glow-green: 0 0 20px rgba(57, 255, 20, 0.4);
}

/* ========================================
   Keyframe Animations
   ======================================== */

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 5px var(--neon-primary), 0 0 10px var(--neon-primary), 0 0 20px rgba(0, 240, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-primary), 0 0 40px rgba(0, 240, 255, 0.5);
  }
}

@keyframes pulseGlowMagenta {
  0%, 100% {
    box-shadow: 0 0 5px var(--neon-secondary), 0 0 10px var(--neon-secondary), 0 0 20px rgba(255, 0, 229, 0.3);
  }
  50% {
    box-shadow: 0 0 10px var(--neon-secondary), 0 0 20px var(--neon-secondary), 0 0 40px rgba(255, 0, 229, 0.5);
  }
}

@keyframes floatParticle {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translateY(-15px) translateX(5px) scale(1.1);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-25px) translateX(-3px) scale(1);
    opacity: 0.7;
  }
  75% {
    transform: translateY(-10px) translateX(8px) scale(0.95);
    opacity: 0.85;
  }
}

@keyframes tiltHover {
  0%, 100% {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
  }
  75% {
    transform: perspective(1000px) rotateX(-2deg) rotateY(2deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes neonFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes particleRise {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

@keyframes borderGlow {
  0%, 100% {
    border-color: var(--neon-primary);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1), 0 0 10px rgba(0, 240, 255, 0.2);
  }
  50% {
    border-color: var(--neon-secondary);
    box-shadow: inset 0 0 10px rgba(255, 0, 229, 0.1), 0 0 10px rgba(255, 0, 229, 0.2);
  }
}

/* ========================================
   Animation Utility Classes
   ======================================== */

.animate-pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

.animate-pulse-glow-magenta {
  animation: pulseGlowMagenta 3s ease-in-out infinite;
}

.animate-float-particle {
  animation: floatParticle 6s ease-in-out infinite;
}

.animate-tilt {
  animation: tiltHover 8s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.animate-neon-flicker {
  animation: neonFlicker 4s ease-in-out infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

.animate-border-glow {
  animation: borderGlow 4s ease-in-out infinite;
}

/* Particle Container */
.particle-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: particleRise linear infinite;
}

.particle-cyan {
  background: radial-gradient(circle, var(--neon-primary) 0%, transparent 70%);
  box-shadow: 0 0 6px var(--neon-primary);
}

.particle-magenta {
  background: radial-gradient(circle, var(--neon-secondary) 0%, transparent 70%);
  box-shadow: 0 0 6px var(--neon-secondary);
}

.particle-green {
  background: radial-gradient(circle, var(--neon-accent) 0%, transparent 70%);
  box-shadow: 0 0 6px var(--neon-accent);
}

/* ========================================
   Component Overrides
   ======================================== */

/* Navigation */
.nav-link {
  position: relative;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--neon-primary);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Buttons */
.btn-neon-primary {
  background: linear-gradient(135deg, var(--neon-primary), #0080ff);
  color: var(--dark-bg);
  font-weight: 700;
  border: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-neon-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6), 0 0 40px rgba(0, 240, 255, 0.3);
}

.btn-neon-secondary {
  background: transparent;
  color: var(--neon-secondary);
  border: 2px solid var(--neon-secondary);
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-neon-secondary:hover {
  background: var(--neon-secondary);
  color: var(--dark-bg);
  box-shadow: 0 0 20px rgba(255, 0, 229, 0.5);
}

/* Cards */
.neon-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 1rem;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.neon-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--neon-primary);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.2), 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Game Cards */
.game-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  transition: transform 0.4s ease;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.8) 100%);
  z-index: 1;
  pointer-events: none;
}

.game-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) scale(1.05);
}

/* Bonus Badge */
.bonus-badge {
  background: linear-gradient(135deg, var(--dark-card) 0%, var(--dark-surface) 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.bonus-badge::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary), var(--neon-accent));
  border-radius: inherit;
  z-index: -1;
  animation: gradientShift 4s ease infinite;
  background-size: 200% 200%;
}

/* Table Responsive Wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* Neon Tables */
.neon-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 30rem;
}

.neon-table th {
  background: var(--dark-surface);
  color: var(--neon-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem;
  border-bottom: 2px solid var(--neon-primary);
}

.neon-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--dark-border);
  color: var(--text-bright);
}

.neon-table tr:hover td {
  background: rgba(0, 240, 255, 0.05);
}

/* Step badges */
.step-badge {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
  color: var(--dark-bg);
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: var(--glow-cyan);
}

/* Provider Cloud */
.provider-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.provider-tag:hover {
  border-color: var(--neon-primary);
  color: var(--neon-primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* FAQ Accordion */
.faq-item {
  border: 1px solid var(--dark-border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
  transition: border-color 0.3s ease;
}

.faq-item:hover {
  border-color: var(--neon-primary);
}

.faq-question {
  background: var(--dark-card);
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-bright);
  font-weight: 600;
  transition: background 0.3s ease;
}

.faq-question:hover {
  background: var(--dark-surface);
}

.faq-answer {
  background: var(--dark-surface);
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  color: var(--text-muted);
}

.faq-item.active .faq-answer {
  padding: 1.25rem;
  max-height: 500px;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* ========================================
   Prose Styling for Markdown Content
   ======================================== */

.prose {
  color: var(--text-bright);
  line-height: 1.75;
  max-width: 100%;
}

.prose > * + * {
  margin-top: 1.5em;
}

/* Headings */
.prose h2 {
  color: var(--neon-primary);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-top: 2.5em;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--dark-border);
  position: relative;
}

.prose h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 4rem;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
}

.prose h3 {
  color: var(--neon-secondary);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.prose h4 {
  color: var(--text-bright);
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* Paragraphs */
.prose p {
  margin-bottom: 1.25em;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2vw, 1.0625rem);
}

.prose p:first-of-type {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-bright);
}

/* Links */
.prose a {
  color: var(--neon-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.prose a:hover {
  color: var(--neon-secondary);
  border-bottom-color: var(--neon-secondary);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* Lists */
.prose ul,
.prose ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}

.prose ul {
  list-style: none;
}

.prose ul li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.75em;
  color: var(--text-muted);
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.5em;
  height: 0.5em;
  background: var(--neon-primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--neon-primary);
}

.prose ol {
  list-style: none;
  counter-reset: prose-counter;
}

.prose ol li {
  position: relative;
  padding-left: 2.5em;
  margin-bottom: 0.75em;
  color: var(--text-muted);
  counter-increment: prose-counter;
}

.prose ol li::before {
  content: counter(prose-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75em;
  height: 1.75em;
  background: var(--dark-surface);
  border: 1px solid var(--neon-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875em;
  font-weight: 600;
  color: var(--neon-primary);
}

/* Tables */
.prose .table-responsive {
  margin: 2em 0;
  border-radius: 0.75rem;
  border: 1px solid var(--dark-border);
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  min-width: 25rem;
}

.prose th {
  background: var(--dark-surface);
  color: var(--neon-primary);
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--neon-primary);
  white-space: nowrap;
}

.prose td {
  padding: 1rem;
  border-bottom: 1px solid var(--dark-border);
  color: var(--text-muted);
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose tr:hover td {
  background: rgba(0, 240, 255, 0.03);
}

/* Blockquotes */
.prose blockquote {
  margin: 2em 0;
  padding: 1.5em 2em;
  background: var(--dark-surface);
  border-left: 4px solid var(--neon-secondary);
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  color: var(--text-bright);
  position: relative;
}

.prose blockquote::before {
  content: '\201C';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-size: 3rem;
  color: var(--neon-secondary);
  opacity: 0.3;
  font-family: Georgia, serif;
}

.prose blockquote p {
  margin: 0;
  color: var(--text-bright);
}

/* Code */
.prose code {
  background: var(--dark-surface);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  color: var(--neon-accent);
  border: 1px solid var(--dark-border);
}

.prose pre {
  background: var(--dark-surface);
  padding: 1.5em;
  border-radius: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--dark-border);
}

.prose pre code {
  background: none;
  padding: 0;
  border: none;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2em 0;
  border: 1px solid var(--dark-border);
}

/* Strong & Emphasis */
.prose strong {
  color: var(--text-bright);
  font-weight: 600;
}

.prose em {
  color: var(--neon-secondary);
  font-style: italic;
}

/* Horizontal Rule */
.prose hr {
  margin: 3em 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-primary), var(--neon-secondary), transparent);
}

/* ========================================
   Utility Classes
   ======================================== */

.text-neon-cyan {
  color: var(--neon-primary);
}

.text-neon-magenta {
  color: var(--neon-secondary);
}

.text-neon-green {
  color: var(--neon-accent);
}

.text-neon-gold {
  color: var(--neon-gold);
}

.bg-dark {
  background-color: var(--dark-bg);
}

.bg-dark-surface {
  background-color: var(--dark-surface);
}

.bg-dark-card {
  background-color: var(--dark-card);
}

.border-neon-cyan {
  border-color: var(--neon-primary);
}

.border-neon-magenta {
  border-color: var(--neon-secondary);
}

.glow-cyan {
  box-shadow: var(--glow-cyan);
}

.glow-magenta {
  box-shadow: var(--glow-magenta);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile Menu */
.mobile-menu {
  background: var(--dark-surface);
  backdrop-filter: blur(10px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--dark-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-primary);
}

/* Selection */
::selection {
  background: var(--neon-primary);
  color: var(--dark-bg);
}

/* Focus States */
*:focus-visible {
  outline: 2px solid var(--neon-primary);
  outline-offset: 2px;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
  .prose h2 {
    margin-top: 2em;
  }
  
  .prose blockquote {
    padding: 1em 1.25em;
  }
  
  .step-badge {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .prose {
    font-size: 0.9375rem;
  }
  
  .prose ul li,
  .prose ol li {
    padding-left: 1.25em;
  }
  
  .prose ol li::before {
    width: 1.5em;
    height: 1.5em;
    font-size: 0.75em;
  }
}
