/* ============================================================
   WiseIQ UX Extras — v124
   back-to-top · social share · print/PDF · TOC · reading time · filter bar
   ============================================================ */

/* ── Back to Top ── */
#back-to-top {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0a7ea4;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(10,126,164,0.35);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 8000;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
#back-to-top:hover {
  background: #0969a2;
  transform: translateY(-2px);
}
#back-to-top svg { pointer-events: none; }

/* ── Social Share Bar ── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 8px;
  flex-wrap: wrap;
}
.share-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: #687076;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}
.share-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.share-btn.twitter  { background: #000; color: #fff; }
.share-btn.facebook { background: #1877f2; color: #fff; }
.share-btn.copy-link { background: #fff; color: #11181C; border-color: #E5E7EB; }
.share-btn.copy-link.copied { background: #f0fdf4; border-color: #22C55E; color: #16a34a; }

/* ── Print / Save PDF ── */
.calc-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #687076;
  background: #f5f5f5;
  border: 1.5px solid #E5E7EB;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-top: 12px;
}
.calc-print-btn:hover { background: #e9ecef; color: #11181C; }

@media print {
  #back-to-top, .share-bar, .nav-wrap, #navbar, .footer-wrap,
  .calc-print-btn, .copy-results-btn, .save-results-form,
  .sticky-result-bar, .toc-sidebar { display: none !important; }
  .calc-panel, .calc-grid { break-inside: avoid; }
  body { font-size: 12pt; }
}

/* ── Reading Time Badge ── */
.reading-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #687076;
  margin-left: 12px;
}
.reading-time-badge svg { flex-shrink: 0; }

/* ── Table of Contents ── */
.toc-container {
  background: #f8fafc;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 28px 0;
}
.toc-container h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #687076;
  margin: 0 0 14px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toc-list li a {
  font-size: 14px;
  color: #0a7ea4;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}
.toc-list li a:hover { color: #0969a2; text-decoration: underline; }
.toc-list li.toc-h3 a { padding-left: 16px; font-size: 13px; color: #687076; }
.toc-list li.toc-h3 a:hover { color: #0a7ea4; }

/* Sticky TOC sidebar (desktop only) */
.toc-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: #f8fafc;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  font-size: 13px;
}
.toc-sidebar h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #687076;
  margin: 0 0 12px;
}
.toc-sidebar .toc-list li a {
  font-size: 13px;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 8px;
}
.toc-sidebar .toc-list li a.active {
  border-left-color: #0a7ea4;
  color: #0a7ea4;
  font-weight: 600;
}
@media (max-width: 1024px) {
  .toc-sidebar { display: none; }
}

/* ── Filter Bar (best-of pages) ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0 24px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
}
.filter-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: #687076;
  margin-right: 4px;
  white-space: nowrap;
}
.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: #11181C;
  border: 1.5px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: #0a7ea4; color: #0a7ea4; }
.filter-chip.active { background: #0a7ea4; color: #fff; border-color: #0a7ea4; }
.filter-chip.active:hover { background: #0969a2; border-color: #0969a2; }

/* Sort select */
.filter-sort {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid #E5E7EB;
  font-size: 13px;
  font-weight: 600;
  color: #11181C;
  background: #fff;
  cursor: pointer;
}
.filter-sort:focus { outline: 2px solid #0a7ea4; }

/* Hidden card state */
.offer-card[data-hidden="true"],
.lender-card[data-hidden="true"],
.product-card[data-hidden="true"],
.card-item[data-hidden="true"] {
  display: none !important;
}

/* No results message */
.filter-no-results {
  text-align: center;
  padding: 40px 20px;
  color: #687076;
  font-size: 15px;
  display: none;
}
.filter-no-results.visible { display: block; }
