/* ============================================================
   TOOL — upload zone, file list, progress, table, stats
   ============================================================ */

/* ── Tool card wrapper ─────────────────────────────────────── */
.tool-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-md), var(--shadow-xl);
  overflow: hidden;
}

.tool-card__header {
  background: var(--gradient-primary);
  padding: 14px var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.tool-card__body {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ── Drop zone ─────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-alt);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-normal), background var(--transition-normal);
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--color-primary);
  background: #eff6ff;
}

.dropzone__icon {
  margin-inline: auto;
  margin-bottom: var(--space-3);
  color: var(--color-text-subtle);
}

.dropzone__text {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

.dropzone__browse {
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition-fast);
}

.dropzone__browse:hover {
  text-decoration-color: var(--color-primary);
}

.dropzone__hint {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.dropzone__input {
  display: none;
}

.dropzone__privacy {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

/* ── File list ─────────────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.file-list:empty { display: none; }

.file-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-4);
  animation: slideIn 150ms ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-list__name {
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list__size {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.file-list__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-danger);
  font-size: 1rem;
  line-height: 1;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.file-list__remove:hover {
  background: rgba(220,38,38,.08);
}

/* ── Actions row ───────────────────────────────────────────── */
.tool-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.export-btns {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.export-btns svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ── Progress ──────────────────────────────────────────────── */
.progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress__bar-track {
  background: var(--color-border);
  border-radius: var(--radius-full);
  height: 5px;
  overflow: hidden;
}

.progress__bar {
  height: 5px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width var(--transition-slow);
}

.progress__bar--indeterminate {
  width: 40%;
  animation: indeterminate 1.2s infinite ease-in-out;
}

@keyframes indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.progress__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ── Result stats ──────────────────────────────────────────── */
.result-stats {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
  background: #eff6ff;
  border: 1px solid rgba(37,99,235,.15);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
}

.result-stats__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-stats__value {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.result-stats__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ── Table wrap ────────────────────────────────────────────── */
.table-wrap {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-wrap__header {
  padding: var(--space-3) var(--space-4);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-wrap__title {
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.table-wrap__count {
  color: rgba(255,255,255,.75);
  font-size: var(--font-size-xs);
}

.table-wrap__scroll {
  overflow-x: auto;
  max-height: 440px;
  overflow-y: auto;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

.table-wrap__scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.table-wrap__scroll::-webkit-scrollbar-track { background: transparent; }
.table-wrap__scroll::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: var(--radius-full); }

/* ── Data table ────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
}

.data-table thead th {
  background: #1e3a5f;
  color: white;
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  letter-spacing: .02em;
}

.data-table tbody tr:nth-child(even) { background: var(--color-bg-alt); }
.data-table tbody tr:hover { background: #eff6ff; }

.data-table tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody td.is-empty { color: var(--color-text-subtle); }
