/* ============================================================
   Tools Section - Isolated Styles (Additive)
   Scoped to the new /tools ecosystem. Does not modify site-wide CSS.
   ============================================================ */

.tool-upload-zone {
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
.tool-upload-zone.tool-dragover {
  border-color: rgba(59, 130, 246, 0.8);
  background-color: rgba(59, 130, 246, 0.04);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

@keyframes toolPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.tool-pulse {
  animation: toolPulse 1.2s ease-in-out infinite;
}

@keyframes toolSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.tool-spinner {
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  border-top-color: currentColor;
  width: 26px;
  height: 26px;
  animation: toolSpin 0.8s linear infinite;
}

.tool-hidden {
  display: none !important;
}

.tool-progress-fill {
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toolFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.tool-fade-up {
  animation: toolFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tool-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
}

/* Tools hub search input focus */
.tool-search-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Prevent conflicting animations with the global site */
.tools-page *,
.tools-page *::before,
.tools-page *::after {
  box-sizing: border-box;
}

/* Repair ZIP file/folder browser (scoped additions used only by the widget) */
.repair-tree details {
  margin-left: 14px;
  border-left: 1px solid rgba(100, 116, 139, 0.18);
  padding-left: 10px;
}
.repair-tree > details:first-child {
  margin-left: 0;
  border-left: none;
  padding-left: 0;
}
.repair-tree summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 8px;
}
.repair-tree summary::-webkit-details-marker {
  display: none;
}
.repair-tree summary::before {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 9px;
  color: #94a3b8;
  margin-right: 8px;
  transition: transform 0.2s ease;
}
.repair-tree details[open] > summary::before {
  transform: rotate(-90deg);
}
.repair-tree summary:hover {
  background: rgba(59, 130, 246, 0.06);
}
.repair-tree-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  min-width: 0;
}
.repair-tree details > summary .repair-tree-label {
  flex: 1;
  min-width: 0;
}
.repair-tree-file:hover {
  background: rgba(59, 130, 246, 0.06);
}
.repair-tree-unreadable:hover {
  background: transparent;
  cursor: default;
  opacity: 0.75;
}
.repair-tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.repair-tree-meta {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
}
.repair-tree input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}
.repair-tree input[type='checkbox']:disabled {
  cursor: not-allowed;
}
.repair-tree-children {
  margin: 2px 0 6px;
}
.repair-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}
.repair-badge-unreadable {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.dark .repair-tree-label {
  color: #cbd5e1;
}
.dark .repair-tree-meta {
  color: #64748b;
}

/* ---------------------------------------------------------------------------
   New archive tools widgets (download / split / compare / report).
   Additive styles used by the 55 new tool family.
--------------------------------------------------------------------------- */
.nt-report-sections {
  width: 100%;
}
.nt-report-table {
  border-collapse: collapse;
}
.nt-report-table tbody tr {
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
}
.dark .nt-report-table tbody tr {
  border-bottom-color: #1e293b;
}
.nt-report-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}
.nt-tree summary::-webkit-details-marker {
  display: none;
}
.nt-tool-hint {
  font-size: 0.72rem;
  color: #94a3b8;
}
.dark .nt-tool-hint {
  color: #64748b;
}
