/* Master Spinforge Theme - Custom Styles */

/* Parallax Effect */
.parallax-bg {
  transform: translateZ(-1px) scale(2);
  will-change: transform;
}

/* Animated Sparks */
.spark-container {
  pointer-events: none;
}

@keyframes spark-float {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(100px) scale(1);
    opacity: 0;
  }
}

.spark-container::before,
.spark-container::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #ff6b35 0%, #ffb74d 50%, transparent 70%);
  border-radius: 50%;
  animation: spark-float 8s infinite;
  box-shadow: 0 0 10px #ff6b35, 0 0 20px #ff6b35;
}

.spark-container::before {
  left: 20%;
  animation-delay: 0s;
  animation-duration: 10s;
}

.spark-container::after {
  left: 70%;
  animation-delay: 3s;
  animation-duration: 12s;
}

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

.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%);
  }
}

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

::-webkit-scrollbar-track {
  background: #1a2332;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b5a7d 0%, #4a90e2 100%);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4a90e2 0%, #ff6b35 100%);
}

/* Enhanced Prose Styling for Markdown Content - Comprehensive typography with relative units */
.prose,
.prose-custom {
  max-width: 100%;
  color: #d1d5db;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.75;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prose img,
.prose-custom img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2rem auto;
  display: block;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
}

.prose p,
.prose-custom p {
  margin-bottom: 1.5em;
  margin-top: 0;
  color: #d1d5db;
  line-height: 1.8;
}

.prose p:first-of-type,
.prose-custom p:first-of-type {
  font-size: 1.05em;
  line-height: 1.7;
}

/* Headings with proper hierarchy and contrast */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6,
.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4,
.prose-custom h5,
.prose-custom h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.prose h1,
.prose-custom h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.5rem);
  color: #4a90e2;
  text-shadow: 0 0 1.5rem rgba(74, 144, 226, 0.3);
  margin-top: 0;
}

.prose h2,
.prose-custom h2 {
  font-size: clamp(1.625rem, 1.25rem + 1.5vw, 2rem);
  color: #4a90e2;
  border-bottom: 2px solid rgba(74, 144, 226, 0.3);
  padding-bottom: 0.5em;
}

.prose h3,
.prose-custom h3 {
  font-size: clamp(1.375rem, 1.125rem + 1vw, 1.625rem);
  color: #e5e7eb;
}

.prose h4,
.prose-custom h4 {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: #e5e7eb;
}

.prose h5,
.prose-custom h5 {
  font-size: 1.125rem;
  color: #d1d5db;
}

.prose h6,
.prose-custom h6 {
  font-size: 1rem;
  color: #d1d5db;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Links with clear contrast */
.prose a,
.prose-custom a {
  color: #4a90e2;
  text-decoration: underline;
  text-decoration-color: rgba(74, 144, 226, 0.4);
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.2em;
  transition: all 0.2s ease;
  font-weight: 500;
}

.prose a:hover,
.prose-custom a:hover {
  color: #ff6b35;
  text-decoration-color: rgba(255, 107, 53, 0.6);
  text-shadow: 0 0 0.5rem rgba(255, 107, 53, 0.3);
}

/* Lists with proper spacing */
.prose ul,
.prose ol,
.prose-custom ul,
.prose-custom ol {
  margin-top: 1.25em;
  margin-bottom: 1.5em;
  padding-left: 1.75em;
  color: #d1d5db;
}

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

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

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

.prose ul ul,
.prose ol ul,
.prose-custom ul ul,
.prose-custom ol ul {
  list-style-type: circle;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

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

.prose li > p,
.prose-custom li > p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Strong and emphasis */
.prose strong,
.prose b,
.prose-custom strong,
.prose-custom b {
  font-weight: 700;
  color: #ffffff;
}

.prose em,
.prose i,
.prose-custom em,
.prose-custom i {
  font-style: italic;
  color: #e5e7eb;
}

/* Code and preformatted text */
.prose code,
.prose-custom code {
  background: rgba(59, 90, 125, 0.4);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: #ffb74d;
  font-family: 'Courier New', monospace;
  border: 1px solid rgba(74, 144, 226, 0.2);
}

.prose pre,
.prose-custom pre {
  background: rgba(26, 35, 50, 0.8);
  padding: 1.25em 1.5em;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5em 0;
  border: 1px solid rgba(74, 144, 226, 0.2);
  box-shadow: inset 0 0 1rem rgba(0, 0, 0, 0.3);
}

.prose pre code,
.prose-custom pre code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: 0.875em;
  line-height: 1.7;
  color: #d1d5db;
}

/* Blockquotes with steel-blue accent */
.prose blockquote,
.prose-custom blockquote {
  border-left: 0.25rem solid #4a90e2;
  padding-left: 1.5em;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  margin: 2em 0;
  font-style: italic;
  color: #9ca3af;
  background: rgba(59, 90, 125, 0.15);
  border-radius: 0 0.5rem 0.5rem 0;
  position: relative;
}

.prose blockquote::before,
.prose-custom blockquote::before {
  content: '"';
  font-size: 3em;
  color: rgba(74, 144, 226, 0.2);
  position: absolute;
  left: 0.25em;
  top: -0.1em;
  line-height: 1;
}

.prose blockquote p,
.prose-custom blockquote p {
  color: #9ca3af;
}

/* Tables with responsive scrolling and proper contrast */
.prose table,
.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.9em;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
}

