/* ==========================================================================
   Shared Ensemble Toggle Styles
   Two-state toggle: Standalone (OFF) / Show 4DWX Ensemble Blend (ON)
   ========================================================================== */

.ensemble-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

/* Hidden native checkbox */
.ensemble-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Track */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: #b0b8c4;
  border-radius: 10px;
  transition: background 200ms ease;
  flex-shrink: 0;
}

/* Thumb */
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Checked state */
.ensemble-toggle input:checked + .toggle-switch {
  background: var(--ncar-blue, #0057C2);
}

.ensemble-toggle input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

/* Focus ring for accessibility */
.ensemble-toggle input:focus-visible + .toggle-switch {
  box-shadow: 0 0 0 3px rgba(0, 87, 194, 0.3);
}

/* Label text */
.toggle-label {
  font-family: var(--font-family, 'Poppins', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark-blue, #00357A);
  line-height: 1.4;
}

/* ==========================================================================
   Ensemble Control Group — toggle + family picker wrapper
   ========================================================================== */
.ensemble-control-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Family Picker — hidden when toggle OFF, slides in when ON */
.family-picker {
  display: none;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.ensemble-control-group.active .family-picker {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

/* Family pill buttons */
.family-btn {
  padding: 4px 12px;
  border-radius: 12px;
  border: 2px solid var(--family-color);
  background: transparent;
  color: var(--family-color);
  font-family: var(--font-family, 'Poppins', sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.family-btn.selected {
  background: var(--family-color);
  color: #fff;
}

.family-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}
