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

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.25rem);
  }
}

@keyframes tilt {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-1deg);
  }
  75% {
    transform: rotate(1deg);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 1.25rem rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 2rem rgba(212, 175, 55, 0.6);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-1.875rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.float-animation {
  animation: float 4s ease-in-out infinite;
}

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

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

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

.prose h2 {
  color: #d4af37;
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.3;
  position: relative;
  padding-bottom: 0.75rem;
}

.prose h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4rem;
  height: 0.25rem;
  background: linear-gradient(to right, #d4af37, transparent);
}

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

.prose h4 {
  color: #c0c8d8;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.875rem;
}

.prose p {
  color: #c0c8d8;
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

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

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

.prose a {
  color: #d4af37;
  text-decoration: underline;
  transition: color 0.2s ease;
}

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

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

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

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

.prose li {
  color: #c0c8d8;
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 0.625rem;
}

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

.prose ul ul,
.prose ol ul,
.prose ul ol,
.prose ol ol {
  margin-top: 0.625rem;
  margin-bottom: 0.625rem;
}

/* Blockquotes */
.prose blockquote {
  background: #1a2332;
  border-left: 0.25rem solid #d4af37;
  padding: 1.25rem 1.5rem;
  margin: 1.875rem 0;
  font-style: italic;
  color: #d4dae6;
  border-radius: 0.375rem;
}

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

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

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

.prose thead {
  background: #2a3142;
}

.prose th {
  color: #e8ebf2;
  font-weight: 600;
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 0.125rem solid #d4af37;
}

.prose td {
  color: #c0c8d8;
  padding: 0.875rem 1rem;
  border-bottom: 0.0625rem solid #3a4155;
}

.prose tbody tr:hover {
  background: #1a2332;
}

/* Ensure tables are scrollable */
.table-responsive {
  overflow-x: auto;
  width: 100%;
  display: block;
}

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

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2rem auto;
  display: block;
  border: 0.0625rem solid #3a4155;
  box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.3);
}

/* Code */
.prose code {
  background: #1a2332;
  color: #d4af37;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.9375rem;
  font-family: 'Courier New', monospace;
}

.prose pre {
  background: #0f1829;
  color: #c0c8d8;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 0.0625rem solid #2a3142;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Horizontal Rule */
.prose hr {
  border: none;
  height: 0.0625rem;
  background: linear-gradient(to right, transparent, #d4af37, transparent);
  margin: 2.5rem 0;
}

/* Responsive Typography */
@media (max-width: 768px) {
  .prose h2 {
    font-size: 1.625rem;
  }
  
  .prose h3 {
    font-size: 1.375rem;
  }
  
  .prose p,
  .prose li {
    font-size: 1rem;
  }
  
  .prose table {
    font-size: 0.875rem;
  }
  
  .prose th,
  .prose td {
    padding: 0.625rem 0.75rem;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Ensure mobile menu has visible background */
#mobile-menu {
  background: #0f1829 !important;
}

/* Remove any unwanted overflow on tables */
.prose table,
.table-responsive {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Accessibility improvements */
:focus-visible {
  outline: 0.125rem solid #d4af37;
  outline-offset: 0.25rem;
}

/* Selection styling */
::selection {
  background: #d4af37;
  color: #0a0e1a;
}
