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

/* Particle Animation */
.particle-container {
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(56, 189, 248, 0.3), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(239, 68, 68, 0.3), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(186, 230, 253, 0.2), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(220, 38, 38, 0.2), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(125, 211, 252, 0.3), transparent),
    radial-gradient(1px 1px at 33% 80%, rgba(185, 28, 28, 0.2), transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  animation: particle-drift 20s ease-in-out infinite;
}

@keyframes particle-drift {
  0%, 100% {
    background-position: 0% 0%;
    opacity: 0.4;
  }
  50% {
    background-position: 100% 100%;
    opacity: 0.7;
  }
}

/* Tilt Card Animation */
.tilt-card {
  transition: transform 0.6s ease-out;
}

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

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

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

/* Glow Pulse */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 1.25rem rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 2rem rgba(239, 68, 68, 0.6);
  }
}

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

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

.prose {
  color: #bae6fd;
  max-width: 100%;
  line-height: 1.7;
}

/* Headings */
.prose h2 {
  color: #e0f2fe;
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2.5em;
  margin-bottom: 1em;
  line-height: 1.3;
  border-bottom: 2px solid #334155;
  padding-bottom: 0.5em;
}

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

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

/* Paragraphs */
.prose p {
  margin-top: 0;
  margin-bottom: 1.5em;
  line-height: 1.7;
}

.prose p:first-of-type {
  font-size: 1.125rem;
  line-height: 1.8;
}

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

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

/* Lists */
.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.5em;
  padding-left: 1.75em;
}

.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.7;
  padding-left: 0.375em;
}

.prose li::marker {
  color: #ef4444;
}

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

/* Blockquotes */
.prose blockquote {
  font-style: italic;
  border-left: 0.25rem solid #ef4444;
  padding-left: 1.5em;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  color: #7dd3fc;
  background-color: rgba(30, 41, 59, 0.4);
  padding-top: 1em;
  padding-bottom: 1em;
  border-radius: 0.5rem;
}

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

/* Tables */
.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  margin-bottom: 2em;
  background-color: rgba(30, 41, 59, 0.4);
  border-radius: 0.75rem;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.prose thead {
  background-color: #1a2332;
  border-bottom: 2px solid #334155;
}

.prose th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #e0f2fe;
  font-size: 0.9375rem;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #334155;
  color: #bae6fd;
}

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

.prose tbody tr:hover {
  background-color: rgba(51, 65, 85, 0.3);
}

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

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

/* Emphasis/Italic */
.prose em {
  font-style: italic;
  color: #7dd3fc;
}

/* Code */
.prose code {
  background-color: rgba(30, 41, 59, 0.6);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: #ef4444;
  font-family: 'Courier New', monospace;
}

.prose pre {
  background-color: rgba(30, 41, 59, 0.6);
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  border: 1px solid #334155;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  color: #bae6fd;
}

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

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

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

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

/* Ensure proper text contrast */
.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

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

/* Focus states for accessibility */
a:focus,
button:focus,
details:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Details/Summary styling */
details summary {
  cursor: pointer;
  user-select: none;
}

details[open] summary i {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

details summary i {
  transition: transform 0.3s ease;
}
