/* ============================================================
   CLAIPOT — TOOLS CSS
   Shared styles for all tool pages under /tools/
   ============================================================ */

/* ---- Tool Page Layout ---- */
.tool-hero {
  background: var(--cream-2);
  border-bottom: 1px solid var(--slate-200);
  padding: 3rem 0 2.5rem;
}
.tool-hero-inner {
  max-width: 760px;
}
.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tool-breadcrumb a { color: var(--clay-700); }
.tool-breadcrumb svg { width: 12px; height: 12px; }
.tool-hero h1 { font-size: var(--fs-3xl); margin: 0.5rem 0 0.75rem; }
.tool-hero p { font-size: var(--fs-lg); color: var(--ink-soft); max-width: 600px; }

/* ---- Tool Card (the interactive area) ---- */
.tool-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.tool-card + .tool-card { margin-top: 1.5rem; }

/* ---- Form Controls ---- */
.tool-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.tool-input,
.tool-select,
.tool-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  font-size: var(--fs-base);
  font-family: var(--font-body);
  transition: border-color var(--dur-fast) var(--ease-clay), box-shadow var(--dur-fast) var(--ease-clay);
  outline: none;
}
.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
  border-color: var(--clay-700);
  box-shadow: 0 0 0 3px var(--spark-glow);
  background: var(--white);
}
.tool-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.tool-select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4F60' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 16px; padding-right: 2.5rem;
}
.tool-field { margin-bottom: 1.25rem; }
.tool-field:last-child { margin-bottom: 0; }

/* ---- Buttons ---- */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--clay-700);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-clay), box-shadow var(--dur-fast) var(--ease-clay), transform var(--dur-fast) var(--ease-clay);
  letter-spacing: -0.01em;
  margin-top: 0.5rem;
}
.tool-btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.tool-btn:active { transform: translateY(0); }
.tool-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.tool-btn svg { width: 18px; height: 18px; }

.tool-btn-secondary {
  background: var(--cream-2);
  color: var(--clay-700);
  border: 1.5px solid var(--slate-200);
}
.tool-btn-secondary:hover { background: var(--clay-100); box-shadow: none; }

/* ---- Results Area ---- */
.tool-result {
  margin-top: 1.5rem;
  display: none;
}
.tool-result.visible { display: block; }

.result-card {
  background: var(--cream-2);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
  transition: border-color var(--dur-fast);
}
.result-card:hover { border-color: var(--clay-300); }
.result-card p { color: var(--ink); line-height: 1.65; font-size: var(--fs-base); }
.result-card .result-meta {
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  margin-top: 0.5rem;
  font-family: var(--font-mono);
}
.result-copy-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--clay-700);
  cursor: pointer;
  transition: all var(--dur-fast);
  font-family: var(--font-body);
}
.result-copy-btn:hover { background: var(--clay-700); color: var(--white); border-color: var(--clay-700); }
.result-copy-btn.copied { background: var(--success); color: var(--white); border-color: var(--success); }

