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

/* Tilt Animation */
.tilt-hover {
  transition: transform 0.3s ease;
}

.tilt-hover:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) scale(1.02);
}

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

.marquee-content {
  display: flex;
  animation: marquee 40s linear infinite;
  will-change: transform;
}

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

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

/* Smooth Fade-In */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Pulse Glow Effect for CTAs */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(217, 119, 6, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(217, 119, 6, 0.8);
  }
}

.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ===========================
   TABLE RESPONSIVE WRAPPER
   =========================== */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #1a4d2e;
  border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #d97706;
}

/* ===========================
   PROSE STYLING FOR MARKDOWN
   =========================== */

.prose {
  color: #cbd5e1;
  max-width: 100%;
}

/* Headings */
.prose h2 {
  color: #f1f5f9;
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.prose h3 {
  color: #f1f5f9;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.75em;
  margin-bottom: 0.75em;
  line-height: 1.4;
}

.prose h4 {
  color: #f1f5f9;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.5;
}

/* Paragraphs */
.prose p {
  margin-top: 0;
  margin-bottom: 1.5em;
  line-height: 1.75;
  font-size: 1.125rem;
}

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

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

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

/* Strong & Bold */
.prose strong {
  color: #f1f5f9;
  font-weight: 700;
}

/* Lists */
.prose ul,
.prose ol {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  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;
  font-size: 1.125rem;
}

.prose li::marker {
  color: #1a4d2e;
  font-weight: 600;
}

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

/* Blockquotes */
.prose blockquote {
  font-style: italic;
  color: #94a3b8;
  border-left: 4px solid #1a4d2e;
  padding-left: 1.5em;
  margin-top: 2em;
  margin-bottom: 2em;
  background: rgba(26, 77, 46, 0.1);
  padding-top: 1em;
  padding-bottom: 1em;
  border-radius: 0.25rem;
}

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

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  margin-bottom: 2em;
  font-size: 1rem;
  overflow-x: auto;
  display: block;
}

.prose table thead {
  background: #1a4d2e;
}

.prose table thead th {
  color: #f1f5f9;
  font-weight: 700;
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid #0f2919;
}

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

.prose table tbody tr:hover {
  background: rgba(26, 77, 46, 0.15);
}

.prose table tbody td {
  padding: 0.875rem 1rem;
  color: #cbd5e1;
  vertical-align: top;
}

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

/* Make table wrapper scrollable */
.prose table {
  display: table;
  overflow-x: auto;
}

/* Code & Pre */
.prose code {
  color: #f59e0b;
  background: rgba(26, 77, 46, 0.2);
  padding: 0.25em 0.5em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-weight: 600;
}

.prose pre {
  background: #1e293b;
  color: #cbd5e1;
  padding: 1.5em;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 2em;
  margin-bottom: 2em;
  border: 1px solid #334155;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 400;
}

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

/* Horizontal Rule */
.prose hr {
  border: none;
  border-top: 2px solid #1a4d2e;
  margin-top: 3em;
  margin-bottom: 3em;
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
   =========================== */

@media (max-width: 768px) {
  .prose {
    font-size: 1rem;
  }

  .prose h2 {
    font-size: 1.5rem;
    margin-top: 1.5em;
  }

  .prose h3 {
    font-size: 1.25rem;
    margin-top: 1.25em;
  }

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

  .prose p,
  .prose li {
    font-size: 1rem;
    line-height: 1.6;
  }

  .prose ul,
  .prose ol {
    padding-left: 1.25em;
  }

  .prose table {
    font-size: 0.875rem;
  }

  .prose table thead th,
  .prose table tbody td {
    padding: 0.625rem 0.75rem;
  }
}

/* ===========================
   UTILITY OVERRIDES
   =========================== */

/* Ensure no dark-on-dark or light-on-light issues */
.bg-slate-900 .prose,
.bg-slate-800 .prose {
  color: #cbd5e1;
}

.bg-slate-900 .prose h2,
.bg-slate-900 .prose h3,
.bg-slate-900 .prose h4,
.bg-slate-800 .prose h2,
.bg-slate-800 .prose h3,
.bg-slate-800 .prose h4 {
  color: #f1f5f9;
}

/* Ensure table text visibility */
.prose table tbody td {
  color: #cbd5e1;
}

.prose table thead th {
  color: #f1f5f9;
}
