/**
 * GoTrendWise Blog — Premium Dark Theme Stylesheet
 * Supports: Tables, Charts, FAQ, TL;DR cards, Code blocks, Images
 */

/* ─── ROOT VARIABLES ─── */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-hover: #283548;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: #334155;
  --border-light: #475569;

  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-blue: #3b82f6;
  --accent-blue-light: #60a5fa;
  --accent-purple: #8b5cf6;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ─── ARTICLE CONTAINER ─── */
.blog-article {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 1.0625rem;
}

.blog-article--dark {
  background: transparent;
}

/* ─── TYPOGRAPHY ─── */
.blog-article h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-h2,
.blog-article h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-primary);
  position: relative;
}

.blog-h2::after,
.blog-article h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
}

.blog-h2--dark,
.blog-article--dark h2 {
  border-bottom-color: var(--border-light);
}

.blog-h3,
.blog-article h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--accent-blue-light);
}

.blog-h3--dark,
.blog-article--dark h3 {
  color: var(--accent-cyan);
}

/* Heading anchor links */
.heading-anchor {
  opacity: 0;
  margin-right: 0.5rem;
  color: var(--accent-emerald);
  text-decoration: none;
  font-weight: 400;
  transition: opacity 0.2s;
}

.blog-h2:hover .heading-anchor,
.blog-h3:hover .heading-anchor {
  opacity: 1;
}

/* ─── PARAGRAPHS ─── */
.blog-article p {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
}

.blog-article p.lead {
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.7;
  border-left: 4px solid var(--accent-emerald);
  padding-left: 1.25rem;
  margin: 2rem 0;
}

/* ─── LINKS ─── */
.blog-article a {
  color: var(--accent-blue-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.blog-article a:hover {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* ─── TL;DR / HIGHLIGHT CARDS ─── */
.tldr-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.tldr-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-emerald), var(--accent-cyan));
}

.tldr-card h3 {
  margin-top: 0;
  color: var(--accent-emerald-light);
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tldr-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.tldr-card li {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.tldr-card li strong {
  color: var(--accent-emerald-light);
}

/* ─── TABLES ─── */
.premium-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  font-size: 0.9375rem;
}

.premium-table thead {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
}

.premium-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--accent-blue-light);
  border-bottom: 2px solid var(--accent-blue);
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
}

.premium-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.premium-table tbody tr {
  background: var(--bg-secondary);
  transition: background 0.2s;
}

.premium-table tbody tr:nth-child(even) {
  background: #1a2744;
}

.premium-table tbody tr:hover {
  background: var(--bg-hover);
}

.premium-table tbody tr:last-child td {
  border-bottom: none;
}

/* Highlight BabyBrain column */
.premium-table td:nth-child(2) {
  color: var(--accent-emerald-light);
  font-weight: 600;
}

/* Benchmark table specific */
.benchmark-table thead {
  background: linear-gradient(135deg, #0f172a, #1e3a1e);
}

.benchmark-table th {
  color: var(--accent-emerald-light);
  border-bottom-color: var(--accent-emerald);
}

.benchmark-table tfoot td {
  background: rgba(16, 185, 129, 0.1);
  color: var(--text-primary);
  font-weight: 700;
  border-top: 2px solid var(--accent-emerald);
}

/* ROI table specific */
.roi-table thead {
  background: linear-gradient(135deg, #0f172a, #3a1e0f);
}

.roi-table th {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
}

.roi-table td:nth-child(3) {
  color: var(--accent-emerald-light);
  font-weight: 700;
}

/* Integration table */
.integration-table td:first-child {
  color: var(--accent-blue-light);
  font-weight: 600;
  width: 120px;
}

/* ─── LISTS ─── */
.premium-list {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
}

.premium-list li {
  margin: 0.625rem 0;
  color: var(--text-secondary);
  position: relative;
}

.premium-list li::marker {
  color: var(--accent-emerald);
}

.premium-list--numbered {
  list-style-type: decimal;
}

.premium-list--numbered li::marker {
  color: var(--accent-blue-light);
  font-weight: 600;
}

/* ─── PULL QUOTES ─── */
.pull-quote {
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  border-left: 4px solid var(--accent-purple);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-size: 1.125rem;
  color: var(--text-primary);
  position: relative;
}

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

/* ─── FAQ ACCORDION ─── */
.faq-section {
  margin: 2rem 0;
}

.faq-item {
  margin: 0.75rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  transition: all 0.3s;
}

.faq-item:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.0625rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--accent-emerald);
  transition: transform 0.3s;
}

.faq-question.open::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 1.5rem;
}

.faq-answer.open {
  max-height: 500px;
  padding: 0 1.5rem 1.25rem;
}

.faq-answer p {
  margin: 0;
  color: var(--text-secondary);
}

/* ─── IMAGES & CHARTS ─── */
.blog-image {
  margin: 2.5rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-secondary);
}

.blog-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s;
}

.blog-image:hover img {
  transform: scale(1.02);
}

.blog-chart {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.blog-chart img {
  padding: 1rem;
}

.image-caption {
  padding: 0.875rem 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* ─── CODE BLOCKS ─── */
.blog-article pre {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

.blog-article code {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Fira Code', 'Consolas', monospace;
}

.blog-article pre code {
  background: none;
  color: var(--text-secondary);
  padding: 0;
}

/* ─── CTA BOX ─── */
.cta-box {
  margin: 3rem 0;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
  border: 2px solid var(--accent-blue);
  border-radius: var(--radius-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
  animation: ctaPulse 4s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}

.cta-box h3 {
  position: relative;
  z-index: 1;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.cta-box p {
  position: relative;
  z-index: 1;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.cta-button {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  color: white !important;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: none;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* ─── AD BANNERS ─── */
.ad-banner {
  margin: 2rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
}

.ad-placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── DIVIDERS ─── */
.premium-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
  margin: 2.5rem 0;
}

/* ─── EMPHASIS ─── */
.brand-emphasis {
  color: var(--accent-cyan);
  font-style: italic;
}

/* ─── CHECKLIST ─── */
.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  padding-left: 1.75rem;
  position: relative;
  margin: 0.75rem 0;
}

.checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-emerald);
  font-weight: 700;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .blog-article {
    padding: 1.5rem 1rem;
    font-size: 1rem;
  }

  .blog-article h1 {
    font-size: 1.875rem;
  }

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

  .premium-table {
    font-size: 0.8125rem;
  }

  .premium-table th,
  .premium-table td {
    padding: 0.625rem 0.75rem;
  }

  .cta-box {
    padding: 1.5rem;
  }

  .tldr-card {
    padding: 1.25rem;
  }
}

/* ─── PRINT STYLES ─── */
@media print {
  .blog-article {
    color: #000;
    background: #fff;
  }

  .ad-banner,
  .cta-box::before {
    display: none;
  }

  .premium-table {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ─── SCROLLBAR ─── */
.blog-article pre::-webkit-scrollbar {
  height: 8px;
}

.blog-article pre::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.blog-article pre::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

/* ─── TABLE OF CONTENTS ─── */
.blog-toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}

.blog-toc h4 {
  margin: 0 0 1rem;
  color: var(--text-primary);
  font-size: 1.125rem;
}

.blog-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-toc li {
  margin: 0.5rem 0;
}

.blog-toc a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-toc a:hover {
  color: var(--accent-emerald);
}

.blog-toc .toc-h3 {
  padding-left: 1.25rem;
  font-size: 0.9375rem;
}
