/* =====================================================
   TOOL SYSTEM – THE INFINITE INSIGHTS
   Shared UI for ALL tools
   ===================================================== */

/* ---------- Variables ---------- */
:root {
  --tool-bg: var(--brand-bg, #fbf6ef);
  --tool-primary: #ce8460;
  --tool-primary-dark: #c57752;
  --tool-text-dark: #1c1c1c;
  --tool-text-muted: #777;
  --tool-border: rgba(0,0,0,0.12);
}

/* ---------- Tool Hero ---------- */
.tool-hero {
  background: var(--tool-bg);
  padding: 70px 0;
  text-align: center;
}

.tool-hero h1 {
  font-family: "Unna", serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--tool-text-dark);
}

.tool-hero p {
  max-width: 720px;
  margin: 10px auto 0;
  font-size: 15px;
  color: var(--tool-text-muted);
}

/* ---------- Tool Section ---------- */
.tool-section {
  background: var(--tool-bg);
}

.tool-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.08);
}

/* ---------- Inputs ---------- */
.tool-textarea,
.tool-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--tool-border);
  padding: 16px;
  font-size: 15px;
  outline: none;
  resize: vertical;
}

.tool-textarea {
  min-height: 220px;
}

.tool-input {
  margin-bottom: 12px;
  font-size: 14px;
}

.tool-textarea:focus,
.tool-input:focus {
  border-color: var(--tool-primary);
  box-shadow: 0 0 0 2px rgba(206,132,96,0.15);
}

/* ---------- Tool Stats (Word Counter) ---------- */
.tool-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.stat-box {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.stat-box span {
  font-size: 22px;
  font-weight: 700;
  color: var(--tool-text-dark);
}

.stat-box small {
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- Buttons (GLOBAL) ---------- */
.tool-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tool-actions .btn {
  min-width: 140px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

/* Primary CTA */
.btn-cta {
  background: var(--tool-primary);
  color: #fff;
  border: none;
}

.btn-cta:hover {
  background: var(--tool-primary-dark);
  transform: translateY(-1px);
}

/* Outline */
.btn-outline {
  background: transparent;
  border: 2px solid #d1d5db;
  color: #374151;
}

.btn-outline:hover {
  background: #f3f4f6;
}

/* Danger */
.btn-outline.danger {
  border-color: #ef4444;
  color: #ef4444;
}

.btn-outline.danger:hover {
  background: #fee2e2;
}

/* ---------- Tool Info ---------- */
.tool-info h3 {
  font-family: "Unna", serif;
  font-size: 22px;
  margin-bottom: 10px;
}

.tool-info p {
  font-size: 15px;
  color: #555;
}

.tool-privacy {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

/* ---------- Density / Table Tools ---------- */
.density-results,
.tool-results-box {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  border: 1px solid rgba(0,0,0,0.08);
  margin-top: 20px;
}

.density-results table {
  width: 100%;
  border-collapse: collapse;
}

.density-results th,
.density-results td {
  padding: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 14px;
}

.density-results th {
  font-weight: 700;
}

.density-highlight {
  color: var(--tool-primary);
  font-weight: 700;
}

/* ---------- Alerts / Warnings ---------- */
.tool-alert {
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 15px;
}

.alert-info {
  background: #e7f0ff;
  border-left: 4px solid #3b82f6;
}

.alert-success {
  background: #e9f9f0;
  border-left: 4px solid #10b981;
}

.alert-warning {
  background: #fff1f2;
  border-left: 4px solid #ef4444;
}

/* ---------- JSON Result ---------- */
.json-result {
  background: #0f172a;
  color: #e5e7eb;
  padding: 16px;
  border-radius: 12px;
  font-family: monospace;
  font-size: 14px;
  white-space: pre-wrap;
  max-height: 400px;
  overflow: auto;
  margin-top: 20px;
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .tool-hero h1 {
    font-size: 24px;
  }

  .tool-textarea {
    min-height: 180px;
  }
}
