/* Animation Keyframes */
@keyframes tilt {
  0%, 100% {
    transform: rotate(-1deg);
  }
  50% {
    transform: rotate(1deg);
  }
}

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

@keyframes sparkle {
  0%, 100% {
    opacity: 0.5;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.animate-tilt {
  animation: tilt 3s ease-in-out infinite;
}

.animate-marquee {
  animation: marquee 20s linear infinite;
}

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

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

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

.prose-custom h2 {
  color: #f3f4f6;
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3;
  background: linear-gradient(to right, #9333ea, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.prose-custom h4 {
  color: #e5e7eb;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.4;
}

.prose-custom p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  color: #d1d5db;
  line-height: 1.75;
}

.prose-custom a {
  color: #06b6d4;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.prose-custom a:hover {
  color: #9333ea;
}

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

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

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

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

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

.prose-custom li::marker {
  color: #9333ea;
}

.prose-custom ul ul,
.prose-custom ul ol,
.prose-custom ol ul,
.prose-custom ol ol {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

.prose-custom blockquote {
  font-style: italic;
  border-left: 0.25rem solid #9333ea;
  padding-left: 1em;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  color: #9ca3af;
}

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

@media (min-width: 768px) {
  .prose-custom table {
    display: table;
  }
}

.prose-custom thead {
  background: linear-gradient(to right, rgba(147, 51, 234, 0.2), rgba(6, 182, 212, 0.2));
}

.prose-custom th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #f3f4f6;
  border-bottom: 2px solid rgba(147, 51, 234, 0.3);
}

.prose-custom td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(107, 114, 128, 0.3);
  color: #d1d5db;
}

.prose-custom tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

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

.prose-custom code {
  background-color: rgba(147, 51, 234, 0.1);
  color: #06b6d4;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: ui-monospace, monospace;
}

.prose-custom pre {
  background-color: #0f0a1f;
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin-top: 1.75em;
  margin-bottom: 1.75em;
}

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

/* Responsive Typography */
@media (max-width: 640px) {
  .prose-custom h2 {
    font-size: 1.5rem;
  }

  .prose-custom h3 {
    font-size: 1.25rem;
  }

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #070512;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #9333ea, #06b6d4);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #a855f7, #06b6d4);
}

/* Details/Summary Styling */
details[open] summary ~ * {
  animation: slideDown 0.3s ease-out;
}

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