/* Firix Ignite UK - Custom Styles */
/* Animation Keyframes, Overrides & Prose Styling */

/* ========================================
   CSS Variables
   ======================================== */
:root {
  --color-primary: #E63946;
  --color-secondary: #F4A261;
  --color-accent: #FFD700;
  --color-dark: #0D1117;
  --color-darker: #080B0F;
  --color-card: #161B22;
  --color-muted: #8B949E;
  --color-light: #F0F6FC;
}

/* ========================================
   Global Overrides
   ======================================== */
html {
  overflow-x: clip;
  overflow-y: auto;
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection styling */
::selection {
  background-color: var(--color-primary);
  color: var(--color-light);
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--color-light);
}

/* ========================================
   Particle Animation
   ======================================== */
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0.6;
  animation: particle-float 15s infinite ease-in-out;
}

.particle:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
  background: var(--color-primary);
}

.particle:nth-child(2) {
  left: 20%;
  animation-delay: 2s;
  background: var(--color-secondary);
  width: 0.375rem;
  height: 0.375rem;
}

.particle:nth-child(3) {
  left: 35%;
  animation-delay: 4s;
  background: var(--color-accent);
}

.particle:nth-child(4) {
  left: 50%;
  animation-delay: 6s;
  background: var(--color-primary);
  width: 0.625rem;
  height: 0.625rem;
}

.particle:nth-child(5) {
  left: 65%;
  animation-delay: 8s;
  background: var(--color-secondary);
}

.particle:nth-child(6) {
  left: 75%;
  animation-delay: 10s;
  background: var(--color-accent);
  width: 0.375rem;
  height: 0.375rem;
}

.particle:nth-child(7) {
  left: 85%;
  animation-delay: 12s;
  background: var(--color-primary);
}

.particle:nth-child(8) {
  left: 95%;
  animation-delay: 14s;
  background: var(--color-secondary);
  width: 0.5rem;
  height: 0.5rem;
}

@keyframes particle-float {
  0%, 100% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
    transform: translateY(90vh) scale(1);
  }
  90% {
    opacity: 0.6;
    transform: translateY(10vh) scale(1);
  }
  100% {
    transform: translateY(-10vh) scale(0);
    opacity: 0;
  }
}

/* ========================================
   Tilt Card Effect (Enhanced by JS)
   ======================================== */
.tilt-card {
  transition: transform 0.3s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

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

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

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

::-webkit-scrollbar-track {
  background: var(--color-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--color-card);
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}

/* ========================================
   Details/Summary FAQ Styling
   ======================================== */
details summary::-webkit-details-marker {
  display: none;
}

details summary::marker {
  display: none;
}

details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Prose Styling for Markdown Content
   ======================================== */
.prose {
  color: var(--color-muted);
  line-height: 1.7;
  font-size: 1rem;
}

.prose > * + * {
  margin-top: 1.5em;
}

/* Headings */
.prose h2 {
  color: var(--color-light);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.3;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--color-primary);
  position: relative;
}

.prose h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--color-secondary);
}

.prose h3 {
  color: var(--color-light);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  line-height: 1.4;
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.prose h4 {
  color: var(--color-light);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* Paragraphs */
.prose p {
  margin-bottom: 1.25em;
  color: var(--color-muted);
}

.prose p:first-of-type {
  font-size: 1.0625rem;
  color: var(--color-light);
  opacity: 0.9;
}

/* Links */
.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: var(--color-secondary);
}

/* Strong & Emphasis */
.prose strong {
  color: var(--color-light);
  font-weight: 600;
}

.prose em {
  font-style: italic;
  color: var(--color-secondary);
}

/* Lists - Unordered */
.prose ul {
  list-style: none;
  padding-left: 0;
  margin: 1.5em 0;
}

.prose ul li {
  position: relative;
  padding-left: 1.75em;
  margin-bottom: 0.75em;
  color: var(--color-muted);
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.625em;
  width: 0.5em;
  height: 0.5em;
  background: var(--color-primary);
  border-radius: 50%;
}

/* Lists - Ordered */
.prose ol {
  list-style: none;
  padding-left: 0;
  margin: 1.5em 0;
  counter-reset: ordered-list;
}

.prose ol li {
  position: relative;
  padding-left: 2.5em;
  margin-bottom: 0.75em;
  color: var(--color-muted);
  counter-increment: ordered-list;
}

.prose ol li::before {
  content: counter(ordered-list);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75em;
  height: 1.75em;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--color-light);
  font-weight: 600;
  font-size: 0.875em;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nested Lists */
.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Blockquotes */
.prose blockquote {
  position: relative;
  margin: 2em 0;
  padding: 1.5em 1.5em 1.5em 2em;
  background: var(--color-card);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}

.prose blockquote p {
  color: var(--color-light);
  opacity: 0.9;
  margin-bottom: 0;
}

.prose blockquote::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-size: 4rem;
  font-family: Georgia, serif;
  color: var(--color-primary);
  opacity: 0.3;
  line-height: 1;
}

/* Tables */
.prose .table-responsive {
  margin: 2em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.prose table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose thead {
  background: var(--color-darker);
}

.prose th {
  color: var(--color-light);
  font-weight: 600;
  text-align: left;
  padding: 1em 1.25em;
  white-space: nowrap;
}

.prose td {
  color: var(--color-muted);
  padding: 1em 1.25em;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.prose tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

/* Code Inline */
.prose code {
  background: var(--color-card);
  color: var(--color-secondary);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'JetBrains Mono', monospace;
}

/* Code Block */
.prose pre {
  background: var(--color-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: var(--color-light);
}

/* Horizontal Rule */
.prose hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-secondary), transparent);
  margin: 3em 0;
}

/* ========================================
   Firix Theme Prose Variant
   ======================================== */
.prose-firix h2 {
  color: var(--color-light);
}

.prose-firix h3 {
  color: var(--color-light);
}

.prose-firix a {
  color: var(--color-primary);
}

.prose-firix a:hover {
  color: var(--color-secondary);
}

/* ========================================
   Animation Utilities
   ======================================== */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(230, 57, 70, 0.6);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-card) 0%,
    var(--color-muted) 50%,
    var(--color-card) 100%
  );
  background-size: 200% auto;
  animation: shimmer 3s infinite linear;
}

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

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

/* ========================================
   Focus States for Accessibility
   ======================================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   Mobile Menu Background Fix
   ======================================== */
#mobile-menu {
  background-color: var(--color-darker);
}

/* ========================================
   Media Queries
   ======================================== */
@media (max-width: 768px) {
  .prose {
    font-size: 0.9375rem;
  }
  
  .prose h2 {
    font-size: 1.375rem;
  }
  
  .prose h3 {
    font-size: 1.125rem;
  }
  
  .prose blockquote {
    padding: 1em 1em 1em 1.5em;
  }
  
  .prose blockquote::before {
    font-size: 3rem;
    top: -0.25rem;
    left: 0.5rem;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .prose {
    color: #000;
  }
  
  .prose h2,
  .prose h3,
  .prose h4,
  .prose strong {
    color: #000;
  }
  
  .prose a {
    color: #000;
    text-decoration: underline;
  }
}
