/* Reading Time Estimator — AllOmnitools Styles */
/* Matches YouTube Earnings Calculator design system */

/* ── Theme Variables (Light mode default) ── */
:root {
  --bg: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #ef4444;
  --primary-gradient: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --primary-light: #fef2f2;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary-light: #2d0a0a;
}

body {
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ── Ad slots hidden ── */
.ad-slot,
.ad-leaderboard,
.ad-in-article,
.ad-anchor,
.ad-placeholder,
[class*='ad-slot'] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Page hero ── */
.tool-hero {
  background: var(--primary-gradient);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  color: #fff;
}
.tool-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff !important;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.tool-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 1rem;
}

/* ── Main layout ── */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Calculator card ── */
.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.calc-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.calc-card h2 svg {
  color: #ef4444;
}

/* ── Form fields ── */
.form-field {
  margin-bottom: 1.25rem;
}
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.form-field .field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.form-field textarea {
  resize: vertical;
  min-height: 180px;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ── Two-column form grid ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Custom WPM field toggle */
#customWpmField {
  margin-top: 0;
  padding-top: 0;
}

/* ── Buttons (primary & secondary) ── */
.field.is-grouped {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.field.is-grouped .control {
  flex: 1;
}
.calc-btn {
  width: 100%;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.calc-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}
.calc-btn.secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.calc-btn.secondary:hover {
  background: var(--border);
  transform: translateY(-1px);
  box-shadow: none;
}

/* ── Results grid (same as YouTube calculator) ── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 600px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}
.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
}
.result-card .rc-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.result-card .rc-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.result-card.highlight {
  background: linear-gradient(135deg, #fef2f2, #fff7ed);
  border-color: #fca5a5;
  grid-column: 1 / -1;
}
html[data-theme="dark"] .result-card.highlight {
  background: linear-gradient(135deg, #2d0a0a, #1c1208);
  border-color: #7f1d1d;
}
.result-card.highlight .rc-value {
  font-size: 2rem;
  color: #ef4444;
}

/* ── Paragraph breakdown box ── */
#rteParagraphBreakdown .box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 1rem;
}

/* ── "People Also Use" section ── */
.related-tools-section {
  margin: 2rem 0;
}
.related-tools-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 600px) {
  .related-tools-grid {
    grid-template-columns: 1fr;
  }
}
.tool-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -12px rgba(0, 0, 0, 0.15);
}
.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 60px;
  margin-bottom: 0.75rem;
}
.tool-title {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.tool-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Content section (About, FAQ, Tips) ── */
.content-section {
  margin-top: 2rem;
}
.content-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  border-left: 3px solid #ef4444;
  padding-left: 0.75rem;
}
.content-section p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.content-section ol {
  padding-left: 1.25rem;
}
.content-section ol li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

/* Steps box */
.steps-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  counter-reset: steps;
  margin-bottom: 1rem;
}
.steps-box li {
  list-style: none;
  padding: 0.5rem 0 0.5rem 2.5rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.steps-box li:last-child {
  border-bottom: none;
}
.steps-box li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 24px;
  height: 24px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 24px;
  text-align: center;
}

/* Feature pills */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
@media (max-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}
.feature-pill {
  background: var(--primary-light);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}
.feature-pill strong {
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.feature-pill p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* FAQ items */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.85rem;
}
.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.faq-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
}

/* Related tools list */
.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-list li {
  border-bottom: 1px solid var(--border);
}
.related-list li:last-child {
  border-bottom: none;
}
.related-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.related-list a:hover {
  color: var(--primary);
}
.related-list a::before {
  content: "→";
  color: #ef4444;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Footer (if not using universal footer) ── */

.accuracy-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#rteResults {
  animation: fadeIn 0.3s ease;
}

/* ── Responsive tweaks ── */
@media (max-width: 768px) {
  .tool-hero h1 {
    font-size: 1.6rem;
  }
  .calc-card {
    padding: 1.25rem;
  }
  .result-card .rc-value {
    font-size: 1.2rem;
  }
  .result-card.highlight .rc-value {
    font-size: 1.6rem;
  }
}
/* ── Footer ── */
#footer-root {
  background: #000000;
  margin-top: 3rem;
}
.site-footer {
  background: #000000 !important;
  color: #94a3b8 !important;
}
.site-footer a { color: #94a3b8 !important; }
.site-footer a:hover { color: #fff !important; }