.prose thead,
.prose-custom thead {
  background: rgba(59, 90, 125, 0.5);
}

.prose th,
.prose-custom th {
  padding: 1em 1.25em;
  text-align: left;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 2px solid rgba(74, 144, 226, 0.5);
  white-space: nowrap;
}

.prose td,
.prose-custom td {
  padding: 0.875em 1.25em;
  border-bottom: 1px solid rgba(75, 85, 99, 0.3);
  color: #d1d5db;
}

.prose tbody tr,
.prose-custom tbody tr {
  transition: background-color 0.2s ease;
}

.prose tbody tr:hover,
.prose-custom tbody tr:hover {
  background: rgba(59, 90, 125, 0.2);
}

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

/* Table Responsive Wrapper - ensures horizontal scrolling on mobile */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2em 0;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
}

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

.table-responsive::-webkit-scrollbar-track {
  background: rgba(26, 35, 50, 0.5);
  border-radius: 0.25rem;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 226, 0.5);
  border-radius: 0.25rem;
}

/* Horizontal rules */
.prose hr,
.prose-custom hr {
  border: none;
  border-top: 2px solid rgba(74, 144, 226, 0.3);
  margin: 3em 0;
}

/* Figures and captions */
.prose figure,
.prose-custom figure {
  margin: 2em 0;
}

.prose figcaption,
.prose-custom figcaption {
  margin-top: 0.75em;
  font-size: 0.875em;
  color: #9ca3af;
  text-align: center;
  font-style: italic;
}

/* Details/Summary Enhancement */
.prose details,
.prose-custom details,
details {
  margin: 1.5em 0;
  padding: 1.25em;
  background: rgba(59, 90, 125, 0.15);
  border-radius: 0.75rem;
  border: 1px solid rgba(74, 144, 226, 0.2);
}

.prose summary,
.prose-custom summary,
details summary {
  cursor: pointer;
  font-weight: 700;
  color: #4a90e2;
  list-style: none;
  padding: 0.5em 0;
  user-select: none;
}

.prose summary::-webkit-details-marker,
.prose-custom summary::-webkit-details-marker,
details summary::-webkit-details-marker {
  display: none;
}

.prose summary::before,
.prose-custom summary::before,
details summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.5em;
  transition: transform 0.2s ease;
}

.prose details[open] summary::before,
.prose-custom details[open] summary::before,
details[open] summary::before {
  transform: rotate(90deg);
}

.prose details[open] summary,
.prose-custom details[open] summary,
details[open] summary {
  border-bottom: 1px solid rgba(74, 144, 226, 0.3);
  margin-bottom: 1em;
  padding-bottom: 1em;
}

/* Abbreviations and definitions */
.prose abbr,
.prose-custom abbr {
  text-decoration: underline dotted;
  text-decoration-color: rgba(74, 144, 226, 0.5);
  cursor: help;
}

.prose kbd,
.prose-custom kbd {
  background: rgba(59, 90, 125, 0.4);
  padding: 0.2em 0.5em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
  border: 1px solid rgba(74, 144, 226, 0.3);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* Lead paragraph */
.prose .lead,
.prose-custom .lead {
  font-size: 1.25em;
  line-height: 1.6;
  color: #e5e7eb;
  margin-bottom: 1.5em;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .prose,
  .prose-custom {
    font-size: 1rem;
  }
  
  .prose table,
  .prose-custom table {
    font-size: 0.875em;
  }
  
  .prose th,
  .prose td,
  .prose-custom th,
  .prose-custom td {
    padding: 0.625em 0.875em;
  }
  
  .prose pre,
  .prose-custom pre {
    padding: 1em;
  }
  
  .prose blockquote,
  .prose-custom blockquote {
    padding-left: 1em;
    margin: 1.5em 0;
  }
}

/* Glow Effects for Interactive Elements */
.glow-ember {
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.glow-steel {
  box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

/* Smooth Transitions */
* {
  transition-property: color, background-color, border-color, opacity, transform;
  transition-duration: 200ms;
  transition-timing-function: ease-in-out;
}

/* Mobile Menu Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#mobile-menu:not(.hidden) {
  animation: slideDown 0.3s ease-out;
}

/* Loading State */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

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

/* Focus States for Accessibility */
a:focus,
button:focus,
summary:focus {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

/* Metal Texture Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(59, 90, 125, 0.03) 2px,
      rgba(59, 90, 125, 0.03) 4px
    );
  pointer-events: none;
  z-index: 0;
}

/* Ensure content is above texture */
body > * {
  position: relative;
  z-index: 1;
}

/* Print Styles */
@media print {
  .no-print,
  header,
  footer,
  nav {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .parallax-bg {
    transform: none !important;
  }
}
