/* AI2SQL Blog Styles — Dark Theme, Blue/Purple Accents */

/* ===== Base Prose Styling ===== */
.blog-prose {
  color: #d4d4d8; /* zinc-300 */
  font-size: 1.125rem;
  line-height: 1.8;
}

.blog-prose h2 {
  color: #f4f4f5; /* zinc-100 */
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.blog-prose h3 {
  color: #e4e4e7; /* zinc-200 */
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-prose p {
  margin-bottom: 1.25rem;
  color: #a1a1aa; /* zinc-400 */
}

.blog-prose a {
  color: #818cf8; /* indigo-400 */
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.blog-prose a:hover {
  color: #a78bfa; /* violet-400 */
}

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

.blog-prose em {
  color: #c4b5fd; /* violet-300 */
}

/* Lists */
.blog-prose ul,
.blog-prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: #a1a1aa;
}

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

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

.blog-prose li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.blog-prose li::marker {
  color: #818cf8;
}

/* ===== Code Blocks ===== */
.blog-prose pre {
  position: relative;
  background: #111118;
  border: 1px solid #27272a;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}

.blog-prose pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #c4b5fd;
  background: none;
  padding: 0;
  border: none;
}

.blog-prose code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

/* Copy Button on Code Blocks */
.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(63, 63, 70, 0.8);
  border: 1px solid #52525b;
  color: #a1a1aa;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  z-index: 5;
}

.blog-prose pre:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  color: #e4e4e7;
}

.code-copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #4ade80;
}

/* ===== Tables ===== */
.blog-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.blog-prose thead {
  background: rgba(99, 102, 241, 0.1);
}

.blog-prose th {
  color: #e4e4e7;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.blog-prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #27272a;
  color: #a1a1aa;
}

.blog-prose tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}

/* ===== Blockquotes ===== */
.blog-prose blockquote {
  border-left: 3px solid #818cf8;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #c4b5fd;
  font-style: italic;
}

/* ===== FAQ Accordion ===== */
.faq-item {
  border: 1px solid #27272a;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: rgba(139, 92, 246, 0.4);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  color: #e4e4e7;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: #818cf8;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: '-';
}

.faq-item summary:hover {
  background: rgba(99, 102, 241, 0.05);
}

.faq-item .faq-answer {
  padding: 0 1.25rem 1rem;
  color: #a1a1aa;
  line-height: 1.7;
}

/* ===== Sidebar TOC ===== */
#blog-sidebar {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}

.toc-nav {
  border-left: 2px solid #27272a;
  padding-left: 0;
}

.toc-link {
  display: block;
  padding: 0.4rem 0 0.4rem 1rem;
  color: #71717a;
  font-size: 0.85rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all 0.2s;
  line-height: 1.4;
}

.toc-link:hover {
  color: #a1a1aa;
}

.toc-link.active {
  color: #818cf8;
  border-left-color: #818cf8;
  font-weight: 500;
}

/* ===== Inline CTA Card ===== */
.blog-inline-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 1rem;
  padding: 2rem;
  margin: 2.5rem 0;
  text-align: center;
}

.blog-inline-cta h3 {
  color: #f4f4f5;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  border: none;
}

.blog-inline-cta p {
  color: #a1a1aa;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.blog-inline-cta a {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 0.65rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.blog-inline-cta a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

/* ===== Sticky Bottom CTA Bar ===== */
.blog-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  padding: 0.75rem 1.5rem;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.blog-sticky-bar.visible {
  transform: translateY(0);
}

.blog-sticky-bar span {
  color: #a1a1aa;
  font-size: 0.95rem;
}

.blog-sticky-bar a {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.blog-sticky-bar a:hover {
  box-shadow: 0 2px 15px rgba(99, 102, 241, 0.4);
}

.blog-sticky-bar .close-btn {
  background: none;
  border: none;
  color: #71717a;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
}

/* ===== Exit Intent Popup ===== */
.exit-intent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.exit-intent-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.exit-intent-popup {
  background: #111118;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 1rem;
  padding: 2.5rem;
  max-width: 28rem;
  width: 90%;
  text-align: center;
  position: relative;
  animation: popupSlideUp 0.3s ease;
}

@keyframes popupSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.exit-intent-popup .close-popup {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #71717a;
  font-size: 1.25rem;
  cursor: pointer;
}

.exit-intent-popup h3 {
  color: #f4f4f5;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.exit-intent-popup p {
  color: #a1a1aa;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.exit-intent-popup .popup-cta {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.exit-intent-popup .popup-cta:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.exit-intent-popup .popup-dismiss {
  display: block;
  margin-top: 1rem;
  background: none;
  border: none;
  color: #71717a;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ===== Blog Card Grid ===== */
.blog-card {
  background: #111118;
  border: 1px solid #27272a;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.blog-card .tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.blog-card h3 {
  color: #f4f4f5;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.blog-card p {
  color: #71717a;
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.blog-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1c1c24;
  font-size: 0.8rem;
  color: #52525b;
}

/* ===== Article Header ===== */
.article-header .tag-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.article-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #f4f4f5;
  line-height: 1.2;
  margin: 1rem 0;
}

.article-header .description {
  color: #a1a1aa;
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-header .meta-info {
  display: flex;
  gap: 1.5rem;
  color: #52525b;
  font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  #blog-sidebar {
    display: none;
  }

  .blog-prose h2 {
    font-size: 1.5rem;
  }

  .article-header h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 640px) {
  .blog-sticky-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
  }

  .blog-sticky-bar span {
    font-size: 0.85rem;
  }

  .blog-inline-cta {
    padding: 1.5rem;
  }
}

/* ===== Gradient Helpers ===== */
.gradient-text-blog {
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  transition: all 0.2s;
}

.gradient-btn:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}
