/* Tools section — shared layout */
:root {
  --tool-surface: #fff;
  --tool-border: rgba(15, 23, 42, 0.08);
  --tool-muted: #64748b;
  --tool-bg: #f8fafc;
}

.tools-breadcrumb {
  font-size: 0.85rem;
  color: var(--tool-muted);
  margin-bottom: 0.75rem;
}
.tools-breadcrumb a {
  color: var(--tool-muted);
  text-decoration: none;
}
.tools-breadcrumb a:hover {
  color: var(--primary-color, #ff6600);
}

.tool-shell {
  max-width: 1100px;
  margin: 0 auto;
}

.tool-panel {
  background: var(--tool-surface);
  border: 1px solid var(--tool-border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.tool-header {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #0f172a;
}

.tool-textarea,
.tool-input,
.tool-panel textarea,
.tool-panel .form-control,
.tool-panel .form-select {
  border-radius: 10px;
  border-color: var(--tool-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.tool-textarea {
  width: 100%;
  min-height: 220px;
  padding: 0.85rem 1rem;
  resize: vertical;
  background: var(--tool-bg);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tool-dropzone,
.dropzone {
  border: 2px dashed rgba(255, 102, 0, 0.35);
  border-radius: 14px;
  padding: 2rem 1rem;
  text-align: center;
  background: rgba(255, 102, 0, 0.03);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.tool-dropzone:hover,
.tool-dropzone.is-dragover,
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary-color, #ff6600);
  background: rgba(255, 102, 0, 0.08);
}

.tool-output {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  max-height: 420px;
  overflow: auto;
}

.tool-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.tool-stat {
  background: var(--tool-bg);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  min-width: 110px;
}
.tool-stat .label {
  display: block;
  font-size: 0.75rem;
  color: var(--tool-muted);
}
.tool-stat .value {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0f172a;
}

.tool-note {
  border-left: 3px solid var(--primary-color, #ff6600);
  background: rgba(255, 102, 0, 0.06);
  padding: 0.85rem 1rem;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  color: #334155;
}

.tool-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  z-index: 1080;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.tool-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.category-card {
  height: 100%;
  border: 1px solid var(--tool-border);
  border-radius: 14px;
  padding: 1.35rem;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.category-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 102, 0, 0.1);
  color: var(--primary-color, #ff6600);
  margin-bottom: 0.85rem;
}
.category-card-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.category-card-desc {
  color: var(--tool-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.tool-card {
  height: 100%;
  border: 1px solid var(--tool-border);
  border-radius: 14px;
  padding: 1.2rem;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.tool-card-icon {
  color: var(--primary-color, #ff6600);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.tool-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.tool-card p {
  color: var(--tool-muted);
  font-size: 0.9rem;
  flex: 1;
}
.tool-card .btn {
  align-self: flex-start;
}

.related-tools a {
  display: block;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--tool-border);
  border-radius: 10px;
  text-decoration: none;
  color: #0f172a;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s, color 0.15s;
}
.related-tools a:hover {
  border-color: var(--primary-color, #ff6600);
  color: var(--primary-color, #ff6600);
}

.swatch {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--tool-border);
}

.diff-add { background: #dcfce7; }
.diff-del { background: #fee2e2; }
.diff-same { background: transparent; }

.regex-match {
  background: #fde68a;
  border-radius: 2px;
  padding: 0 2px;
}

@media (max-width: 767px) {
  .tool-textarea { min-height: 160px; }
  .tool-panel { padding: 1rem; }
}
