/* APIForge — Custom styles for Tailwind CDN version
   Only includes what Tailwind CDN cannot generate */

/* ===== Base ===== */
html { scroll-behavior: smooth; }

:focus-visible {
  outline: 2px solid #1B5E20;
  outline-offset: 2px;
}

/* ===== Preloader ===== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: opacity 0.3s ease;
}
.dark #preloader { background: #030712; }

.preloader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #1B5E20;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.dark .preloader-spinner { border-color: #374151; border-top-color: #1B5E20; }

/* ===== Scroll Progress ===== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: #1B5E20;
  z-index: 60;
  transition: width 0.1s linear;
}

/* ===== Cookie Consent ===== */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 1rem 0;
  transition: transform 0.3s ease;
}
.dark .cookie-consent {
  background: #111827;
  border-top-color: #1f2937;
}

/* ===== Back to Top ===== */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #1B5E20;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(11, 132, 19, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#back-to-top svg { width: 20px; height: 20px; }

/* ===== Mobile CTA Bar ===== */
.mobile-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
  display: none;
}
.dark .mobile-cta-bar {
  background: #111827;
  border-top-color: #1f2937;
}
@media (max-width: 639px) {
  .mobile-cta-bar { display: block; }
}

/* ===== Card Shadow ===== */
.card {
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.14);
}

/* ===== Hero float animation ===== */
@keyframes hero-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}
.animate-hero-float { animation: hero-float 8s ease-in-out infinite; }
.animate-hero-float-reverse { animation: hero-float 10s ease-in-out infinite reverse; }

/* ===== Image shimmer ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.img-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.dark .img-shimmer {
  background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
  background-size: 200% 100%;
}

/* ===== Prose / Blog Typography ===== */
.prose {
  color: #4b5563;
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.75;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: #111827;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 0.75em;
}
.prose h1 { font-size: 2.25em; margin-top: 0; }
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.25em; }
.prose p { margin-top: 1.25em; margin-bottom: 1.25em; }
.prose a { color: #1B5E20; text-decoration: underline; font-weight: 500; }
.prose a:hover { color: #c2410c; }
.prose strong { color: #111827; font-weight: 600; }
.prose ul, .prose ol { margin-top: 1.25em; margin-bottom: 1.25em; padding-left: 1.625em; }
.prose li { margin-top: 0.5em; margin-bottom: 0.5em; }
.prose ul > li { list-style-type: disc; }
.prose ol > li { list-style-type: decimal; }
.prose code { color: #111827; font-size: 0.875em; font-weight: 600; }
.prose code::before, .prose code::after { content: '`'; }
.prose pre { background: #111827; color: #e5e7eb; overflow-x: auto; font-size: 0.875em; line-height: 1.7; margin: 1.5em 0; border-radius: 0.5rem; padding: 1rem 1.25rem; }
.prose pre code { background: transparent; border: 0; padding: 0; font-weight: inherit; color: inherit; font-size: inherit; }
.prose pre code::before, .prose pre code::after { content: none; }
.prose blockquote { font-style: italic; border-left: 4px solid #d1d5db; padding-left: 1em; margin: 1.5em 0; }
.prose img { margin: 2em 0; border-radius: 0.75rem; }
.prose hr { border-color: #e5e7eb; margin: 3em 0; }

/* Dark prose */
.dark .prose { color: #d1d5db; }
.dark .prose h1, .dark .prose h2, .dark .prose h3, .dark .prose h4 { color: #fff; }
.dark .prose strong { color: #fff; }
.dark .prose a { color: #fb923c; }
.dark .prose a:hover { color: #fdba74; }
.dark .prose code { color: #fff; }
.dark .prose blockquote { border-left-color: #374151; }
.dark .prose hr { border-color: #1f2937; }

/* ===== Scroll spy active ===== */
[data-nav-link].nav-active { color: #111827; font-weight: 600; }
.dark [data-nav-link].nav-active { color: #fff; }

/* ===== Spin animation ===== */
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Ping animation ===== */
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