/* Big result display (single output) */
.result-single {
  background: var(--cream-2);
  border: 1.5px solid var(--clay-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.result-single h4 {
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clay-700);
  margin-bottom: 1rem;
}

/* Score/metric display */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.metric-box {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.metric-box .val {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--clay-700);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.metric-box .lbl {
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

/* Tag chips */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tag-default { background: var(--clay-100); color: var(--clay-700); }
.tag-success { background: #D1FAE5; color: #065F46; }
.tag-warning { background: #FEF3C7; color: #92400E; }
.tag-danger  { background: #FEE2E2; color: #991B1B; }

/* Tips box */
.tool-tips {
  background: var(--cream-2);
  border-left: 3px solid var(--clay-700);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.tool-tips h4 {
  font-size: var(--fs-sm);
  color: var(--clay-700);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.tool-tips ul { padding-left: 1.25rem; }
.tool-tips li { font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: 0.3rem; }
.tool-tips li::marker { color: var(--clay-700); }

/* ---- Tool Content Sections (below the fold) ---- */
.tool-content { padding: 4rem 0; }
.tool-content-section {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
}
.tool-content-section h2 { font-size: var(--fs-2xl); margin-bottom: 1rem; }
.tool-content-section p { color: var(--ink-soft); line-height: 1.75; margin-bottom: 0.85rem; }
.tool-content-section p:last-child { margin-bottom: 0; }

/* ---- FAQ accordion ---- */
.faq-item {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--white);
  transition: background var(--dur-fast);
  list-style: none;
  gap: 1rem;
}
.faq-q:hover { background: var(--cream-2); }
.faq-q svg { width: 18px; height: 18px; color: var(--clay-700); flex-shrink: 0; transition: transform var(--dur) var(--ease-clay); }
details[open] .faq-q svg { transform: rotate(45deg); }
.faq-a {
  padding: 0 1.25rem 1.1rem;
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: var(--fs-sm);
  background: var(--white);
}

/* ---- Comparison Table ---- */
.tool-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.tool-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--cream-2);
  color: var(--ink);
  border-bottom: 2px solid var(--slate-200);
}
.tool-table td {
  padding: 0.75rem 1rem;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  border-bottom: 1px solid var(--slate-100);
}
.tool-table tr:hover td { background: var(--cream-2); }

/* ---- CTA section at bottom ---- */
.tool-cta-section {
  background: linear-gradient(135deg, var(--clay-700) 0%, var(--clay-900) 100%);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  color: var(--white);
  margin-top: 1.5rem;
}
.tool-cta-section h2 { color: var(--white); font-size: var(--fs-2xl); margin-bottom: 0.75rem; }
.tool-cta-section p { color: var(--clay-200); margin-bottom: 1.5rem; }
.tool-cta-section .btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--white);
  color: var(--clay-700);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: var(--fs-base);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.tool-cta-section .btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* ---- Tools Index grid ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.tool-grid-card {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
  text-decoration: none;
  color: inherit;
}
.tool-grid-card:hover {
  border-color: var(--clay-400);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.tool-grid-card .tgc-icon {
  width: 40px;
  height: 40px;
  background: var(--clay-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.tool-grid-card .tgc-icon svg { width: 20px; height: 20px; color: var(--clay-700); }
.tool-grid-card h3 { font-size: var(--fs-base); font-weight: 600; color: var(--ink); margin: 0; }
.tool-grid-card p { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0; line-height: 1.5; }
.tool-grid-card .tgc-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: var(--clay-100);
  color: var(--clay-700);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
  width: fit-content;
}
.tool-grid-card .tgc-arrow {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--fs-xs);
  color: var(--clay-700);
  font-weight: 600;
  margin-top: auto;
  padding-top: 0.5rem;
}
.tool-grid-card .tgc-arrow svg { width: 14px; height: 14px; }

/* Category header on tools index */
.tools-category { margin-bottom: 3rem; }
.tools-category-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--slate-200);
}
.tools-category-head h2 { font-size: var(--fs-xl); margin: 0; }
.tools-category-head .count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  background: var(--cream-2);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

/* ---- Tool two-col layout (input left, output right on desktop) ---- */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 700px) {
  .tool-layout { grid-template-columns: 1fr; }
}

/* ---- Progress ring (for score displays) ---- */
.score-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.score-ring { transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: var(--slate-200); stroke-width: 6; }
.score-ring-fill { fill: none; stroke: var(--clay-700); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease-spring); }
.score-ring-val { font-size: var(--fs-xl); font-weight: 700; color: var(--ink); }
.score-ring-lbl { font-size: var(--fs-xs); color: var(--ink-faint); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }

/* Spinner in button */
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

/* Mobile */
@media (max-width: 640px) {
  .tool-card { padding: 1.25rem; }
  .tool-hero { padding: 2rem 0 1.75rem; }
  .tool-content-section { padding: 1.5rem; }
  .tool-cta-section { padding: 2rem 1.25rem; }
}

/* ===== HOMEPAGE TOOL CATEGORY GRID ===== */
.tools-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.tools-cat-card {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 1.5px solid var(--clay-100);
  border-radius: 16px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.tools-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(79,70,229,.12);
  border-color: var(--clay-300);
  text-decoration: none;
}
.tools-cat-card.ai-cat:hover { border-color: var(--clay-700); }
.tools-cat-card.free-cat:hover { border-color: #16a34a; }
.tools-cat-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
}
.tools-cat-icon svg {
  width: 100%;
  height: 100%;
}
.tools-cat-body h4 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--ink);
}
.tools-cat-body p {
  font-size: var(--fs-sm);
  color: var(--ink-faint);
  line-height: 1.5;
  margin-bottom: .75rem;
}
.tools-cat-count {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-soft);
}
.tools-cat-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  border-radius: 4px;
}
.ai-badge { background: var(--clay-100); color: var(--clay-700); }
.free-badge { background: #dcfce7; color: #16a34a; }

@media (max-width: 900px) {
  .tools-category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .tools-category-grid { grid-template-columns: 1fr; }
}
