/* Parallax Background Animation */
.parallax-bg {
  transform: translateZ(0);
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .parallax-bg {
    animation: parallax 20s ease-in-out infinite;
  }
}

@keyframes parallax {
  0%,
  100% {
    transform: translateY(0) scale(1.1);
  }
  50% {
    transform: translateY(-20px) scale(1.15);
  }
}

/* Marquee Animation */
.marquee-container {
  position: relative;
  width: 100%;
}

.marquee-content {
  display: flex;
  animation: marquee 30s linear infinite;
}

.marquee-content:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Neon Pulse Animation */
.neon-pulse {
  animation: neon-pulse 3s ease-in-out infinite;
}

@keyframes neon-pulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 40px rgba(139, 92, 246, 0.2), 0 0 60px rgba(139, 92, 246, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5), 0 0 60px rgba(139, 92, 246, 0.3), 0 0 90px rgba(139, 92, 246, 0.2);
  }
}

/* Neon Grid Background */
.neon-grid {
  background-image: linear-gradient(rgba(139, 92, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 50px 50px;
  }
}

/* Enhanced Prose Styling for Markdown Content with Typography Best Practices */
.prose-custom {
  color: #e5e7eb;
  line-height: 1.75;
  max-width: 100%;
  font-size: 1rem;
}

/* Headings with proper hierarchy and spacing */
.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4,
.prose-custom h5,
.prose-custom h6 {
  color: #f9fafb;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-top: 2em;
  margin-bottom: 1em;
}

.prose-custom h1 {
  font-size: 2.5em;
  background: linear-gradient(135deg, #c4b5fd 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.prose-custom h2 {
  font-size: 2em;
  color: #c4b5fd;
  border-bottom: 2px solid rgba(167, 139, 250, 0.3);
  padding-bottom: 0.5em;
}

.prose-custom h3 {
  font-size: 1.625em;
  color: #a78bfa;
}

.prose-custom h4 {
  font-size: 1.375em;
  color: #93c5fd;
}

.prose-custom h5 {
  font-size: 1.125em;
  color: #d1d5db;
}

.prose-custom h6 {
  font-size: 1em;
  color: #d1d5db;
  font-weight: 600;
}

/* First paragraph after heading - reduced top margin */
.prose-custom h1 + p,
.prose-custom h2 + p,
.prose-custom h3 + p,
.prose-custom h4 + p {
  margin-top: 0.75em;
}

/* Paragraphs with optimal line length and spacing */
.prose-custom p {
  margin-bottom: 1.5em;
  max-width: 75ch;
}

.prose-custom p:last-child {
  margin-bottom: 0;
}

/* Links with hover effects */
.prose-custom a {
  color: #a78bfa;
  text-decoration: underline;
  text-decoration-color: rgba(167, 139, 250, 0.4);
  text-underline-offset: 0.2em;
  transition: all 0.2s ease;
}

.prose-custom a:hover {
  color: #c4b5fd;
  text-decoration-color: rgba(196, 181, 253, 0.8);
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}

/* Lists with proper spacing and styling */
.prose-custom ul,
.prose-custom ol {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  padding-left: 2em;
}

.prose-custom ul {
  list-style-type: disc;
}

.prose-custom ul ul {
  list-style-type: circle;
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

.prose-custom ul ul ul {
  list-style-type: square;
}

.prose-custom ol {
  list-style-type: decimal;
}

.prose-custom ol ol {
  list-style-type: lower-alpha;
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

.prose-custom li {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
  line-height: 1.6;
}

.prose-custom li > p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Nested lists */
.prose-custom li > ul,
.prose-custom li > ol {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

/* Strong and emphasis */
.prose-custom strong {
  color: #f9fafb;
  font-weight: 700;
}

.prose-custom em {
  font-style: italic;
  color: #d1d5db;
}

.prose-custom strong em,
.prose-custom em strong {
  color: #f9fafb;
}

/* Code elements */
.prose-custom code {
  color: #c4b5fd;
  background-color: rgba(139, 92, 246, 0.15);
  padding: 0.25em 0.5em;
  border-radius: 0.375rem;
  font-size: 0.9em;
  font-family: "Courier New", Courier, monospace;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.prose-custom pre {
  background-color: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 0.5rem;
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
}

.prose-custom pre code {
  background-color: transparent;
  padding: 0;
  border: none;
  font-size: 0.875em;
  line-height: 1.7;
}

/* Blockquotes */
.prose-custom blockquote {
  border-left: 0.375rem solid #a78bfa;
  padding-left: 1.5em;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  font-style: italic;
  color: #d1d5db;
  margin: 2em 0;
  background-color: rgba(139, 92, 246, 0.05);
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose-custom blockquote p {
  margin-bottom: 0.75em;
}

.prose-custom blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables with responsive wrapper */
.prose-custom table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.9375em;
  background-color: rgba(17, 24, 39, 0.5);
  border-radius: 0.5rem;
  overflow: hidden;
}

.prose-custom thead {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(96, 165, 250, 0.3) 100%);
}

.prose-custom th {
  padding: 1em 1.25em;
  text-align: left;
  font-weight: 700;
  color: #f9fafb;
  border-bottom: 2px solid rgba(167, 139, 250, 0.5);
  white-space: nowrap;
}

.prose-custom td {
  padding: 1em 1.25em;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  color: #e5e7eb;
}

.prose-custom tbody tr {
  transition: background-color 0.2s ease;
}

.prose-custom tbody tr:hover {
  background-color: rgba(139, 92, 246, 0.1);
}

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

/* Table responsive wrapper - must be applied to parent div */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2em 0;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.table-responsive table {
  margin: 0;
}

/* Images */
.prose-custom img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2em 0;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3), 0 0 60px rgba(96, 165, 250, 0.2);
  border: 2px solid rgba(167, 139, 250, 0.3);
}

/* Horizontal rules */
.prose-custom hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(167, 139, 250, 0.5) 50%, transparent 100%);
  margin: 3em 0;
}

/* Figure and figcaption */
.prose-custom figure {
  margin: 2em 0;
  max-width: 100%;
}

.prose-custom figcaption {
  color: #9ca3af;
  font-size: 0.875em;
  text-align: center;
  margin-top: 0.75em;
  font-style: italic;
}

/* Definition lists */
.prose-custom dl {
  margin: 1.5em 0;
}

.prose-custom dt {
  color: #f9fafb;
  font-weight: 700;
  margin-top: 1em;
}

.prose-custom dd {
  margin-left: 2em;
  margin-top: 0.5em;
  color: #d1d5db;
}

/* Abbreviations */
.prose-custom abbr {
  text-decoration: underline dotted;
  text-decoration-color: rgba(167, 139, 250, 0.5);
  cursor: help;
}

/* Small text */
.prose-custom small {
  font-size: 0.875em;
  color: #9ca3af;
}

/* Subscript and superscript */
.prose-custom sub,
.prose-custom sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.prose-custom sup {
  top: -0.5em;
}

.prose-custom sub {
  bottom: -0.25em;
}

/* Lead paragraph styling */
.prose-custom .lead {
  font-size: 1.25em;
  line-height: 1.6;
  color: #f3f4f6;
  margin-bottom: 1.5em;
}

/* Responsive typography adjustments */
@media (max-width: 640px) {
  .prose-custom {
    font-size: 0.9375rem;
  }

  .prose-custom h1 {
    font-size: 2em;
  }

  .prose-custom h2 {
    font-size: 1.625em;
  }

  .prose-custom h3 {
    font-size: 1.375em;
  }

  .prose-custom h4 {
    font-size: 1.125em;
  }

  .prose-custom table {
    font-size: 0.875em;
  }

  .prose-custom th,
  .prose-custom td {
    padding: 0.75em 1em;
  }
}

@media (min-width: 1024px) {
  .prose-custom {
    font-size: 1.0625rem;
  }
}

/* Table Responsive Wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
}

/* Smooth Transitions */
* {
  transition-property: color, background-color, border-color, transform, opacity;
  transition-duration: 200ms;
  transition-timing-function: ease-in-out;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
