/* SwiftCalcTools — Custom styles (Tailwind CDN covers utilities) */

/* ── Base ─────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Nav helpers (used in layout.php) ────────────────────────────── */
.nav-link {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  color: #cbd5e1;       /* slate-300 */
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s, background-color 0.15s;
  white-space: nowrap;
}
.nav-link:hover    { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link-active   { color: #fff; background: rgba(59,130,246,0.25); }
.mobile-nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  transition: color 0.15s, background 0.15s;
}
.mobile-nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.footer-link {
  color: #94a3b8;      /* slate-400 */
  transition: color 0.15s;
}
.footer-link:hover { color: #fff; }

/* ── Search dropdown items ────────────────────────────────────────── */
.search-item {
  display: flex;
  flex-direction: column;
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #eff6ff; }
.search-item-name { font-size: 0.875rem; font-weight: 500; color: #1e293b; }
.search-item-cat  { font-size: 0.75rem; color: #64748b; margin-top: 0.1rem; }

/* ── Prose-like typography for static pages + tool sections ──────── */
.prose-custom h2 { font-size: 1.35rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; color: #1e293b; }
.prose-custom h3 { font-size: 1.1rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #334155; }
.prose-custom p  { margin-bottom: 1rem; color: #475569; line-height: 1.75; }
.prose-custom a  { color: #2563eb; text-decoration: underline; }
.prose-custom a:hover { color: #1d4ed8; }
.prose-custom ul, .prose-custom ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose-custom li { margin-bottom: 0.4rem; color: #475569; line-height: 1.7; }
.prose-custom strong { color: #1e293b; font-weight: 600; }
.prose-custom code {
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
}

/* ── Tool widget ──────────────────────────────────────────────────── */
.tool-input-group {
  margin-bottom: 1rem;
}
.tool-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
.tool-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.tool-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: #1e293b;
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.tool-select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

.btn-calculate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: #2563eb;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.btn-calculate:hover  { background: #1d4ed8; box-shadow: 0 6px 16px rgba(37,99,235,0.35); }
.btn-calculate:active { transform: scale(0.98); }

.btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-reset:hover { background: #f8fafc; color: #1e293b; }

/* Result box */
.result-box {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.result-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1.1;
}
.result-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.375rem;
  font-weight: 500;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}
.result-row:last-child { border-bottom: none; }
.result-row-label { color: #64748b; }
.result-row-value { font-weight: 600; color: #1e293b; }

/* FAQ accordion */
.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.faq-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.faq-question:hover { background: #f8fafc; }
.faq-question[aria-expanded="true"] { background: #eff6ff; color: #1d4ed8; }
.faq-question-icon { flex-shrink: 0; transition: transform 0.25s; }
.faq-question[aria-expanded="true"] .faq-question-icon { transform: rotate(180deg); }
.faq-answer {
  display: none;
  padding: 0 1.25rem 1rem;
  background: #fff;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.7;
}
.faq-answer.open { display: block; }

/* ── Ad slot placeholder styling ─────────────────────────────────── */
.ad-slot {
  min-height: 90px;
}
.ad-slot-placeholder {
  background: #f8fafc;
  border: 2px dashed #e2e8f0;
  border-radius: 0.75rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
}

/* ── Table utility ────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  background: #1e293b;
  color: #fff;
  padding: 0.625rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}
.data-table tr:hover td { background: #f8fafc; }

/* Line-clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Print styles ─────────────────────────────────────────────────── */
@media print {
  header, footer, nav, .ad-slot, .print\:hidden { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  .result-box { border: 1px solid #ccc; background: #f9f9f9; }
}
