/* Keyframe Animations */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5), 0 0 40px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.8), 0 0 60px rgba(245, 158, 11, 0.5);
  }
}

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

@keyframes spark-float {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-100px) scale(1);
  }
}

@keyframes parallax-slow {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(50px);
  }
}

/* Custom Utility Classes */
.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}

.parallax-bg {
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.marquee-content {
  display: flex;
  animation: marquee-scroll 20s linear infinite;
  width: max-content;
}

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

/* Duplicate content for seamless loop */
.marquee-content::after {
  content: '';
  display: flex;
}

/* Spark Effect */
.sparks {
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(220, 38, 38, 0.8), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(245, 158, 11, 0.8), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(220, 38, 38, 0.6), transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(245, 158, 11, 0.7), transparent);
  background-size: 200% 200%;
  animation: spark-float 4s ease-in-out infinite;
}

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

/* Prose Styling for Markdown Content */
.prose {
  color: #e5e7eb;
  max-width: 100%;
}

.prose h2 {
  color: #fbbf24;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3;
  background: linear-gradient(to right, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.prose h3 {
  color: #fca5a5;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.prose h4 {
  color: #fee2e2;
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.5;
}

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  line-height: 1.75;
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: #d1d5db;
}

.prose a {
  color: #fbbf24;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: #f59e0b;
}

.prose strong {
  color: #fef2f2;
  font-weight: 600;
}

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

.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}

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

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

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 1.75;
  color: #d1d5db;
}

.prose li::marker {
  color: #fbbf24;
}

.prose blockquote {
  font-style: italic;
  border-left: 0.25rem solid #dc2626;
  padding-left: 1em;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.1);
  padding-top: 0.75em;
  padding-bottom: 0.75em;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose table {
  width: 100%;
  table-layout: auto;
  text-align: left;
  margin-top: 2em;
  margin-bottom: 2em;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  border-collapse: collapse;
  border: 2px solid #991b1b;
  border-radius: 0.5rem;
  overflow: hidden;
  max-width: 100%;
}

.prose thead {
  background: linear-gradient(to bottom, #991b1b, #7f1d1d);
  border-bottom: 2px solid #dc2626;
}

.prose thead th {
  color: #fbbf24;
  font-weight: 600;
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

.prose tbody tr {
  border-bottom: 1px solid #7f1d1d;
  transition: background-color 0.2s ease;
}

.prose tbody tr:hover {
  background-color: rgba(220, 38, 38, 0.1);
}

.prose tbody td {
  padding: 0.75rem 1rem;
  color: #e5e7eb;
  vertical-align: middle;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin-top: 2em;
  margin-bottom: 2em;
  border: 2px solid #991b1b;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

.prose code {
  color: #fbbf24;
  font-weight: 500;
  font-size: 0.875em;
  background-color: rgba(220, 38, 38, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
}

.prose pre {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid #991b1b;
  border-radius: 0.5rem;
  padding: 1em;
  overflow-x: auto;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
}

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

.prose hr {
  border: 0;
  border-top: 2px solid #991b1b;
  margin-top: 3em;
  margin-bottom: 3em;
}

/* Responsive Typography Adjustments */
@media (max-width: 768px) {
  .prose {
    font-size: 1rem;
  }
  
  .prose table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .prose thead th,
  .prose tbody td {
    padding: 0.5rem 0.75rem;
  }
}

/* Ensure readable contrast */
.prose *::selection {
  background-color: rgba(220, 38, 38, 0.5);
  color: #fef2f2;
}

/* Additional readability improvements */
.prose p:first-of-type {
  font-size: clamp(1.0625rem, 2.25vw, 1.1875rem);
  line-height: 1.8;
}

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

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Accessibility: focus states */
a:focus,
button:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}
