/* Particle Animation */
.particle-container {
  position: relative;
  overflow: hidden;
}

.particle-container::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(212, 175, 55, 0.3), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(212, 175, 55, 0.2), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(212, 175, 55, 0.4), transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(212, 175, 55, 0.25), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(212, 175, 55, 0.35), transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
  0%, 100% {
    background-position: 0% 0%;
    opacity: 1;
  }
  25% {
    background-position: 100% 50%;
    opacity: 0.8;
  }
  50% {
    background-position: 50% 100%;
    opacity: 1;
  }
  75% {
    background-position: 0% 50%;
    opacity: 0.9;
  }
}

/* Tilt Card Animation */
.tilt-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) scale(1.02);
  box-shadow: 0 20px 40px rgba(212, 175, 55, 0.2);
}

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

/* Prose Styling for Markdown Content */
.prose-custom {
  color: #d1d5db;
  line-height: 1.75;
}

.prose-custom h2 {
  color: #f0d070;
  font-size: 2em;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.prose-custom h3 {
  color: #d4af37;
  font-size: 1.5em;
  font-weight: 600;
  margin-top: 1.25em;
  margin-bottom: 0.625em;
  line-height: 1.4;
}

.prose-custom h4 {
  color: #d4af37;
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.5em;
  line-height: 1.4;
}

.prose-custom p {
  margin-top: 0;
  margin-bottom: 1.25em;
  color: #d1d5db;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose-custom a {
  color: #d4af37;
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 55, 0.4);
  transition: all 0.2s ease;
}

.prose-custom a:hover {
  color: #f0d070;
  text-decoration-color: rgba(240, 208, 112, 0.8);
}

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

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

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

.prose-custom ul > li {
  padding-left: 0.375em;
  position: relative;
}

.prose-custom ul > li::marker {
  color: #d4af37;
}

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

.prose-custom blockquote {
  font-style: italic;
  border-left: 0.25rem solid #d4af37;
  padding-left: 1.5em;
  margin: 1.5em 0;
  color: #9ca3af;
  background: rgba(212, 175, 55, 0.05);
  padding-top: 0.75em;
  padding-bottom: 0.75em;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose-custom img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5em 0;
  border: 0.125rem solid rgba(212, 175, 55, 0.2);
}

.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9375em;
  overflow-x: auto;
  display: block;
}

.prose-custom thead {
  background: linear-gradient(to right, rgba(212, 175, 55, 0.2), rgba(184, 148, 31, 0.2));
  border-bottom: 0.125rem solid rgba(212, 175, 55, 0.4);
}

.prose-custom th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #f0d070;
  border-bottom: 0.0625rem solid rgba(212, 175, 55, 0.3);
}

.prose-custom td {
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid rgba(212, 175, 55, 0.15);
  color: #d1d5db;
}

.prose-custom tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
  transition: background 0.2s ease;
}

.prose-custom code {
  background: rgba(212, 175, 55, 0.1);
  color: #f0d070;
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

.prose-custom pre {
  background: #1a1a24;
  padding: 1.25em;
  border-radius: 0.5rem;
  overflow-x: auto;
  border: 0.0625rem solid rgba(212, 175, 55, 0.2);
  margin: 1.5em 0;
}

.prose-custom pre code {
  background: transparent;
  padding: 0;
  color: #d1d5db;
}

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

.table-responsive table {
  display: table;
  width: 100%;
  min-width: 37.5rem;
}

/* Ensure proper spacing and readability */
.prose-custom > :first-child {
  margin-top: 0;
}

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

/* Responsive adjustments */
@media (max-width: 48rem) {
  .prose-custom {
    font-size: 1rem;
  }
  
  .prose-custom h2 {
    font-size: 1.75em;
  }
  
  .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.625rem 0.75rem;
  }
}

/* High contrast for better readability */
@media (prefers-contrast: high) {
  .prose-custom {
    color: #f3f4f6;
  }
  
  .prose-custom h2,
  .prose-custom h3,
  .prose-custom h4 {
    color: #fde68a;
  }
}
