/*!
 * This file is part of the WPSF package.
 * This package is Open Source Software. For the full copyright and license
 * information, please view the LICENSE file which was distributed with this
 * source code.
 *
 * @package    WPSF
 * @author     Varun Sridharan <varunsridharan23@gmail.com>
 */

.wpsf-field-switcher {

  label {
    display: block;
    float: left;
    cursor: pointer;
    position: relative;
    width: 62px;
    height: 26px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 20px;

    span {
      position: absolute;
      top: 4px;
      left: 4px;
      width: 18px;
      height: 18px;
      background-color: #fff;
      border-radius: 16px;
      transition: left 0.15s ease-out;
    }

    input {
      position: absolute;
      top: 0;
      left: 0;
      opacity: 0;

      &:checked ~ em {
        background: #4fb845;
      }

      &:checked ~ em:before {
        opacity: 0;
      }

      &:checked ~ em:after {
        opacity: 1;
      }

      &:checked ~ span {
        left: 40px;
      }
    }

    em {
      position: relative;
      display: block;
      height: inherit;
      font-size: 11px;
      line-height: 26px;
      font-weight: 500;
      font-style: normal;
      text-transform: uppercase;
      color: #fff;
      background-color: #ed6f6f;
      transition: background 0.15s ease-out;
    }

    em:before,
    em:after {
      position: absolute;
      transition: opacity 0.15s ease-out;
    }

    em:before {
      content: attr(data-off);
      right: 14px;
    }

    em:after {
      content: attr(data-on);
      left: 14px;
      opacity: 0;
    }
  }

  .wpsf-text-desc {
    float: left;
    margin-left: 5px;
    margin-top: 0;
    padding-top: 4px;
  }
}