/* Animations */
@keyframes particle-float {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-20px) translateX(10px);
    opacity: 0.6;
  }
}

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

.particles-bg::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(96, 165, 250, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.15) 0%, transparent 50%);
  animation: particle-float 8s ease-in-out infinite;
}

.tilt-card {
  animation: tilt 6s ease-in-out infinite;
  transform-style: preserve-3d;
}

.tilt-card:hover {
  animation-play-state: paused;
}

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

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

.prose h2 {
  color: #ffffff;
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.prose h3 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.prose h4 {
  color: #60a5fa;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.4em;
  margin-bottom: 0.6em;
}

.prose p {
  margin-top: 0;
  margin-bottom: 1.25em;
  line-height: 1.75;
  font-size: 1rem;
}

.prose a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s;
}

.prose a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

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

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

.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;
}

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

.prose ul > li::marker {
  color: #60a5fa;
}

.prose ol > li::marker {
  color: #60a5fa;
  font-weight: 600;
}

.prose table {
  width: 100%;
  max-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  margin-top: 2em;
  margin-bottom: 2em;
  font-size: 0.875rem;
  overflow-x: auto;
  display: block;
}

.prose thead {
  border-bottom: 2px solid rgba(96, 165, 250, 0.3);
}

.prose thead th {
  color: #ffffff;
  font-weight: 600;
  vertical-align: bottom;
  padding: 0.75rem 1rem;
  text-align: left;
  background-color: rgba(21, 34, 56, 0.5);
}

.prose tbody tr {
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
  transition: background-color 0.2s;
}

.prose tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

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

.prose blockquote {
  font-style: italic;
  border-left: 0.25rem solid #60a5fa;
  padding-left: 1.5em;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  color: #d1d5db;
  background-color: rgba(37, 99, 235, 0.1);
  padding-top: 1em;
  padding-bottom: 1em;
  padding-right: 1em;
  border-radius: 0.375rem;
}

.prose blockquote p {
  margin-top: 0;
  margin-bottom: 0;
}

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

.prose hr {
  border: 0;
  border-top: 1px solid rgba(96, 165, 250, 0.2);
  margin-top: 3em;
  margin-bottom: 3em;
}

.prose code {
  color: #fbbf24;
  font-size: 0.875em;
  font-weight: 500;
  background-color: rgba(251, 191, 36, 0.1);
  padding: 0.25em 0.4em;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prose pre {
  background-color: rgba(10, 22, 40, 0.8);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 0.5rem;
  padding: 1.25em 1.5em;
  overflow-x: auto;
  margin-top: 1.75em;
  margin-bottom: 1.75em;
}

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

/* Responsive Typography */
@media (max-width: 640px) {
  .prose h2 {
    font-size: 1.5rem;
  }
  
  .prose h3 {
    font-size: 1.25rem;
  }
  
  .prose table {
    font-size: 0.8125rem;
  }
  
  .prose thead th,
  .prose tbody td {
    padding: 0.5rem 0.75rem;
  }
}

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

/* Details/Summary Enhancement */
details summary::-webkit-details-marker {
  display: none;
}

details[open] summary ~ * {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
