/* life-expectancy-calculator — custom styles */

/* ===== Pill-group selectors (single-select pill rows without slider) ===== */
.evvy-le-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.evvy-le-pills .evvy-pill {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

/* ===== Checkbox grid for family history / chronic conditions ===== */
.evvy-le-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}
.evvy-le-check-grid label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--evvy-text-primary, #333);
  cursor: pointer;
  user-select: none;
}
.evvy-le-check-grid input[type="checkbox"] {
  accent-color: var(--cluster-dark);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== Country dropdown ===== */
.evvy-le-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: var(--evvy-radius-md, 8px);
  background: var(--bs-body-bg, #fff);
  color: var(--evvy-text-primary, #333);
  font-size: 0.875rem;
  font-family: inherit;
  appearance: auto;
}
.evvy-le-select:focus {
  border-color: var(--cluster-dark);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cluster-dark) 15%, transparent);
}

/* ===== Factor impact list ===== */
.evvy-le-factor-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.evvy-le-factor-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
}
.evvy-le-factor-label {
  font-weight: 600;
  color: var(--evvy-text-primary, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evvy-le-factor-bar-wrap {
  height: 14px;
  background: var(--evvy-border-color, #DEE2E6);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}
.evvy-le-factor-bar {
  height: 100%;
  border-radius: 7px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}
.evvy-le-factor-bar.positive { background: #22c55e; }
.evvy-le-factor-bar.negative { background: #ef4444; }
.evvy-le-factor-bar.neutral  { background: #94a3b8; }
.evvy-le-factor-value {
  text-align: right;
  font-weight: 700;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.evvy-le-factor-value.positive { color: #16a34a; }
.evvy-le-factor-value.negative { color: #dc2626; }
.evvy-le-factor-value.neutral  { color: var(--evvy-text-secondary, #666); }

/* ===== Bio age gauge ===== */
.evvy-le-bio-gauge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: var(--evvy-radius-lg, 12px);
}
.evvy-le-bio-gauge-bar {
  flex: 1;
  height: 20px;
  background: linear-gradient(to right, #22c55e, #eab308, #ef4444);
  border-radius: 10px;
  position: relative;
}
.evvy-le-bio-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 32px;
  background: var(--evvy-text-primary, #333);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.evvy-le-bio-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.evvy-le-bio-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--evvy-text-primary, #333);
}
.evvy-le-bio-label {
  font-size: 0.6875rem;
  color: var(--evvy-text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ===== What-if toggle buttons ===== */
.evvy-le-whatif-btn {
  font-size: 0.6875rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--bs-border-radius-pill, 50rem);
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  background: transparent;
  color: var(--cluster-dark);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.evvy-le-whatif-btn:hover,
.evvy-le-whatif-btn.active {
  background: var(--cluster-dark);
  color: var(--cluster-text, #fff);
}
.evvy-le-whatif-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #16a34a;
  margin-left: 0.35rem;
}

/* ===== Range row (optimistic/avg/pessimistic) ===== */
.evvy-le-range-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.evvy-le-range-card {
  text-align: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: var(--evvy-radius-md, 8px);
  background: var(--bs-body-bg, #fff);
}
.evvy-le-range-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--evvy-text-secondary, #666);
  margin-bottom: 0.25rem;
}
.evvy-le-range-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--evvy-text-primary, #333);
}

/* ===== Premium: Life calendar grid ===== */
.evvy-le-life-calendar {
  display: grid;
  grid-template-columns: repeat(52, 1fr);
  gap: 1px;
  margin-top: 0.75rem;
}
.evvy-le-week {
  aspect-ratio: 1;
  border-radius: 1px;
  min-width: 0;
}
.evvy-le-week.lived   { background: var(--cluster-dark); opacity: 0.7; }
.evvy-le-week.current  { background: #f59e0b; }
.evvy-le-week.remaining { background: var(--evvy-border-color, #DEE2E6); }
.evvy-le-life-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: var(--evvy-text-secondary, #666);
}
.evvy-le-life-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: middle;
}

/* ===== Premium: Sensitivity table ===== */
.evvy-le-sensitivity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 0.75rem;
}
.evvy-le-sensitivity-table th,
.evvy-le-sensitivity-table td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--evvy-border-color, #DEE2E6);
  text-align: left;
}
.evvy-le-sensitivity-table th {
  font-weight: 700;
  color: var(--evvy-text-primary, #333);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--cluster-dark) 5%, transparent);
}
.evvy-le-sensitivity-table tr:last-child td {
  border-bottom: none;
}

/* ===== Premium: Comparison columns ===== */
.evvy-le-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}
.evvy-le-compare-col {
  padding: 1rem;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: var(--evvy-radius-lg, 12px);
  background: var(--bs-body-bg, #fff);
}
.evvy-le-compare-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cluster-dark);
  margin-bottom: 0.75rem;
}

/* ===== Premium: Decade table ===== */
.evvy-le-decade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 0.75rem;
  overflow-x: auto;
}
.evvy-le-decade-table th,
.evvy-le-decade-table td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--evvy-border-color, #DEE2E6);
  text-align: center;
}
.evvy-le-decade-table th {
  font-weight: 700;
  color: var(--evvy-text-primary, #333);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--cluster-dark) 5%, transparent);
}

/* ===== Callout ===== */
.evvy-le-callout {
  background: color-mix(in srgb, var(--cluster-dark) 6%, transparent);
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: var(--evvy-radius-lg, 12px);
  padding: 0.875rem 1rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--evvy-text-secondary, #666);
  line-height: 1.55;
}
.evvy-le-callout strong {
  color: var(--evvy-text-primary, #333);
}

/* ===== Dark mode overrides ===== */
[data-bs-theme="dark"] .evvy-le-select {
  background: var(--evvy-gray-100, #1E1E1E);
  color: var(--evvy-text-primary, #e0e0e0);
  border-color: var(--evvy-border-color, #444);
}
[data-bs-theme="dark"] .evvy-le-bio-gauge {
  background: var(--evvy-gray-100, #1E1E1E);
}
[data-bs-theme="dark"] .evvy-le-range-card {
  background: var(--evvy-gray-100, #1E1E1E);
}
[data-bs-theme="dark"] .evvy-le-compare-col {
  background: var(--evvy-gray-100, #1E1E1E);
}
[data-bs-theme="dark"] .evvy-le-callout {
  background: color-mix(in srgb, var(--cluster-dark) 12%, transparent);
}
[data-bs-theme="dark"] .evvy-le-sensitivity-table th,
[data-bs-theme="dark"] .evvy-le-decade-table th {
  background: color-mix(in srgb, var(--cluster-dark) 10%, transparent);
}
[data-bs-theme="dark"] .evvy-le-factor-bar-wrap {
  background: var(--evvy-border-color, #444);
}
[data-bs-theme="dark"] .evvy-le-bio-marker {
  background: #e0e0e0;
}

/* ===== Mobile breakpoints ===== */
@media (max-width: 575.98px) {
  .evvy-le-pills .evvy-pill {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
  .evvy-le-check-grid {
    grid-template-columns: 1fr;
  }
  .evvy-le-factor-row {
    grid-template-columns: 100px 1fr 50px;
    gap: 0.5rem;
  }
  .evvy-le-range-row {
    grid-template-columns: 1fr;
  }
  .evvy-le-compare-grid {
    grid-template-columns: 1fr;
  }
  .evvy-le-bio-gauge {
    flex-direction: column;
  }
  .evvy-le-life-calendar {
    gap: 0;
  }
}
