/* TrueTools.org — Tool-specific component styles
   Load on: tools/*.html  ·  guides/*.html (articles)
   Contains: tip-btns, swap-btn, tz-card, milestone-card, currency rows,
             scientific calculator keypad, invoice generator, hiw-snippet.
   ------------------------------------------------------------------ */

/* ── TOOL-SPECIFIC COMPONENTS (moved from inline <style> blocks) ── */

/* Tip button group — tip-calculator-usa */
.tip-btn-group { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.tip-btn {
  padding: .5rem 1.1rem;
  border: 2px solid var(--violet);
  background: transparent;
  color: var(--violet);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  min-height: 40px;
}
.tip-btn.active, .tip-btn:hover { background: var(--violet); color: #fff; }
[data-theme="dark"] .tip-btn { border-color: #c4b5fd; color: #c4b5fd; }
[data-theme="dark"] .tip-btn.active,
[data-theme="dark"] .tip-btn:hover  { background: #7c3aed; border-color: #7c3aed; color: #fff; }

/* Tip guide table */
.tip-guide-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .875rem; }
.tip-guide-table th { background: var(--violet); color: #fff; padding: .5rem .75rem; text-align: left; }
.tip-guide-table td { padding: .45rem .75rem; border-bottom: 1px solid var(--border); }
.tip-guide-table tr:last-child td { border-bottom: none; }
.tip-guide-table tr:nth-child(even) td { background: var(--violet-lt); }

/* Swap button — currency converter */
.swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: var(--violet);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: .1rem;
  transition: background .15s, transform .15s;
}
.swap-btn:hover { background: #5b21b6; transform: rotate(180deg); }
[data-theme="dark"] .swap-btn { background: #7c3aed; }
[data-theme="dark"] .swap-btn:hover { background: #6d28d9; }

/* Currency row — flex layout for converter inputs */
.currency-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.currency-row .form-group,
.currency-row .input-group { flex: 1; min-width: 140px; }

/* Milestone grid — age-calculator */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.milestone-card {
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.milestone-card .m-label { font-size: .78rem; color: var(--ink-2); }
.milestone-card .m-value { font-size: .95rem; font-weight: 600; margin-top: .1rem; color: var(--violet); }
.milestone-card .m-date  { font-size: .8rem; color: var(--ink); margin-top: .1rem; }
[data-theme="dark"] .milestone-card {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .milestone-card .m-value { color: #c4b5fd; }

/* Converted display — currency converter large result */
.converted-display {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--violet);
  margin: .5rem 0 .25rem;
  line-height: 1.1;
  word-break: break-word;
  overflow-wrap: anywhere;
}
[data-theme="dark"] .converted-display { color: #c4b5fd; }

.rate-line { font-size: .875rem; color: var(--ink-2); margin-bottom: .5rem; }

/* Disclaimer box — YMYL warning variant */
.disclaimer-box {
  background: rgba(254,243,199,.50);
  border: 1px solid rgba(253,230,138,.80);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .82rem;
  color: #78350f;
  margin-top: 1rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
[data-theme="dark"] .disclaimer-box {
  background: rgba(251,191,36,.10);
  border-color: rgba(251,191,36,.25);
  color: #fcd34d;
}

/* Quick table — reusable accent table for conversion/reference data */
.quick-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .875rem; }
.quick-table th { background: var(--violet); color: #fff; padding: .45rem .75rem; text-align: left; }
.quick-table td { padding: .4rem .75rem; border-bottom: 1px solid var(--border); }
.quick-table tr:last-child td { border-bottom: none; }
.quick-table tr:nth-child(even) td { background: var(--violet-lt); }
[data-theme="dark"] .quick-table th { background: #7c3aed; }

/* Name grid — business-name-generator */
.name-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.name-card {
  background: rgba(255,255,255,.45);
  border: 1.5px solid rgba(255,255,255,.65);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .625rem;
  transition: border-color .2s, box-shadow .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.name-card:hover { border-color: var(--rose); box-shadow: var(--shadow); }
.name-card .name-text {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}
.name-card .name-style-tag {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--rose);
}
.name-card button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .3rem .75rem;
  font-family: var(--font-body);
  font-size: .8125rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  color: var(--ink-2);
}
.name-card button:hover { background: var(--rose-lt); border-color: var(--rose); color: var(--rose); }
.name-card button.copied { background: var(--rose); border-color: var(--rose); color: #fff; }
#generate-btn { min-width: 180px; }
[data-theme="dark"] .name-card {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .name-card:hover { border-color: #fda4af; }
[data-theme="dark"] .name-card .name-style-tag { color: #fda4af; }

/* 10. Dark mode: glass inner shadow for dark surfaces */
[data-theme="dark"] .result-item {
  box-shadow: 0 2px 10px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.10);
}

/* PRINT STYLES ─────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .ad-banner, .ad-slot, .sidebar,
  .reactions, #share, .comments-section, .newsletter-form,
  .hamburger, .faq, .breadcrumb { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .container { max-width: 100%; padding: 0; }
  .layout { display: block; }
  .tool-card { box-shadow: none; border: 1px solid #ccc; }
  .result-box { border: 1px solid #ccc; background: #f9f9f9 !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; color: #555; }
  a[href^="/"]:after, a[href^="#"]:after { content: ""; }
}

/* ── Scientific Calculator Keypad ─────────────────────────────────── */
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  margin-top: 1rem;
}
.calc-btn {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  border-radius: var(--radius);
  transition: transform .1s, box-shadow .1s;
}
.calc-btn:active { transform: scale(.95); }
.calc-btn-empty { visibility: hidden; pointer-events: none; }
.calc-btn-zero { grid-column: span 2; }
.calc-btn-equals { grid-row: span 2; font-size: 1.5rem; }
#calc-display-wrap { text-align: right; padding: .5rem 0; }
#calc-expression { font-size: .875rem; min-height: 1.25rem; word-break: break-all; }
#calc-result { font-size: 2rem; font-weight: 800; word-break: break-all; }
#calc-memory-indicator { text-align: right; min-height: 1.25rem; color: var(--orange); font-weight: 600; }

@media (max-width: 480px) {
  .calc-keypad { gap: .35rem; }
  .calc-btn { min-height: 42px; font-size: .85rem; }
  #calc-result { font-size: 1.5rem; }
}

/* ── INVOICE GENERATOR ── */

@media print {
  body > *:not(#invoice-preview) { display: none !important; }
  #invoice-preview { display: block !important; }
  .ad-banner, #site-header, #site-footer, .sidebar, .reactions, .faq, .comments-section { display: none !important; }
}

/* Invoice preview styles */
#invoice-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 1.5rem;
  font-size: .9375rem;
}
.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.inv-from { max-width: 50%; }
.inv-from .inv-business-name {
  font-family: var(--font-head);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .25rem;
}
.inv-from address {
  font-style: normal;
  font-size: .875rem;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.inv-meta { text-align: right; }
.inv-meta .inv-title {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 800;
  color: var(--rose);
  margin-bottom: .5rem;
}
.inv-meta table { margin-left: auto; font-size: .875rem; }
.inv-meta td { padding: .2rem .5rem; }
.inv-meta td:first-child { font-weight: 600; color: var(--ink-2); text-align: right; }
.inv-meta td:last-child { color: var(--ink); }
.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.inv-party-label {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-2);
  margin-bottom: .35rem;
}
.inv-party-name { font-weight: 700; font-size: 1rem; }
.inv-party-addr {
  font-size: .875rem;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.inv-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.inv-items-table th {
  background: var(--ink);
  color: #fff;
  padding: .65rem .875rem;
  text-align: left;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.inv-items-table th:last-child { text-align: right; }
.inv-items-table td {
  padding: .65rem .875rem;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.inv-items-table td:nth-child(2),
.inv-items-table td:nth-child(3),
.inv-items-table td:nth-child(4) { text-align: right; }
.inv-items-table tr:last-child td { border-bottom: none; }
.inv-totals {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}
.inv-totals table { min-width: 260px; font-size: .9rem; }
.inv-totals td { padding: .4rem .875rem; }
.inv-totals td:first-child { color: var(--ink-2); font-weight: 600; }
.inv-totals td:last-child { text-align: right; font-weight: 600; }
.inv-total-row td {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--rose);
  border-top: 2px solid var(--rose);
  padding-top: .65rem;
}
.inv-notes {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: .875rem;
  color: var(--ink-2);
}
.inv-notes-label { font-weight: 700; color: var(--ink); margin-bottom: .35rem; }

/* Form line items table */
#items-table-wrapper { overflow-x: auto; margin-bottom: .875rem; }
.items-form-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.items-form-table th {
  background: var(--bg);
  padding: .5rem .75rem;
  text-align: left;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-2);
  border-bottom: 2px solid var(--border);
}
.items-form-table td { padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.items-form-table input { min-height: 38px; font-size: .875rem; }
.line-total { font-weight: 600; color: var(--teal-dk); text-align: right; padding: .4rem .75rem; vertical-align: middle; }

