/* Calculator-specific styles */

.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 1.5rem 0 3rem;
  align-items: start;
}

.breadcrumb {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  font-size: .85rem; color: var(--text-muted); margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary); }

.calc-hero { margin-bottom: 1.5rem; }
.calc-hero__intro { font-size: 1.05rem; max-width: 60ch; }

.calc-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.calc-form-actions {
  display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem;
}

.calc-results {
  display: none;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  animation: resultIn .4s ease both;
}
.calc-results.is-visible { display: block; }
@keyframes resultIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.calc-results__header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.calc-results__header h2 { margin: 0; font-size: 1.15rem; }

.result-value {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; color: var(--text); line-height: 1.1;
}
.result-label { font-size: .9rem; color: var(--text-muted); margin-top: .25rem; }

.result-badge {
  display: inline-flex; align-items: center; padding: .35rem .75rem;
  border-radius: 999px; font-weight: 600; font-size: .85rem; margin-top: .75rem;
}
.result-badge--underweight { background: #DBEAFE; color: #1E40AF; }
.result-badge--normal { background: var(--color-accent-soft); color: #065F46; }
.result-badge--overweight { background: var(--color-warning-soft); color: #92400E; }
.result-badge--obese { background: var(--color-danger-soft); color: #991B1B; }
[data-theme="dark"] .result-badge--underweight { color: #93C5FD; }
[data-theme="dark"] .result-badge--normal { color: #6EE7B7; }
[data-theme="dark"] .result-badge--overweight { color: #FCD34D; }
[data-theme="dark"] .result-badge--obese { color: #FCA5A5; }

.result-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .85rem; margin-top: 1rem;
}
.result-stat {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem;
}
.result-stat strong {
  display: block; font-size: 1.25rem; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.result-stat span { font-size: .8rem; color: var(--text-muted); }

/* BMI gauge */
.bmi-gauge {
  margin-top: 1.25rem; position: relative; height: 16px;
  border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg,
    #3B82F6 0%, #3B82F6 18.5%,
    #10B981 18.5%, #10B981 37%,
    #F59E0B 37%, #F59E0B 48%,
    #EF4444 48%, #EF4444 100%);
}
.bmi-gauge__marker {
  position: absolute; top: -4px; width: 4px; height: 24px;
  background: var(--text); border-radius: 2px;
  transform: translateX(-50%);
  transition: left .4s ease;
  box-shadow: 0 0 0 2px var(--bg);
}
.bmi-gauge__labels {
  display: flex; justify-content: space-between;
  font-size: .7rem; color: var(--text-muted); margin-top: .4rem;
}

/* Comparison cards */
.compare-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center;
  margin-top: 1rem;
}
.compare-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; text-align: center;
}
.compare-card--highlight {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.compare-arrow {
  font-size: 1.5rem; color: var(--color-primary); font-weight: 700;
}

/* Tables */
.amort-table-wrap { overflow-x: auto; margin-top: 1rem; }
.amort-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.amort-table th, .amort-table td {
  padding: .55rem .65rem; text-align: right; border-bottom: 1px solid var(--border);
}
.amort-table th:first-child, .amort-table td:first-child { text-align: left; }
.amort-table th {
  background: var(--bg); font-weight: 600; color: var(--text-muted);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .03em;
}

.chart-wrap {
  position: relative; height: 260px; margin-top: 1.25rem;
}

.share-bar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.share-bar .btn { font-size: .8rem; }

.content-section {
  margin: 2rem 0;
}
.content-section h2 { margin-bottom: .75rem; }
.how-to-list { padding-left: 1.25rem; color: var(--text-muted); }
.how-to-list li { margin-bottom: .5rem; }

.faq-list { display: grid; gap: .65rem; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elevated); padding: 0;
}
.faq-item summary {
  cursor: pointer; padding: .9rem 1rem; font-weight: 600; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--text-muted); font-size: 1.2rem; }
.faq-item[open] summary::after { content: "−"; }
.faq-item__answer {
  padding: 0 1rem 1rem; color: var(--text-muted); font-size: .95rem;
}

.sidebar-box {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem;
}
.sidebar-box h3 { font-size: .95rem; margin-bottom: .75rem; }
.sidebar-links { list-style: none; padding: 0; margin: 0; }
.sidebar-links li { margin-bottom: .45rem; }
.sidebar-links a { color: var(--text); text-decoration: none; font-size: .92rem; }
.sidebar-links a:hover { color: var(--color-primary); }

.water-glasses {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem;
}
.water-glass {
  width: 28px; height: 36px; border: 2px solid #3B82F6;
  border-radius: 4px 4px 6px 6px; position: relative; overflow: hidden;
}
.water-glass::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0;
  height: 70%; background: #60A5FA; opacity: .7;
}

.strength-meter {
  height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: .5rem;
}
.strength-meter__bar {
  height: 100%; width: 0; border-radius: inherit; transition: width .3s ease, background .3s ease;
}
.embed-box {
  margin-top: 1rem; padding: 1rem; background: var(--bg); border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.embed-box textarea {
  font-family: var(--font-mono); font-size: .8rem; min-height: 80px;
}

.variation-pills {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem;
}
.variation-pills a {
  padding: .35rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-muted); text-decoration: none;
}
.variation-pills a:hover, .variation-pills a.is-active {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}

.input-with-prefix {
  display: flex; align-items: stretch;
}
.input-with-prefix .prefix {
  display: grid; place-items: center; padding: 0 .85rem;
  background: var(--bg-alt); border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--text-muted); font-weight: 600;
}
.input-with-prefix input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
