/* ===========================================================
   style.css — BMI Calculator (pixel-polished, Fuel-style)
   Scope: #bmi-tool
   Completed with SEO section styling
   =========================================================== */

/* -------------------------
   Theme variables
   ------------------------- */
:root{
  --card: #ffffff;
  --bg: #f6fafc;
  --accent: #0f62fe;
  --accent-strong: #0b53d6;
  --muted: #6b7886;
  --muted-2: #94a3b8;
  --heading: #0b1620;
  --border: #e6eefc;
  --soft-border: rgba(11,20,40,0.04);
  --radius: 12px;
  --card-radius: 14px;
  --shadow-1: 0 6px 18px rgba(12,30,80,0.06);
  --shadow-2: 0 10px 36px rgba(12,30,80,0.08);
  --input-bg: #fff;
  --input-border: #dfeafc;
  --table-highlight: #e6f4ff;
  --maxw: 980px;

  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
}

/* Strict scoping */
#bmi-tool, #bmi-tool * { box-sizing: inherit; }

/* -------------------------
   Main wrapper / card
   ------------------------- */
#bmi-tool.tool-card {
  max-width: var(--maxw);
  /* Allow card to grow with content (no artificial clipping) */
  margin: 28px auto;
  background: var(--card);
  border-radius: var(--card-radius);
  padding: 22px;
  border: 1px solid var(--soft-border);
  box-shadow: var(--shadow-2);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow: visible; /* ensure seo/footer outside the card are visible */
}

/* Container */
#bmi-tool .container {
  width: 100%;
}

/* Grid layout */
#bmi-tool .grid-two-col {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr 420px;
  align-items: stretch; /* equal height by default - JS may equalize */
}
@media (max-width: 1000px) {
  #bmi-tool .grid-two-col { grid-template-columns: 1fr; }
}

/* -------------------------
   Panel base styles
   ------------------------- */
#bmi-tool .panel {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--soft-border);
  box-shadow: var(--shadow-1);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0; /* allow flex children to size */
}

/* internal inner wrapper (for precise spacing) */
#bmi-tool .panel-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* -------------------------
   Heading & tabs
   ------------------------- */
#bmi-tool .tool-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--heading);
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
}

/* Tabs */
#bmi-tool .tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 6px;
}
#bmi-tool .tab {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(11,99,255,0.06);
  background: #f7fbff;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
#bmi-tool .tab.active {
  background: #fff;
  color: var(--heading);
  box-shadow: 0 6px 14px rgba(12,30,80,0.04);
}

/* -------------------------
   Form rows & inputs
   ------------------------- */
#bmi-tool .form {
  display: block;
}

/* spacing rhythm inside left panel */
#bmi-tool .form-row {
  margin-bottom: 12px;
}

#bmi-tool label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

/* input + unit wrapper */
#bmi-tool .input-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* number inputs */
#bmi-tool input[type="number"], 
#bmi-tool input[type="text"], 
#bmi-tool select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  font-size: 15px;
  color: #0f1724;
  transition: box-shadow .15s ease, border-color .12s ease;
  height: 42px;
  line-height: 1;
}
#bmi-tool input::placeholder { color: #c8d7ee; }

/* focus */
#bmi-tool input:focus, #bmi-tool select:focus {
  outline: none;
  border-color: rgba(15,98,254,0.22);
  box-shadow: 0 10px 20px rgba(15,98,254,0.06);
}

/* small unit text */
#bmi-tool .unit-text {
  color: var(--muted-2);
  font-size: 13px;
  white-space: nowrap;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
}

/* -------------------------
   Buttons
   ------------------------- */
#bmi-tool .form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 40px;
}

#bmi-tool .btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  padding: 10px 18px;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15,98,254,0.14);
  transition: transform .12s ease, box-shadow .12s ease;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#bmi-tool .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15,98,254,0.16); }

#bmi-tool .btn-outline {
  background: #f4f8ff;
  color: var(--accent);
  border: 1px solid rgba(11,99,255,0.08);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------
   Result header
   ------------------------- */
