/* ============================================================
   IDEAL BODY WEIGHT CALCULATOR — ideal-weight.css
   Tailored responsive glassmorphism styles for Health & Wellness
   Toolspot by Tradesala
   ============================================================ */

.container {
  --tool-red: var(--red);
  --tool-red-soft: var(--red-soft);
}

/* Custom coloring overrides for standard components in container */
.container .value-badge {
  border-color: rgba(249, 115, 22, 0.25);
}

/* Unit & Parameter Toggles (Glassmorphic) */
.mode-toggle {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  z-index: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.mode-toggle::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 6px);
  /* Translucent frosted glass effect using the orange accent color */
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.06) 100%);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 8px;
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 0;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.mode-toggle.active-right::before {
  transform: translateX(calc(100% + 4px));
}

.mode-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  background: transparent !important;
  border: none;
  padding: 10px 16px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: none !important;
  transition: color 0.28s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.active {
  color: #ff9f43 !important;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.mode-btn:active {
  transform: scale(0.97);
}

body.light .mode-toggle {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light .mode-toggle::before {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.12) 0%, rgba(234, 88, 12, 0.04) 100%);
  border-color: rgba(234, 88, 12, 0.25);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

body.light .mode-btn {
  color: #556b82;
}

body.light .mode-btn:hover {
  color: #0f172a;
}

body.light .mode-btn.active {
  color: #ea580c !important;
  text-shadow: none;
}

/* ── Result KPI Hero ── */
.result-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

body.light .result-hero {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.01) 0%, rgba(0, 0, 0, 0.03) 100%);
  border-color: rgba(0, 0, 0, 0.06);
}

.result-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.result-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-2);
}

.result-val {
  font-family: 'Outfit', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

body.light .result-val {
  color: #0f172a;
}

/* ── Slabs Comparison ── */
.slabs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 640px) {
  .slabs-grid {
    grid-template-columns: 1fr;
  }
}

.slab-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 18px;
  transition: all 0.3s ease;
}

.slab-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

body.light .slab-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light .slab-card:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

.slab-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

body.light .slab-title-row {
  border-color: rgba(0, 0, 0, 0.06);
}

.slab-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-2);
}

.slab-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.slab-badge-sa {
  background: rgba(249, 115, 22, 0.12);
  color: var(--red2);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.slab-badge-global {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slab-stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.slab-stat-row:last-child {
  margin-bottom: 0;
}

.slab-stat-lbl {
  color: var(--text-2);
}

.slab-stat-val {
  font-weight: 700;
  color: var(--text);
}

/* ── Formula Comparison Chart ── */
.chart-container {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.chart-name {
  font-weight: 600;
  color: var(--text-2);
}

.chart-formula-lbl {
  font-size: 10px;
  color: var(--text-3);
  font-weight: normal;
  margin-left: 6px;
}

.chart-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text);
}

.chart-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light .chart-bar-bg {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.05);
}

.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.4), var(--red));
  width: 0%;
  transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.3);
}

.chart-bar-fill.highlight {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.4), #34d399);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.3);
}

.chart-bar-fill.global {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.35));
  box-shadow: none;
}

body.light .chart-bar-fill.global {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.25));
}

/* Distinct premium colors for individual medical formulas */
#bar-devine {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.45), #60a5fa);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}
body.light #bar-devine {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), #3b82f6);
  box-shadow: none;
}

#bar-robinson {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.45), #a78bfa);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}
body.light #bar-robinson {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), #8b5cf6);
  box-shadow: none;
}

#bar-miller {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.45), #f472b6);
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.3);
}
body.light #bar-miller {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.3), #ec4899);
  box-shadow: none;
}

#bar-hamwi {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.45), #2dd4bf);
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.3);
}
body.light #bar-hamwi {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.3), #14b8a6);
  box-shadow: none;
}

