/* ===========================
   ANIMATIONS & KEYFRAMES
   =========================== */

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3), 0 0 40px rgba(56, 189, 248, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5), 0 0 60px rgba(56, 189, 248, 0.3);
  }
}

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

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Glow effect class */
.glow-effect {
  animation: glow-pulse 3s ease-in-out infinite;
}

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

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

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

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

/* Fade in animation */
.fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

/* Parallax elements */
.parallax {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* ===========================
   PROSE STYLING
   =========================== */

.prose {
  color: rgb(226, 232, 240);
  max-width: 100%;
}

/* Headings */
.prose h2 {
  color: rgb(125, 211, 252);
  font-size: 2rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.prose h3 {
  color: rgb(165, 243, 252);
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.prose h4 {
  color: rgb(186, 230, 253);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* Paragraphs */
.prose p {
  color: rgb(203, 213, 225);
  font-size: 1.125rem;
  line-height: 1.75;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

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

/* Links */
.prose a {
  color: rgb(56, 189, 248);
  text-decoration: underline;
  text-underline-offset: 0.25rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: rgb(125, 211, 252);
}

/* Strong */
.prose strong {
  color: rgb(165, 243, 252);
  font-weight: 600;
}

/* Lists */
.prose ul,
.prose ol {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding-left: 0;
  list-style: none;
}

.prose ul li,
.prose ol li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
  color: rgb(203, 213, 225);
  line-height: 1.75;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.75rem;
  width: 0.5rem;
  height: 0.5rem;
  background: linear-gradient(135deg, rgb(56, 189, 248), rgb(14, 165, 233));
  border-radius: 50%;
}

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

.prose ol li {
  counter-increment: list-counter;
}

.prose ol li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0.125rem;
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(135deg, rgb(56, 189, 248), rgb(14, 165, 233));
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nested lists */
.prose ul ul,
.prose ol ul,
.prose ul ol,
.prose ol ol {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Blockquotes */
.prose blockquote {
  border-left: 0.25rem solid rgb(56, 189, 248);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: rgb(186, 230, 253);
  background: rgba(56, 189, 248, 0.05);
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose blockquote p {
  margin-bottom: 0.5rem;
}

/* Tables */
.prose table {
  width: 100%;
  max-width: 100%;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.5;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.prose thead {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 2px solid rgba(56, 189, 248, 0.3);
}

.prose thead th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  color: rgb(165, 243, 252);
  font-size: 1rem;
}

.prose tbody tr {
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  transition: background-color 0.2s ease;
}

.prose tbody tr:hover {
  background: rgba(30, 41, 59, 0.3);
}

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

.prose tbody td {
  padding: 1rem 1.5rem;
  color: rgb(203, 213, 225);
}

/* Table responsive wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.table-responsive table {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Code */
.prose code {
  background: rgba(56, 189, 248, 0.1);
  color: rgb(125, 211, 252);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.9em;
  font-family: ui-monospace, monospace;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.prose pre {
  background: rgba(15, 23, 42, 0.8);
  color: rgb(226, 232, 240);
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

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

/* Horizontal rules */
.prose hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, rgb(56, 189, 248), transparent);
  margin: 3rem 0;
  border-radius: 1rem;
}

/* ===========================
   RESPONSIVE UTILITIES
   =========================== */

/* Ensure all elements are responsive */
* {
  max-width: 100%;
  box-sizing: border-box;
}

/* Prevent horizontal overflow */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===========================
   CUSTOM SCROLLBAR
   =========================== */

::-webkit-scrollbar {
  width: 0.75rem;
  height: 0.75rem;
}

::-webkit-scrollbar-track {
  background: rgb(15, 23, 42);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgb(56, 189, 248), rgb(14, 165, 233));
  border-radius: 0.375rem;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgb(125, 211, 252), rgb(56, 189, 248));
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgb(56, 189, 248) rgb(15, 23, 42);
}

/* ===========================
   SMOOTH SCROLL
   =========================== */

html {
  scroll-behavior: smooth;
}

/* ===========================
   ACCESSIBILITY
   =========================== */

/* Focus styles */
a:focus,
button:focus {
  outline: 2px solid rgb(56, 189, 248);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
