/* public/css/calc-tabs.css   — REVISED 2026-05-02 (round 3: tightened selectors)
 *
 * Tab styling for calculators with Quick + Advanced modes.
 * Plus embed mode styles (when ?embed=1).
 *
 * IMPORTANT: embed-mode selectors target SPECIFIC aicost-* and calc-* classes,
 * NOT generic <nav>/<header>/<footer>. Tool views legitimately use <nav class=
 * "calc-breadcrumbs"> and <header class="of-hero"> etc. for content — hiding
 * those would break the calculator.
 */

/* ─── Tabs ──────────────────────────────────────────────────────── */
.calc-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 4px;
  margin: 16px 0 24px;
  position: relative;
}

.calc-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  color: #64748b;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.calc-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.calc-tab--active {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.calc-tab-icon  { font-size: 18px; line-height: 1; }
.calc-tab-label { font-size: 14px; font-weight: 600; }
.calc-tab-meta  { font-size: 11px; color: #94a3b8; font-weight: 400; }
.calc-tab--active .calc-tab-meta { color: #475569; }

.calc-tabs-spacer { flex-basis: 4px; }

.calc-tabs-embed-link {
  padding: 6px 10px;
  color: #64748b;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
}
.calc-tabs-embed-link:hover { background: #e2e8f0; color: #0f172a; }

/* ─── Quick-mode headline ───────────────────────────────────────── */
.calc-headline { margin: 8px 0 20px; }
.calc-headline h2 { font-size: 20px; margin: 0 0 6px; color: #0f172a; }
.calc-headline p  { margin: 0; color: #475569; font-size: 14px; }

/* ─── Quick result panel ────────────────────────────────────────── */
.quick-result {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  text-align: center;
}
.quick-result-label {
  font-size: 13px; color: #166534; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 600; margin-bottom: 8px;
}
.quick-result-value {
  font-size: 38px; font-weight: 700; color: #052e16;
  line-height: 1.1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.quick-result-sub { font-size: 13px; color: #475569; margin-top: 8px; }
.quick-result-vendors {
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed #d1fae5;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; text-align: left;
}
.quick-result-vendor { font-size: 13px; color: #334155; }
.quick-result-vendor .v-name { font-weight: 600; }
.quick-result-vendor .v-cost { color: #16a34a; font-family: ui-monospace, monospace; }

/* ─── Quick-mode form ───────────────────────────────────────────── */
.quick-form {
  background: white; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 20px 24px;
}
.quick-form .field-row { margin: 14px 0; }
.quick-form label {
  display: block; font-size: 13px; font-weight: 600;
  color: #334155; margin-bottom: 6px;
}
.quick-form input[type="number"],
.quick-form input[type="text"],
.quick-form select,
.quick-form textarea {
  width: 100%; max-width: 480px; padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 7px;
  font-size: 15px; font-family: inherit; background: white;
}
.quick-form input:focus, .quick-form select:focus, .quick-form textarea:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.quick-form .submit-row { margin-top: 18px; }
.quick-form button[type="submit"] {
  padding: 10px 20px; background: #2563eb; color: white;
  border: none; border-radius: 7px; font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.quick-form button[type="submit"]:hover { background: #1d4ed8; }

/* ─── Embed mode (?embed=1) — TIGHT SELECTORS ───────────────────── */
/* Only target the site's specific chrome classes. Do NOT touch generic
 * <nav>, <header>, <footer> — tool views use those for content. */
html.calc-embed-mode {
  background: transparent !important;
}
html.calc-embed-mode body {
  margin: 0; padding: 0; background: transparent;
}
html.calc-embed-mode .aicost-nav,
html.calc-embed-mode .aicost-nav-drawer,
html.calc-embed-mode .aicost-nav-backdrop,
html.calc-embed-mode .aicost-footer,
html.calc-embed-mode .calc-tabs,
html.calc-embed-mode .calc-tabs-embed-link,
html.calc-embed-mode .calc-method,
html.calc-embed-mode .calc-breadcrumbs {
  display: none !important;
}

/* Compact container in embed mode */
html.calc-embed-mode .container,
html.calc-embed-mode .page-container,
html.calc-embed-mode .calc-page {
  max-width: 100% !important;
  padding: 12px !important;
  margin: 0 !important;
  background: transparent !important;
  min-height: 0 !important;
}

/* Optional 'open full' link shown only in embed mode */
html.calc-embed-mode .embed-open-full {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #64748b;
  text-align: right;
}
html.calc-embed-mode .embed-open-full a {
  color: #2563eb;
  text-decoration: none;
}
.embed-open-full { display: none; }   /* hidden by default — embed mode reveals it */

/* ─── Mobile: stack tabs vertically below 380px ─────────────────── */
@media (max-width: 380px) {
  .calc-tabs { flex-wrap: wrap; }
  .calc-tab { flex-direction: row; gap: 8px; padding: 8px 10px; }
  .calc-tab-meta { display: none; }
}