/* ── Frame Skeletal Info ── */
.frame-info-box {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.frame-info-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.frame-info-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

/* ── Toggle Groups & Switches ── */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  margin-bottom: 12px;
}

body.light .toggle-group {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.05);
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.toggle-sub {
  font-size: 11px;
  color: var(--text-3);
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider.round {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.light .slider.round {
  background-color: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

.slider.round::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-2);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.light .slider.round::before {
  background-color: #64748b;
}

.switch input:checked + .slider {
  background-color: var(--tool-red);
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 0 10px var(--red-glow);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* ── Risk Subcards WHtR & Goals ── */
.risk-subcard {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: fadeIn 0.4s ease forwards;
}

.badge-active {
  background: var(--tool-red-soft);
  color: var(--red2);
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.risk-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-underweight {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.risk-normal {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.risk-overweight {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.risk-obese {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

body.light .risk-underweight { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
body.light .risk-normal { background: rgba(16, 185, 129, 0.1); color: #059669; }
body.light .risk-overweight { background: rgba(249, 115, 22, 0.1); color: #d97706; }
body.light .risk-obese { background: rgba(220, 38, 38, 0.1); color: #dc2626; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Dynamic Weight Progress Visualizer ── */
.weight-viz-wrap {
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

body.light .weight-viz-wrap {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.05);
}

.weight-viz-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  margin-top: 12px;
  margin-bottom: 12px;
}

body.light .weight-viz-bar {
  background: rgba(0, 0, 0, 0.08);
}

.weight-viz-target-zone {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(52, 211, 153, 0.25);
  border-radius: 3px;
  border-left: 1px solid rgba(52, 211, 153, 0.5);
  border-right: 1px solid rgba(52, 211, 153, 0.5);
}

body.light .weight-viz-target-zone {
  background: rgba(16, 185, 129, 0.35);
  border-left: 1.5px solid #059669;
  border-right: 1.5px solid #059669;
}

.weight-viz-pointer {
  position: absolute;
  top: -6px;
  width: 18px;
  height: 18px;
  background: var(--red);
  border: 3px solid var(--bg);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 10px var(--red-glow);
}

body.light .weight-viz-pointer {
  background: #ea580c;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

.weight-viz-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-3);
  font-weight: 700;
}

.target-zone-lbl {
  color: #34d399;
}

body.light .target-zone-lbl {
  color: #059669;
}

/* ── Imperial Height Layout Fixes ── */
#height-imperial-group .value-badge {
  font-size: 12px;
  padding: 4px 10px;
  min-width: 48px;
}

/* ── Slab Classification Table Styles ── */
.slab-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.1);
  margin-top: 8px;
}

body.light .slab-table-wrap {
  border-color: rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.02);
}

.slab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.slab-table th,
.slab-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-2);
}

body.light .slab-table th,
body.light .slab-table td {
  border-bottom-color: rgba(0, 0, 0, 0.03);
}

.slab-table th {
  font-weight: 700;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.02);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

body.light .slab-table th {
  background: rgba(0, 0, 0, 0.02);
}

.slab-table tr:last-child td {
  border-bottom: none;
}

.slab-table td {
  font-weight: 600;
}

.slab-table td:last-child {
  color: var(--text);
  font-weight: 700;
}

/* ── Custom Risk Badge Adjustments ── */
.risk-badge.risk-underweight {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
body.light .risk-badge.risk-underweight {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb !important;
  border-color: rgba(59, 130, 246, 0.2);
}

.risk-badge.risk-normal {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
body.light .risk-badge.risk-normal {
  background: rgba(16, 185, 129, 0.1);
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.2);
}

.risk-badge.risk-overweight {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c !important;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
body.light .risk-badge.risk-overweight {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c !important;
  border-color: rgba(249, 115, 22, 0.2);
}

.risk-badge.risk-obese {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e !important;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
body.light .risk-badge.risk-obese {
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48 !important;
  border-color: rgba(244, 63, 94, 0.2);
}

#metabolic-risk-card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
