/* ==========================================================================
   BoringTools.io — components.css
   ========================================================================== */

/* -- Icon buttons (theme toggle, language) -- */
.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-sunken); }
.icon-btn svg { width: 17px; height: 17px; }

.lang-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
}

/* -- Buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.92rem;
}
.btn:hover { border-color: var(--text); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn--accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--ghost { border-color: transparent; }
.btn--small { padding: 0.35rem 0.6rem; font-size: 0.82rem; }

/* -- Calculator card -- */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  max-width: var(--content-width);
  margin: 0 auto;
  overflow: hidden;
}

.calc-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.calc-tab {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.95rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.calc-tab:hover { color: var(--text); }
.calc-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.calc-panel { display: none; padding: 1.75rem 1.5rem 2rem; }
.calc-panel.is-active { display: block; }

.calc-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
}
.calc-row .static-text { color: var(--text); }

.field {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.field input {
  border: none;
  background: transparent;
  padding: 0.55rem 0.7rem;
  width: 10ch;
  font-family: var(--font-mono);
  font-size: 1.02rem;
  color: var(--text);
}
/* Native date/time pickers need their own browser-drawn chrome (calendar
   icon, segmented day/month/year or hour/minute) which doesn't fit in a
   fixed character-width box the way plain numbers do. */
.field input[type="date"] {
  width: auto;
  min-width: 11.5em;
}
.field input[type="time"] {
  width: auto;
  min-width: 6.5em;
}
.field input[type="checkbox"] {
  width: auto;
  padding: 0;
}
.field input:focus { outline: none; }
.field:focus-within { border-color: var(--accent); }
.field .unit {
  padding: 0 0.65rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.mode-switch button {
  border: none;
  background: var(--surface);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border-strong);
}
.mode-switch button:last-child { border-right: none; }
.mode-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }

/* -- Result readout: the one bold element on the page -- */
.readout {
  position: relative;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface-sunken);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-top: 1.4rem;
}
.readout__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.readout__value {
  font-family: var(--font-mono);
  font-size: var(--step-4);
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  word-break: break-word;
}
.readout__value .sign--up { color: var(--increase); }
.readout__value .sign--down { color: var(--decrease); }
.readout__formula {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.readout__empty { color: var(--text-muted); font-size: 0.95rem; }

.readout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.4rem;
}
.readout-grid .readout { border: none; border-radius: 0; margin-top: 0; }
.readout-grid .readout .readout__value { font-size: var(--step-3); }

/* -- Info / formula boxes for the explanation section -- */
.info-box, .formula-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}
.formula-box {
  background: var(--surface-sunken);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  overflow-x: auto;
}
.info-box p:last-child { margin-bottom: 0; }
.info-box--notice {
  border-color: var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface-sunken);
  font-size: 0.9rem;
}

.example-list { padding-left: 1.1rem; }
.example-list li { margin-bottom: 0.6rem; }

/* -- FAQ accordion -- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-q .chevron { transition: transform .15s ease; flex: none; color: var(--text-muted); }
.faq-q[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 0 1.1rem; color: var(--text-muted); }
.faq-a.is-open { display: block; }

/* -- Related tools inline list -- */
.related-tools { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.related-tools a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.8rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}
.related-tools a:hover { border-color: var(--border-strong); background: var(--surface-sunken); }

/* -- Cookie / consent banner -- */
.consent-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  z-index: 50;
}
.consent-banner p { font-size: 0.87rem; margin-bottom: 0.8rem; }
.consent-banner__actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
.consent-banner[hidden] { display: none; }

/* -- Home: trust badges -- */
.trust-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.1rem 0 1.5rem;
}
.trust-badges span {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.trust-badges svg { width: 14px; height: 14px; color: var(--accent-strong); flex: none; }

/* -- Home: category overview cards -- */
.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 3rem;
}
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.5rem 1.4rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform .12s ease;
}
.category-card:hover { transform: translateY(-2px); }
.category-card svg { width: 22px; height: 22px; color: var(--accent); }
.category-card .name { font-weight: 600; font-size: 1.02rem; }
.category-card .count { font-size: 0.8rem; color: var(--text-muted); }
.category-card .desc { font-size: 0.86rem; color: var(--text-muted); }

/* -- Home: category filter chips -- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip:hover { color: var(--text); border-color: var(--accent); }
.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

/* -- Home: tool card badges -- */
.tool-grid__item { position: relative; }
.badge {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius);
}
.badge--live { background: var(--increase); color: #fff; }
.badge--soon { border: 1px solid var(--border-strong); color: var(--text-muted); }
.tool-grid__item .category-tag {
  font-size: 0.72rem;
  color: var(--accent-strong);
  font-weight: 600;
}

/* -- Header search -- */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-search__icon {
  position: absolute;
  left: 0.6rem;
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 150px;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.7rem 0.4rem 1.9rem;
  font-size: 0.85rem;
  transition: width .15s ease, border-color .15s ease;
}
.search-input:focus { width: 210px; border-color: var(--accent); outline: none; background: var(--surface); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: 260px;
  max-width: 80vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  z-index: 40;
}
.search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--surface-sunken); }
.search-result.is-soon { color: var(--text-muted); cursor: default; }
.search-result .tag {
  font-size: 0.68rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.05rem 0.35rem;
  white-space: nowrap;
  flex: none;
}
.search-empty { padding: 0.75rem 0.9rem; font-size: 0.85rem; color: var(--text-muted); }

@media (max-width: 720px) {
  .search-input { width: 34px; padding-left: 1.9rem; cursor: pointer; }
  .search-input::placeholder { color: transparent; }
  .search-input:focus { width: 150px; cursor: text; }
  .search-input:focus::placeholder { color: var(--text-muted); }
}

@media (max-width: 560px) {
  .readout-grid { grid-template-columns: 1fr; }
  .readout__value { font-size: var(--step-3); }
}

/* -- Text tools: textarea, stats grid, QR box -- */
.text-input-area {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0.9rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}
.text-input-area:focus { outline: none; border-color: var(--accent); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.1rem;
}
.stats-grid .stat { background: var(--surface); padding: 0.9rem; text-align: center; }
.stats-grid .stat .value { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; }
.stats-grid .stat .label { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.25rem; }

.case-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }

.qr-box {
  display: inline-block;
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.qr-box svg { display: block; width: 220px; height: 220px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.zone-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.zone-row:last-child { border-bottom: none; }
.zone-name { font-weight: 600; }

/* -- Tool actions bar: Share / Export to PDF -- */
.tool-actions-bar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  max-width: var(--content-width);
  margin: 0 auto 1.25rem;
}
.tool-actions-bar .btn svg { width: 15px; height: 15px; }

/* -- Data table: price comparison / sales projection rows -- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  padding: 0.5rem 0.7rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.data-table td { font-family: var(--font-mono); }
.data-table td:first-child { font-family: var(--font-ui); }
.data-table tr.is-selected td {
  color: var(--accent-strong);
  font-weight: 600;
  background: var(--surface-sunken);
}

/* -- Likes bar: Like / Dislike below the calculator -- */
.rating-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: var(--content-width);
  margin: 1.4rem auto 2.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.rating-bar .btn svg { width: 15px; height: 15px; }
.rating-bar .btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