#bmi-tool .result-header {
  text-align: center;
  padding-bottom: 8px;
}
#bmi-tool .result-title-top {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  font-weight: 800;
  margin-bottom: 6px;
}
#bmi-tool .result-value {
  font-size: 36px;
  font-weight: 900;
  color: var(--heading);
  line-height: 1;
}

/* -------------------------
   Result table & meta
   ------------------------- */
#bmi-tool .result-table-wrap {
  margin-top: 6px;
}

/* table */
#bmi-tool .result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  box-shadow: none;
  background: transparent;
}
#bmi-tool .result-table thead th {
  text-align: left;
  padding: 12px 12px;
  background: #f6fbff;
  color: var(--muted-2);
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}
#bmi-tool .result-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
#bmi-tool .bmi-row.highlight {
  background: var(--table-highlight);
  font-weight: 800;
  color: var(--heading);
}

/* result meta */
#bmi-tool .result-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

/* result links */
#bmi-tool .result-links {
  margin-top: 12px;
}
#bmi-tool .result-links a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
#bmi-tool .result-links a:hover { text-decoration: underline; }

/* -------------------------
   Panel foot / small note
   ------------------------- */
#bmi-tool .panel-foot.small-note {
  margin-top: 15px;
  color: var(--muted-2);
  font-size: 12px;
}

/* -------------------------
   Accessibility & focus
   ------------------------- */
#bmi-tool button:focus-visible, #bmi-tool input:focus-visible, #bmi-tool select:focus-visible {
  outline: 3px solid rgba(15,98,254,0.12);
  outline-offset: 2px;
}

/* -------------------------
   Responsive tweaks
   ------------------------- */
@media (max-width: 680px) {
  #bmi-tool.tool-card { padding: 16px; }
  #bmi-tool .grid-two-col { grid-template-columns: 1fr; gap: 16px; }
  #bmi-tool .panel { padding: 14px; }
  #bmi-tool .result-value { font-size: 30px; }
  #bmi-tool input[type="number"] { height: 40px; }
}

/* -------------------------
   Optional debug helper (comment out if not needed)
   ------------------------- */
/* #bmi-tool.debug-on .panel { outline: 1px dashed rgba(0,0,0,0.06); } */


/* ================================
   CSS-only equal-height panels
   Removes need for equalize-panels.js
   ================================ */

/* 1) Ensure the grid will stretch children to equal height */
#bmi-tool .grid-two-col {
  align-items: stretch !important; /* panels will be same height */
}

/* 2) Make each panel a column-flex container so inner items can be distributed */
#bmi-tool .panel {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start;
  min-height: 0 !important; /* important for flexboxes inside grids */
}

/* 3) Ensure the main inner wrapper (.panel-inner) and .content behave predictably */
#bmi-tool .panel-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto; /* allow inner wrapper to grow/shrink inside panel */
  min-height: 0;
}

/* 4) Make form/content area collapse naturally and not stretch to full height */
#bmi-tool .panel-left .content,
#bmi-tool .panel-right .content {
  flex: 0 0 auto;
  min-height: 0;
}

/* 5) Push the small result-meta block to the bottom of the right panel
      so table area grows and both panels visually align */
#bmi-tool .panel-right .result-meta {
  margin-top: auto; /* pushes it to the bottom of the right panel */
  padding-top: 8px;
}

/* 6) Keep left form top-aligned and compact: ensure the form does not expand */
#bmi-tool .panel-left form {
  margin-bottom: 0;
  flex: 0 0 auto;
}

/* 7) If there are any explicit spacer/empty elements, keep them collapsed (safety) */
#bmi-tool .spacer,
#bmi-tool .empty,
#bmi-tool .panel-left .spacer,
#bmi-tool .panel-right .spacer {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
}

/* 8) Prevent global min-height from theme to interfere (specific overrides) */
#bmi-tool .panel,
#bmi-tool .panel-left,
#bmi-tool .panel-right,
#bmi-tool .panel-inner,
#bmi-tool .content {
  min-height: 0 !important;
}

