$bswp-color-white: #fff;
$bswp-color-addon-bottom: #fafafa;
$bswp-color-border: #ddd;
$bswp-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
$bswp-border-radius: 6px;
$bswp-settings-max-width: 50rem;
$bswp-status-indicator-bg: rgb(153, 153, 153);
$bswp-status-indicator-disabled: $bswp-color-white;
$bswp-status-indicator-enabled: #5ab750;
$bswp-status-enabled-shadow: inset 0 0px 0px 2px $bswp-status-indicator-enabled;
$bswp-status-indicator-size: 1.5rem;
$bswp-addon-padding: 1.2rem;

.bswp {
  * {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }

  &__container {
    @media (min-width: 600px) {
      padding-right: 1rem;
    }
  }

  &__title {
    margin-bottom: 2rem;
  }

  &__settings {
    max-width: $bswp-settings-max-width;
  }

  &__form-group {
    margin-bottom: 1rem;

    @media (min-width: 600px) {
      display: flex;
      align-items: center;
    }

    &__label {
      width: 8rem;
      flex: 0 1 8rem;
      margin-bottom: 0.5rem;
      display: block;

      @media (min-width: 600px) {
        margin-bottom: 0;
      }
    }

    input[type="text"] {
      margin-bottom: 0.5rem;
      width: 100%;

      @media (min-width: 600px) {
        flex: 1 1 auto;
        width: auto;
        margin-bottom: 0;
        margin-right: 0.5rem;
      }
    }

    .button {
      margin-bottom: 0;
    }
  }

  &__input-group {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;

    @media (min-width: 600px) {
      flex-direction: row;
      align-items: center;
      margin-left: 1rem;
    }
  }

  &__copy-input {
    position: relative;
    flex: 1;

    & > a {
      position: absolute;
      padding: 0 0.5rem;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      right: 0;
      top: 0;
      text-decoration: none;
    }

    & > input[type="text"] {
      width: 100%;
      margin: 0;
      padding-right: 4.5rem;
    }
  }

  &__spacer {
    margin: 1rem 0;
  }

  &__addons {
    position: relative;

    @media (min-width: 600px) {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      margin: 0 -0.5rem;
    }
  }

  &__addon {
    min-width: 21rem;
    padding: $bswp-addon-padding;
    padding-bottom: 45px;
    position: relative;
    margin-bottom: 1rem;

    @media (min-width: 600px) {
      flex: 0 1 calc(20% - 2rem);
      margin-left: .5rem;
      margin-right: .5rem;
    }

    &__header {
      text-align: center;
      margin-bottom: 1rem;
    }

    &__title {
      margin: 0;
    }

    &__description {
      margin-bottom: 3rem;

      a {
        display: inline-block;
      }
    }

    &__btns {
      display: flex;
      flex-direction: row;
      justify-content: center;
      margin: 10px auto 20px auto;

      .button {
        display: inline-block;
        flex: 1;
        flex-grow: 1;
        max-width: 50%;
        margin: 0 5px;
        padding: 5px 20px;
        text-align: center;
      }
    }

    &__link {

      & > strong {
        margin-bottom: 0.315rem;

        @media (min-width: 600px) {
          margin-right: 0.315rem;
          margin-bottom: 0;
        }
      }

      & > a {
        display: block;
      }

      & > a > span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-decoration: none;
        font-size: 100%;
      }
    }

    &__toggle {
      bottom: 0px;
      padding: $bswp-addon-padding;
      display: flex;
      flex-direction: row;
      justify-content: center;
      left: 0;
      position: absolute;
      width: 100%;
      background-color: $bswp-color-addon-bottom;
      border-top: 1px solid $bswp-color-border;
      
      .disclaimer {
        text-align: center;
      }
    }

    &__status {
      display: flex;
      align-items: center;
    }

    &__status-label {
      margin-left: 0.5rem;
    }

    &__status-indicator {
      cursor: pointer;
      position: relative;
      display: inline-flex;
      width: $bswp-status-indicator-size * 2;
      height: $bswp-status-indicator-size;
      border-radius: 3rem;
      background: $bswp-status-indicator-bg;

      &::before {
        content: "";
        width: calc(#{$bswp-status-indicator-size} - 4px);
        height: calc(#{$bswp-status-indicator-size} - 4px);
        background: $bswp-status-indicator-disabled;
        border-radius: 50%;
        position: absolute;
        left: 2px;
        top: 2px;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
      }

      &.active {
        background: $bswp-status-indicator-enabled;
        cursor: pointer;

        &::before {
          left: auto;
          right: 2px;
          box-shadow: 0 3px 8px rgba(95, 204, 98, 0.8);
        }
      }
    }

    &.plugin-unavailable {
      .bswp__addon__status-indicator {
        cursor: not-allowed;
      }
    }

    &__config {
      margin-left: auto;
    }

    &__settings {
      display: none;

      h4 {
        margin-bottom: 0;
        font-size: 1rem;
      }

      &.active {
        display: block;
      }
    }

    &__settings-group {
      margin-bottom: 1.5rem;
    }

  }

  &__checkbox {
    label {
      margin-right: 1rem;
    }
  }

  &__text {
    input {
      display: block;
      width: 100%;
    }
  }

  &__textarea {
    textarea {
      display: block;
      width: 100%;
    }
  }
}
