/* ===========================
   HISTORY PAGE
   =========================== */
.page-inner-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.page-inner-header h2 { font-size: 18px; font-weight: 700; color: var(--accent-light); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border); font-size: 16px; transition: all var(--transition); }
.icon-btn.danger { color: var(--danger); border-color: rgba(229,57,53,0.3); }
.icon-btn.danger:hover { background: rgba(229,57,53,0.1); }

.history-list { display: flex; flex-direction: column; gap: 12px; }

.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-dim);
}
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 15px; margin-bottom: 4px; }
.empty-state small { font-size: 12px; opacity: 0.6; }

.history-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: flex; gap: 12px; cursor: pointer;
  transition: all var(--transition);
}
.history-item:hover { border-color: var(--border-bright); box-shadow: var(--shadow-glow); }
.history-item:active { transform: scale(0.99); }
.history-card-img { width: 50px; height: 78px; object-fit: cover; border-radius: 6px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.history-item-body { flex: 1; min-width: 0; }
.history-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.history-card-name { font-size: 13px; font-weight: 700; color: var(--accent-light); }
.history-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.history-topic-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  margin-bottom: 6px;
}
.badge-love { background: rgba(255,107,157,0.15); color: #ff6b9d; }
.badge-career { background: rgba(255,183,77,0.15); color: #ffb74d; }
.badge-health { background: rgba(102,187,106,0.15); color: #66bb6a; }
.badge-family { background: rgba(171,71,188,0.15); color: #ab47bc; }
.history-preview {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.history-item-delete {
  display: flex; align-items: flex-start;
  color: var(--text-dim); font-size: 18px; padding: 2px; flex-shrink: 0;
  transition: color var(--transition);
}
.history-item-delete:hover { color: var(--danger); }

/* History Modal */
.modal-box-lg {
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  margin: 0 auto;
  padding: 24px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-close {
  position: sticky; top: 0; right: 0; float: right;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-mid); border-radius: 50%; cursor: pointer;
  font-size: 14px; color: var(--text-muted); z-index: 10;
}
.history-detail { padding: 0; }
.history-detail-header { display: flex; gap: 16px; margin-bottom: 16px; }
.history-detail-img { width: 100px; height: 156px; object-fit: cover; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.5); flex-shrink: 0; }
.history-detail-meta { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.history-detail-name { font-size: 18px; font-weight: 700; color: var(--accent-light); }
.history-detail-date { font-size: 12px; color: var(--text-dim); }
.history-detail-concern { font-size: 13px; color: var(--text-muted); font-style: italic; background: var(--bg-mid); padding: 10px 12px; border-radius: 8px; border-left: 3px solid var(--accent); margin-bottom: 14px; }
.history-detail-interp { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }

/* Multi-card display in history modal */
.multi-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.multi-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.multi-card-header img {
  width: 40px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.multi-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.multi-card-id {
  font-size: 11px;
  color: var(--text-muted);
}

.multi-card-interpretation {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.history-detail-interp-multi {
  margin-top: 12px;
}