/* 9) Subtle visual tweak: reduce bottom padding on panels so card bottoms line up cleanly */
#bmi-tool .panel-left,
#bmi-tool .panel-right {
  padding-bottom: 16px !important;
}

/* 10) Responsiveness: on small screens revert to natural flow (no equal height) */
@media (max-width: 1000px) {
  #bmi-tool .grid-two-col { align-items: start !important; }
  #bmi-tool .panel-right .result-meta { margin-top: 12px; }
  #bmi-tool .panel-left form { margin-bottom: 12px; }
}

/* End of CSS-only equal-height solution */
/* Make BMI inputs identical width */
#bmi-tool .input-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

#bmi-tool .input-inline input[type="number"],
#bmi-tool .input-inline input[type="text"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

#bmi-tool .unit-text {
  flex-shrink: 0; /* prevent unit text from shrinking the input */
}

.tool-card:hover,.tool-card:focus{transform:translateY(0) !important}

/* ===========================================================
   SEO SECTION STYLES (global .seo-section)
   Moved outside of #bmi-tool so it can sit under the card
   =========================================================== */
.seo-section {
  margin: 22px auto 36px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(246,250,252,0.6), rgba(255,255,255,0.6));
  border: 1px solid rgba(14,30,60,0.03);
  padding: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: var(--maxw);
  width: calc(100% - 40px);
  box-sizing: border-box;
}

/* inner wrapper aligns with card container but allows readable measure */
.seo-section .seo-inner {
  max-width: calc(var(--maxw) - 24px);
  margin: 0 auto;
  padding: 6px 4px;
}

/* title */
.seo-section .seo-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--heading);
  margin: 6px 0 10px;
  letter-spacing: -0.01em;
}

/* subheadings inside SEO copy */
.seo-section h3 {
  font-size: 15px;
  color: var(--heading);
  margin: 12px 0 6px;
  font-weight: 800;
}

/* paragraphs and lists */
.seo-section p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.seo-section ul {
  margin: 8px 0 12px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* emphasize important inline text */
.seo-section strong {
  color: var(--heading);
  font-weight: 800;
}

/* small disclaimer style */
.seo-section p:last-of-type {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted-2);
}

/* SEO section visual divider for large screens */
@media (min-width: 1001px) {
  .seo-section {
    margin-left: auto;
    margin-right: auto;
  }
}

/* On smaller screens make seo section more compact */
@media (max-width: 680px) {
  .seo-section {
    padding: 12px;
    width: calc(100% - 24px);
  }
  .seo-section .seo-title {
    font-size: 16px;
  }
  .seo-section h3 { font-size: 14px; }
  .seo-section p, .seo-section ul { font-size: 13px; }
}

/* Ensure SEO section does not exceed card's visual rhythm */
.seo-section,
.seo-section .seo-inner {
  box-shadow: none;
  background-clip: padding-box;
}

/* Accessibility: links inside SEO section */
.seo-section a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.seo-section a:hover, .seo-section a:focus {
  text-decoration: underline;
  outline: none;
}

/* Utility: keep SEO content readable when printing (lightweight) */
@media print {
  .seo-section { background: #fff; border: 1px solid #eee; box-shadow: none; color: #111; }
}

/* Footer banner slot styling — visually separate from the card */
.slot-footer {
  max-width: var(--maxw);
  margin: 18px auto;
  width: calc(100% - 40px);
  border-radius: 10px;
  padding: 18px;
  border: 1px dashed rgba(11,20,40,0.06);
  background: #fafcff;
  color: var(--muted-2);
  text-align: center;
  box-sizing: border-box;
}

/* Small tweak: if a theme injects fixed footer that overlaps content, give a bottom buffer */
body { --site-bottom-buffer: 0px; }
@media (max-width: 900px) {
  /* on small screens reduce spacing slightly */
  .slot-footer { margin: 12px auto; padding: 14px; }
}

/* End of completed CSS */
