/* compare.css — Compare Tray + Compare Page styles */
/* Sub-Agent H — 2026-05-07 */

/* ── Compare Tray (sticky bottom bar) ─────────────────────────────────────── */
.cmp-tray {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1100;
  background: var(--bg-panel, #0d1117);
  border-top: 1px solid var(--line, rgba(255,255,255,.08));
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
}
.cmp-tray.is-open {
  transform: translateY(0);
}
.cmp-tray-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cmp-tray-label {
  font-family: var(--font-mono, monospace);
  font-size: var(--fs-2xs, 10px);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent, #60a5fa);
  white-space: nowrap;
  min-width: 100px;
}
.cmp-tray-slots {
  flex: 1;
  display: flex;
  gap: 8px;
}
.cmp-slot {
  flex: 1;
  min-width: 0;
  border: 1px dashed var(--line, rgba(255,255,255,.12));
  border-radius: var(--r-sm, 6px);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  position: relative;
}
.cmp-slot.is-empty {
  color: var(--text-lo, rgba(255,255,255,.3));
  font-size: var(--fs-xs, 11px);
  justify-content: center;
}
.cmp-slot.is-filled {
  background: var(--bg-elev, rgba(255,255,255,.04));
  border-style: solid;
  border-color: var(--line, rgba(255,255,255,.12));
}
.cmp-slot-img {
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs, 4px);
  background: var(--bg-input, #1a1f2e) center/cover no-repeat;
  flex-shrink: 0;
}
.cmp-slot-meta {
  min-width: 0;
  flex: 1;
}
.cmp-slot-meta .t {
  font-size: var(--fs-xs, 11px);
  font-weight: 600;
  color: var(--text-hi, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-slot-meta .p {
  font-size: var(--fs-2xs, 10px);
  color: var(--text-mid, rgba(255,255,255,.5));
  font-family: var(--font-mono, monospace);
}
.cmp-slot-x {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-elev, rgba(255,255,255,.08));
  border: 1px solid var(--line, rgba(255,255,255,.1));
  color: var(--text-mid, rgba(255,255,255,.5));
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.cmp-slot-x:hover {
  background: rgba(239,68,68,.2);
  color: #ef4444;
  border-color: #ef4444;
}
.cmp-tray-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Compare Page ──────────────────────────────────────────────────────────── */
.cmp-page {
  padding: 0;
}
.cmp-empty {
  text-align: center;
  padding: 80px 24px;
}
.cmp-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  color: var(--accent, #60a5fa);
  opacity: 0.5;
}
.cmp-empty-icon svg {
  width: 100%;
  height: 100%;
}
.cmp-grid {
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 32px;
  -webkit-overflow-scrolling: touch;
}
.cmp-row {
  display: grid;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.06));
  min-width: 640px;
}
.cmp-row.is-header {
  border-bottom: 2px solid var(--line, rgba(255,255,255,.12));
  padding-bottom: 0;
}
.cmp-cell {
  padding: 12px 16px;
  font-size: var(--fs-sm, 13px);
  color: var(--text-hi, #fff);
  vertical-align: middle;
}
.cmp-rowlabel {
  font-family: var(--font-mono, monospace);
  font-size: var(--fs-2xs, 10px);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-lo, rgba(255,255,255,.35));
  text-transform: uppercase;
  padding-right: 8px;
  display: flex;
  align-items: center;
}
.cmp-card-img {
  width: 100%;
  height: 120px;
  border-radius: var(--r-sm, 6px);
  background: var(--bg-input, #1a1f2e) center/cover no-repeat;
  margin-bottom: 8px;
}
.cmp-card-title {
  font-weight: 600;
  font-size: var(--fs-sm, 13px);
  color: var(--text-hi, #fff);
  line-height: 1.35;
}
.cmp-card-sub {
  font-size: var(--fs-2xs, 10px);
  color: var(--text-lo, rgba(255,255,255,.35));
  font-family: var(--font-mono, monospace);
  margin-top: 2px;
}
.cmp-val {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--r-xs, 4px);
  font-size: var(--fs-sm, 13px);
}
.cmp-val.is-best {
  background: rgba(52,211,153,.12);
  color: #34d399;
}
.cmp-val.is-worst {
  background: rgba(248,113,113,.1);
  color: #f87171;
}

/* Mobile */
@media (max-width: 640px) {
  .cmp-tray-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
    gap: 10px;
  }
  .cmp-tray-label {
    min-width: unset;
  }
  .cmp-slot {
    height: 44px;
  }
}
