/* Toggle Switch Component - Legacy CSS Compatible */
.switch-wrapper {
  margin: 1em 0;
}

.toggle-switch {
  position: relative;
  display: table;
  font-family: inherit;
}

.toggle-switch input[type="checkbox"] {
  width: 0;
  height: 0;
  visibility: hidden;
  position: absolute;
}

.toggle-switch label {
  cursor: pointer;
  width: 45px;
  height: 25px;
  background: var(--lightGray, #ccc);
  background: -webkit-linear-gradient(119deg, var(--lightGray, #b6b6b6) 0%, var(--midGray, #868686) 100%);
  background: -moz-linear-gradient(119deg, var(--lightGray, #b6b6b6) 0%, var(--midGray, #868686) 100%);
  background: -o-linear-gradient(119deg, var(--lightGray, #b6b6b6) 0%, var(--midGray, #868686) 100%);
  background: linear-gradient(119deg, var(--lightGray, #b6b6b6) 0%, var(--midGray, #868686) 100%);
  display: block;
  border-radius: 5px;
  position: relative;
  margin: 0;
  float: left;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* When text is on right (default) */
.toggle-switch .label-text {
  padding-left: 10px;
}

/* When text is on left */
.toggle-switch.text-left .label-text {
  padding-left: 0;
  padding-right: 10px;
}

.toggle-switch.text-left label {
  order: 2;
}

.toggle-switch.text-left .label-text {
  order: 1;
}

.toggle-switch label:after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 19px;
  background: var(--white, white);
  border-radius: 3px;
  -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + label {
  background: var(--blue, #206c8c);
  background: -webkit-linear-gradient(119deg, var(--blue, #206c8c) 0%, var(--darkGray, #063252) 100%);
  background: -moz-linear-gradient(119deg, var(--blue, #206c8c) 0%, var(--darkGray, #063252) 100%);
  background: -o-linear-gradient(119deg, var(--blue, #206c8c) 0%, var(--darkGray, #063252) 100%);
  background: linear-gradient(119deg, var(--blue, #206c8c) 0%, var(--darkGray, #063252) 100%);
}

.toggle-switch input:checked + label:after {
  left: 22px;
}

.toggle-switch label:active:after {
  width: 22px;
}

.toggle-switch .label-text {
  font-weight: 500;
  color: var(--black, #2d2d2d);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  margin: 0;
  cursor: pointer;
  display: table-cell;
  vertical-align: middle;
}

/* Focus states for accessibility */
.toggle-switch input:focus + label {
  outline: 2px solid var(--blue, #4285f4);
}

/* Hover states */
.toggle-switch:hover label {
  -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
  -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

/* Disabled state */
.toggle-switch input:disabled + label {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--lightGray, #e6e6e6) !important;
}

.toggle-switch input:disabled + label:after {
  background: var(--lightGray, #f0f0f0);
  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:disabled ~ .label-text {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-switch:has(input:disabled):hover label {
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}

/* IE8+ support */
.toggle-switch {
  zoom: 1;
}

.toggle-switch:before,
.toggle-switch:after {
  content: "";
  display: table;
}

.toggle-switch:after {
  clear: both;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .toggle-switch {
    display: block;
    width: 100%;
  }

  .toggle-switch label {
    float: none;
    margin-bottom: 8px;
  }

  .toggle-switch .label-text {
    display: block;
    padding-left: 0;
    padding-right: 0;
    padding-top: 8px;
    text-align: left;
    font-size: 0.9rem;
  }

  .toggle-switch.text-left .label-text {
    padding-right: 0;
    padding-bottom: 8px;
    padding-top: 0;
    order: 1;
  }

  .toggle-switch.text-left label {
    order: 2;
  }
}