/* ── Tool Page Styles ───────────────────────────────────────
   Loaded only on pages using the Tool template.
   Uses CSS custom properties from the global Tailwind theme.
   ─────────────────────────────────────────────────────────── */

/* Tool container wrapper */
.tool-container {
  background-color: #fff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.1),
    0 1px 2px rgb(0 0 0 / -0.1);
  margin-bottom: 2rem;
}

.tool-container label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Tool output / result area */
.tool-output {
  background-color: #f1f5f9;
  border-radius: 0.75rem;
  padding: 1.5rem;
  min-height: 6rem;
  border: 2px dashed #cbd5e1;
  transition: border-color 0.2s ease;
}

.tool-output.has-result {
  border-style: solid;
  border-color: #0d9488;
  background-color: #f0fdfa;
}

.tool-output pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.625;
  margin: 0;
}

/* Copy-to-clipboard button */
.tool-output .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  background-color: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-output .copy-btn:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

/* Tool sidebar (related tools, info panels) */
.tool-sidebar-card {
  background-color: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  margin-bottom: 1.5rem;
}

.tool-sidebar-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0fdfa;
}

/* Related tools list */
.related-tool-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.15s ease;
}

.related-tool-link:hover {
  background-color: #f5f5f4;
  color: #0d9488;
}

.related-tool-link .icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  background-color: #f0fdfa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

/* Tool action bar (buttons row below tool) */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* Tab-style options within a tool */
.tool-tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  background-color: transparent;
  color: #6b7280;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-tab:hover {
  background-color: #f1f5f9;
  color: #374151;
}

.tool-tab.active {
  background-color: #0d9488;
  color: #fff;
}

/* Loading state for tool processing */
.tool-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.tool-loading .spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e5e7eb;
  border-top-color: #0d9488;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* ═══════════════════════════════════════════════════════════════
   TOOL PAGE LAYOUT — shared by all per-tool templates
   ═══════════════════════════════════════════════════════════════ */

/* Page article wrapper */
.tool-page-article {
  padding: 2rem 0 4rem;
}

/* Tool page header */
.tool-page-header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-page-header__meta {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.tool-page-icon {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  background-color: #ccfbf1;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
}

.tool-page-title {
  font-size: 2rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  margin: 0;
}

@media (max-width: 640px) {
  .tool-page-title {
    font-size: 1.5rem;
  }
}

.tool-page-desc {
  font-size: 1.0625rem;
  color: #6b7280;
  margin-top: 0.25rem;
  line-height: 1.6;
}

/* Two-column grid */
.tool-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .tool-page-grid {
    grid-template-columns: minmax(0, 2fr) 280px;
  }
}

/* Shared form label */
.tool-label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #374151;
  margin-bottom: 0.4rem;
}

/* Shared copy button inside output panels */
.copy-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  background-color: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background-color: #f0fdfa;
  border-color: #0d9488;
  color: #0d9488;
}

/* Below-tool content */
.tool-below-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.tool-below-content p {
  color: #374151;
  line-height: 1.75;
}

/* Btn small */
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

/* Textarea shared */
.textarea-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #111827;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.textarea-field:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* mt-* utilities (keep small, actual Tailwind handles spacing) */
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mt-8 {
  margin-top: 2rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
