/* ── WiseIQ Compare System ── */

/* Compare checkbox on each card */
.compare-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.compare-checkbox-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1a6fd4;
  cursor: pointer;
  flex-shrink: 0;
}
.compare-checkbox-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  transition: color 0.15s;
}
.compare-checkbox-wrap:hover .compare-checkbox-label {
  color: #1a6fd4;
}
.compare-checkbox-wrap input:checked + .compare-checkbox-label {
  color: #1a6fd4;
}

/* ── Floating Compare Tray ── */
#compare-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: #0b1f3a;
  border-top: 2px solid #1a6fd4;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.35);
  padding: 14px 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
#compare-tray.visible {
  transform: translateY(0);
}
.compare-tray-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.compare-tray-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  flex-shrink: 0;
}
.compare-tray-slots {
  display: flex;
  gap: 10px;
  flex: 1;
}
.compare-slot {
  flex: 1;
  max-width: 220px;
  background: rgba(255,255,255,0.07);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  transition: background 0.2s;
}
.compare-slot.filled {
  border-style: solid;
  border-color: rgba(26,111,212,0.5);
  background: rgba(26,111,212,0.12);
}
.compare-slot-logo {
  width: 36px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  background: white;
  padding: 2px;
  flex-shrink: 0;
}
.compare-slot-name {
  font-size: 12px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
  flex: 1;
}
.compare-slot-empty-text {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}
.compare-slot-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.compare-slot-remove:hover {
  color: #f87171;
}
.compare-tray-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.btn-compare-now {
  background: #1a6fd4;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-compare-now:hover {
  background: #1558b0;
  transform: translateY(-1px);
}
.btn-compare-now:disabled {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
  cursor: not-allowed;
  transform: none;
}
.btn-compare-clear {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-compare-clear:hover {
  border-color: rgba(255,255,255,0.5);
  color: white;
}

/* ── Compare Modal ── */
#compare-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(11,31,58,0.75);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 40px 20px 80px;
}
#compare-modal.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.compare-modal-box {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 1100px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.compare-modal-header {
  background: linear-gradient(135deg, #0b1f3a, #1a3a6e);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.compare-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: white;
}
.compare-modal-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.compare-modal-close:hover {
  background: rgba(255,255,255,0.2);
}

/* Compare Table */
.compare-table-wrap {
  overflow-x: auto;
  padding: 0;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.compare-table th {
  padding: 20px 24px;
  text-align: center;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  vertical-align: top;
}
.compare-table th:first-child {
  text-align: left;
  width: 180px;
  background: #f1f5f9;
}
.compare-table td {
  padding: 14px 24px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.compare-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: #64748b;
  font-size: 13px;
  background: #f8fafc;
}
.compare-table tr:hover td {
  background: #fafbff;
}
.compare-table tr:hover td:first-child {
  background: #f1f5f9;
}

/* Winner highlight */
.compare-table td.winner {
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
}
.compare-table td.winner::after {
  content: ' ✓';
  font-size: 11px;
  opacity: 0.7;
}
.compare-table tr:hover td.winner {
  background: #dcfce7;
}

/* Product header in table */
.compare-prod-logo {
  width: 80px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
  padding: 4px;
  margin: 0 auto 8px;
  display: block;
  border: 1px solid #e2e8f0;
}
.compare-prod-name {
  font-size: 15px;
  font-weight: 800;
  color: #0b1f3a;
  margin-bottom: 4px;
}
.compare-prod-issuer {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}
.compare-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1a6fd4;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid #bfdbfe;
}

/* Apply buttons row */
.compare-apply-row td {
  padding: 20px 24px;
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
}
.btn-compare-apply {
  display: block;
  width: 100%;
  background: #1a6fd4;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, transform 0.1s;
}
.btn-compare-apply:hover {
  background: #1558b0;
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

/* Disclaimer */
.compare-disclaimer {
  padding: 16px 32px;
  font-size: 11px;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

@media (max-width: 768px) {
  .compare-tray-slots { gap: 6px; }
  .compare-slot { padding: 6px 8px; }
  .compare-slot-name { font-size: 11px; }
  .compare-tray-label { display: none; }
  #compare-modal { padding: 20px 12px 80px; }
  .compare-modal-header { padding: 16px 20px; }
  .compare-table th, .compare-table td { padding: 10px 14px; }
}
