/**
 * WiseIQ Social Proof & Compare Tray — Styles v1.0
 */

/* ── View Counter ─────────────────────────────────────────────── */
.wiq-view-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #374151;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  padding: 4px 12px;
  margin: 6px 0 14px;
}
.wiq-vc-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
  animation: wiq-sp-pulse 2s ease-in-out infinite;
}
.wiq-vc-text strong { font-weight: 700; }

/* ── Most Popular Badge ───────────────────────────────────────── */
.wiq-popular-badge {
  position: absolute;
  top: -10px; left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
  z-index: 2;
}

/* ── Applied Badge ────────────────────────────────────────────── */
.wiq-applied-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #065F46;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 20px;
  padding: 3px 10px;
  margin: 6px 0;
}
.wiq-applied-badge strong { font-weight: 700; }

/* ── Star Ratings ─────────────────────────────────────────────── */
.wiq-star-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 3px 0 6px;
}
.wiq-stars { display: inline-flex; gap: 1px; }
.wiq-star { font-size: 13px; line-height: 1; }
.wiq-star-full  { color: #F59E0B; }
.wiq-star-half  { color: #F59E0B; opacity: 0.6; }
.wiq-star-empty { color: #D1D5DB; }
.wiq-star-score {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}
.wiq-star-count {
  font-size: 11px;
  color: #6B7280;
}

/* ── Editor's Pick ────────────────────────────────────────────── */
.wiq-editors-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #1D4ED8, #7C3AED);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

/* ── Trending Badge ───────────────────────────────────────────── */
.wiq-trending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 20px;
  padding: 2px 8px;
  vertical-align: middle;
  margin-left: 8px;
}

/* ── Compare Checkbox ─────────────────────────────────────────── */
.wiq-compare-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 12px;
  color: #374151;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.wiq-compare-checkbox-wrap:hover {
  border-color: #3B82F6;
  background: #EFF6FF;
}
.wiq-compare-checkbox { accent-color: #3B82F6; }
.wiq-compare-checkbox-label { font-weight: 600; }

.lender-card.wiq-in-compare,
.loan-card.wiq-in-compare,
.cc-card.wiq-in-compare,
.savings-card.wiq-in-compare,
.pick-card.wiq-in-compare,
.product-card-v2.wiq-in-compare {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* ── Compare Tray ─────────────────────────────────────────────── */
.wiq-compare-tray {
  position: fixed;
  bottom: -100px;
  left: 0; right: 0;
  z-index: 9998;
  background: #fff;
  border-top: 2px solid #3B82F6;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px 16px;
}
.wiq-compare-tray.wiq-ct-visible { bottom: 0; }
.wiq-ct-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.wiq-ct-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #1D4ED8;
  white-space: nowrap;
}
.wiq-ct-slots {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.wiq-ct-slot {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1D4ED8;
}
.wiq-ct-slot-remove {
  background: none;
  border: none;
  color: #6B7280;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 4px;
}
.wiq-ct-slot-remove:hover { color: #DC2626; }
.wiq-ct-actions { display: flex; gap: 8px; }
.wiq-ct-compare-btn {
  background: #1D4ED8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.wiq-ct-compare-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.wiq-ct-compare-btn:not(:disabled):hover { background: #1E40AF; }
.wiq-ct-clear-btn {
  background: none;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: #6B7280;
  cursor: pointer;
}
.wiq-ct-clear-btn:hover { border-color: #9CA3AF; color: #374151; }

/* ── Compare Modal ────────────────────────────────────────────── */
.wiq-compare-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.wiq-compare-modal.wiq-cm-open {
  opacity: 1;
  pointer-events: auto;
}
.wiq-cm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.wiq-cm-dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 860px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.25s;
}
.wiq-compare-modal.wiq-cm-open .wiq-cm-dialog { transform: translateY(0); }
.wiq-cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.wiq-cm-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.wiq-cm-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6B7280;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.wiq-cm-close:hover { color: #111827; }
.wiq-cm-body { padding: 20px 24px 24px; overflow-x: auto; }
.wiq-cm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wiq-cm-table th {
  background: #F3F4F6;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #E5E7EB;
}
.wiq-cm-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #F3F4F6;
  color: #374151;
}
.wiq-cm-label { font-weight: 600; color: #6B7280; }
.wiq-cm-best {
  background: #ECFDF5;
  color: #065F46;
  font-weight: 700;
}
.wiq-cm-cta-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: flex-end;
}
.wiq-cm-cta {
  display: inline-block;
  background: #1D4ED8;
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}
.wiq-cm-cta:hover { background: #1E40AF; }

/* ── Toast ────────────────────────────────────────────────────── */
.wiq-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1F2937;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10000;
  pointer-events: none;
  white-space: nowrap;
}
.wiq-toast.wiq-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Pulse animation ──────────────────────────────────────────── */
@keyframes wiq-sp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Dark mode ────────────────────────────────────────────────── */
[data-theme="dark"] .wiq-view-counter {
  background: #1F2937;
  border-color: #374151;
  color: #D1D5DB;
}
[data-theme="dark"] .wiq-star-score { color: #F9FAFB; }
[data-theme="dark"] .wiq-star-count { color: #9CA3AF; }
[data-theme="dark"] .wiq-compare-tray {
  background: #111827;
  border-top-color: #3B82F6;
}
[data-theme="dark"] .wiq-ct-label { color: #93C5FD; }
[data-theme="dark"] .wiq-ct-slot {
  background: #1E3A5F;
  border-color: #3B82F6;
  color: #93C5FD;
}
[data-theme="dark"] .wiq-cm-dialog { background: #1F2937; }
[data-theme="dark"] .wiq-cm-header { background: #1F2937; border-color: #374151; }
[data-theme="dark"] .wiq-cm-title { color: #F9FAFB; }
[data-theme="dark"] .wiq-cm-table th { background: #374151; color: #D1D5DB; }
[data-theme="dark"] .wiq-cm-table td { color: #D1D5DB; border-color: #374151; }
[data-theme="dark"] .wiq-cm-label { color: #9CA3AF; }
[data-theme="dark"] .wiq-compare-checkbox-wrap { border-color: #374151; color: #D1D5DB; }
[data-theme="dark"] .wiq-compare-checkbox-wrap:hover { background: #1E3A5F; border-color: #3B82F6; }
