/* =============================================
   BMI Calculator Plugin — bmi-calculator.css
   ============================================= */

.bmi-wrapper {
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
  color: #1a2e3b;
}

.bmi-wrapper *,
.bmi-wrapper *::before,
.bmi-wrapper *::after {
  box-sizing: border-box;
}

/* Header */
.bmi-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.bmi-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #1a2e3b;
  margin: 0 0 0.5rem 0;
  padding: 0;
  letter-spacing: -0.5px;
  border: none;
  background: none;
}

.bmi-header p {
  color: #6b7f8a;
  font-size: 1rem;
  font-weight: 300;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Layout */
.bmi-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Left Panel */
.bmi-form-panel {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 30px rgba(26,46,59,0.08);
}

/* Unit Toggle */
.bmi-unit-toggle {
  display: flex;
  background: #f9f7f4;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.8rem;
  border: 1px solid #ddd8d0;
}

.bmi-unit-btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7f8a;
  cursor: pointer;
  transition: all 0.25s ease;
}

.bmi-unit-btn.active {
  background: #1a2e3b;
  color: white;
  box-shadow: 0 2px 8px rgba(26,46,59,0.25);
}

/* Field Label */
.bmi-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7f8a;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}

/* Input Row */
.bmi-input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.bmi-input-group {
  flex: 1;
  position: relative;
}

.bmi-input-group input {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 1rem;
  border: 1.5px solid #ddd8d0;
  border-radius: 12px;
  background: #f9f7f4;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #1a2e3b;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -moz-appearance: textfield;
}

.bmi-input-group input::-webkit-inner-spin-button,
.bmi-input-group input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.bmi-input-group input:focus {
  border-color: #c9a97a;
  box-shadow: 0 0 0 3px rgba(201,169,122,0.15);
  background: #fff;
}

.bmi-input-unit {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7f8a;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* Calculate Button */
.bmi-calc-btn {
  width: 100%;
  padding: 1rem;
  background: #c9a97a;
  border: none;
  border-radius: 14px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  letter-spacing: 0.3px;
  margin-top: 0.5rem;
}

.bmi-calc-btn:hover {
  background: #b8936a;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,169,122,0.4);
}

.bmi-calc-btn:active {
  transform: translateY(0);
}

/* Right Panel */
.bmi-result-panel {
  background: #dde4e0;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 30px rgba(26,46,59,0.08);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Gauge */
.bmi-gauge-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bmi-gauge-svg {
  width: 100%;
  max-width: 320px;
  height: 190px;
}

.bmi-gauge-value-box {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}

.bmi-gauge-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #6b7f8a;
  letter-spacing: 0.5px;
}

.bmi-gauge-number {
  font-family: 'DM Serif Display', serif;
  font-size: 3.2rem;
  color: #1a2e3b;
  line-height: 1;
  margin-top: 2px;
  transition: all 0.4s ease;
}

/* Category Table */
.bmi-category-table {
  background: rgba(255,255,255,0.5);
  border-radius: 14px;
  overflow: hidden;
}

.bmi-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.1rem;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255,255,255,0.6);
}

.bmi-cat-row:last-child {
  border-bottom: none;
}

.bmi-cat-row.active {
  background: #1a2e3b;
}

.bmi-cat-row.active .bmi-cat-name,
.bmi-cat-row.active .bmi-cat-range {
  color: white;
  font-weight: 600;
}

.bmi-cat-name {
  font-size: 0.9rem;
  color: #1a2e3b;
  font-weight: 400;
}

.bmi-cat-range {
  font-size: 0.85rem;
  color: #6b7f8a;
  font-weight: 500;
}

/* Advice Box */
.bmi-advice-box {
  background: rgba(255,255,255,0.65);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  font-size: 0.875rem;
  color: #1a2e3b;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.4s ease;
  min-height: 3.5rem;
}

.bmi-advice-box.visible {
  opacity: 1;
}

/* Responsive */
@media (max-width: 680px) {
  .bmi-container {
    grid-template-columns: 1fr;
  }
  .bmi-result-panel {
    min-height: auto;
  }
}
