/* ══════════════════════════════════════════════════════════════
   IMGSWIFT v7 — IDB-HISTORY.CSS
══════════════════════════════════════════════════════════════ */

.history-panel {
  margin: 20px auto 0;
  max-width: 860px;
  padding: 0 16px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.history-clear-btn {
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.history-clear-btn:hover {
  color: var(--text);
  background: var(--border);
}

/* ── Grid of cards ── */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

/* ── Single card ── */
.history-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, transform 0.18s;
}

.history-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.history-card--removing {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.25s, transform 0.25s;
}

/* ── Thumbnail ── */
.history-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--card2);
  display: block;
}

/* ── Info row ── */
.history-info {
  padding: 8px 10px 4px;
  flex: 1;
}

.history-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.history-tool,
.history-size,
.history-date {
  font-size: 10px;
  color: var(--muted);
}

.history-tool {
  background: var(--card2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Action buttons ── */
.history-actions {
  display: flex;
  border-top: 1px solid var(--border);
}

.history-dl-btn,
.history-rm-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 7px 0;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.history-dl-btn:hover {
  background: var(--accent);
  color: #fff;
}

.history-rm-btn {
  border-left: 1px solid var(--border);
  font-size: 12px;
}

.history-rm-btn:hover {
  background: #e0334420;
  color: #e03344;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .history-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
