/* Toggle switch styling with insnare's colour palette */
.toggle-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  --knob-size: 24px;
  --knob-gap: 2px;
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-switch .slider {
  min-width: 90px;
  width: fit-content;
  height: 29px;
  background: #abb2bf; /* light grey for "without" */
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  box-shadow: 0 2px 8px 0 rgba(55, 48, 163, 0.08);
  font-size: 0.95rem;
  font-weight: 500;
  overflow: hidden;
}

.toggle-switch .slider::before {
  content: "";
  position: absolute;
  left: var(--knob-gap);
  top: var(--knob-gap);
  width: var(--knob-size);
  height: var(--knob-size);
  background: #fff;
  border-radius: 50%;
  transition:
    transform 0.2s,
    background 0.2s;
  box-shadow: 0 1px 4px 0 rgba(55, 48, 163, 0.1);
  z-index: 2;
}

.toggle-switch .slider::after {
  content: "without";
  position: absolute;
  left: calc(var(--knob-size) + 2 * var(--knob-gap));
  right: var(--label-padding, 12px);
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  transition:
    color 0.2s,
    left 0.2s,
    right 0.2s;
  z-index: 1;
  pointer-events: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: visible;
  text-align: right;
}

.toggle-switch input[type="checkbox"]:checked + .slider::before {
  left: calc(100% - var(--knob-size) - var(--knob-gap));
  background: #0078b6;
}

.toggle-switch input[type="checkbox"]:checked + .slider {
  background: #ddf0ff; /* blue background for "with" */
}

.toggle-switch input[type="checkbox"]:checked + .slider::after {
  content: "with";
  left: var(--label-padding, 12px);
  right: calc(var(--knob-gap) + var(--knob-size) + var(--knob-gap));
  color: #0078b6; /* blue knob for "with" */
  text-align: left;
}

.toggle-switch .toggle-label {
  font-size: 1rem;
  font-weight: 500;
  color: #000;
  min-width: 60px;
  text-align: center;
  transition: color 0.2s;
}

/* iceberg animation */
.svg-overlay-image-wrapper {
  /* To position SVG overlay relative to it */
  position: relative;
  display: inline-block;
  /* Constrains container to the image's rendered size */
  width: fit-content;
  height: fit-content;
}

.iceberg-image {
  display: block;
  max-width: 100%;
  height: auto;
}

#iceberg-svg-overlay {
  border-radius: 10px;
}
