$cwb-btn-primary-active-text: #5f6367;
$cwb-btn-primary-hover-text: #00aaff;
$cwb-btn-action-active-bg: #00d6ff;
$cwb-btn-action-hover-bg: #00aaff;
$cwb-btn-success-active-bg: #4ae3b2;
$cwb-btn-success-hover-bg: #15ca7c;
$cwb-btn-danger-active-bg: #ff1870;
$cwb-btn-danger-hover-bg: #ff0231;

.cwb-btn-primary,
.cwb-btn-cancel,
.cwb-btn-action,
.cwb-btn-success,
.cwb-btn-danger,
.cwb-btn-upload {
  height: 36px;
  min-width: 140px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.33px;
  line-height: 20px;
  font-size: 14px;
  cursor: pointer;
  &:not(:disabled):not(.disabled):focus,
  &:not(:disabled):not(.disabled):focus:active,
  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled):active:focus,
  &:not(:disabled):not(.disabled):hover {
    outline: 0;
  }

  &:disabled {
    background-color: #d1d5dd;
    cursor: auto;
  }

  @media screen and (max-width: 768px) {
    font-size: 12px;
    line-height: 15px;
    height: 30px;
  }

  @media screen and (max-width: 450px) {
    font-size: 10px;
    line-height: 12px;
    height: 25px;
  }
}

.cwb-btn-primary,
.cwb-btn-cancel,
.cwb-btn-upload {
  background: white;
  color: $cwb-btn-primary-active-text;
  border: 1px solid #d1d5dd;
  box-shadow: 0 2px 8px 0 rgba(black, 0.08);
  &:not(:disabled):not(.disabled):focus,
  &:not(:disabled):not(.disabled):focus:active,
  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled):active:focus,
  &:not(:disabled):not(.disabled):hover {
    background: white;
    color: $cwb-btn-primary-hover-text;
    border: 1px solid #d1d5dd;
    box-shadow: 0 2px 8px 0 rgba(rgb(49, 40, 40), 0.08);

    div,
    div:before,
    span,
    span:before {
      color: $cwb-btn-primary-hover-text;
    }
  }
}

.cwb-btn-cancel {
  font-weight: normal;
}

.cwb-btn-action {
  background: $cwb-btn-action-active-bg;
  color: white;
  border: none;
  &:not(:disabled):not(.disabled):focus,
  &:not(:disabled):not(.disabled):focus:active,
  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled):active:focus,
  &:not(:disabled):not(.disabled):hover {
    background: $cwb-btn-action-hover-bg;
    color: white;
    box-shadow: 0 2px 8px 0 rgba($cwb-btn-action-hover-bg, 0.08);
    border: none;

    div,
    div:before,
    span,
    span:before {
      color: white;
    }
  }
}

.cwb-btn-success {
  background: $cwb-btn-success-active-bg;
  color: white;
  border: none;
  &:not(:disabled):not(.disabled):focus,
  &:not(:disabled):not(.disabled):focus:active,
  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled):active:focus,
  &:not(:disabled):not(.disabled):hover {
    background: $cwb-btn-success-hover-bg;
    color: white;
    border: none;
    box-shadow: 0 2px 8px 0 rgba($cwb-btn-success-hover-bg, 0.08);

    div,
    div:before,
    span,
    span:before {
      color: white;
    }
  }
}

.cwb-btn-danger {
  background-color: $cwb-btn-danger-active-bg;
  color: white;
  border: none;
  &:not(:disabled):not(.disabled):focus,
  &:not(:disabled):not(.disabled):focus:active,
  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled):active:focus,
  &:not(:disabled):not(.disabled):hover {
    background: $cwb-btn-danger-hover-bg;
    color: white;
    border: none;
    box-shadow: 0 2px 8px 0 rgba($cwb-btn-danger-hover-bg, 0.08);

    div,
    div:before,
    span,
    span:before {
      color: white;
    }
  }
}

.cwb-btn-upload {
  font-size: 13px;
  width: 154px;
  display: flex;
  align-items: center;
  font-weight: 600;
  padding: 0px;

  .cwb-btn-upload-icon,
  .cwb-btn-upload-icon-active {
    width: 14px;
    height: auto;
    margin: 0px 18px 0px 25px;
  }

  &:not(:hover) {
    .cwb-btn-upload-icon {
      display: block;
    }

    .cwb-btn-upload-icon-active {
      display: none;
    }
  }

  &:hover {
    .cwb-btn-upload-icon {
      display: none;
    }

    .cwb-btn-upload-icon-active {
      display: block;
    }
  }

  .cwb-btn-upload-text {
    text-align: left;
    flex-grow: 1;

    &.loading {
      color: #8e8e8e;
    }
  }

  &:hover {
    .cwb-btn-upload-text {
      color: #00aaff;
    }
  }
}

.cwb-dropdown {
  .dropdown-item {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .dropdown-menu.show {
    max-height: 250px;
    overflow-y: scroll;
  }

  button {
    border-color: #d1d5dd;
    background: transparent;
    color: #353b48;
    font-size: 13px;
    min-width: 200px;
    height: 36px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    cursor: pointer;
    span {
      flex-grow: 1;
    }
    &.dropdown-item {
      border: none;

      &:not(:disabled):not(.disabled):hover,
      &:not(:disabled):not(.disabled):hover > span,
      &:not(:disabled):not(.disabled):hover > div {
        color: #00aaff !important;
      }
    }
    &:focus {
      outline: 0;
    }

    &:not(:disabled):not(.disabled):focus,
    &:not(:disabled):not(.disabled):focus:active,
    &:not(:disabled):not(.disabled):active,
    &:not(:disabled):not(.disabled):active:focus,
    &:not(:disabled):not(.disabled):hover {
      border-color: #2ed2ff;
      background: transparent;
      color: #2ed2ff;
      box-shadow: none;

      & > span,
      & > div {
        color: #2ed2ff;
      }
    }

    &:disabled,
    &.disabled {
      color: #53627c;
      cursor: not-allowed;

      & > div,
      & > span {
        color: #53627c;
      }
    }
  }
  &.dropdown.show {
    .btn-secondary.dropdown-toggle:focus,
    button {
      border-color: #2ed2ff;
      background: transparent;
      color: #353b48;
      box-shadow: none;
    }
  }
  .dropdown-toggle::after {
    color: #8395a7;
    border-top: 5px solid;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
  }
}

.cwb-btn-pause-play {
  -webkit-box-shadow: 0 1px 1px 0 rgba(35, 53, 57, 0.07),
    0 0 1px 1px rgba(35, 53, 57, 0.11), 0 3px 2px 0 rgba(35, 53, 57, 0.1),
    0 4px 9px 4px rgba(35, 53, 57, 0.08);
  -moz-box-shadow: 0 1px 1px 0 rgba(35, 53, 57, 0.07),
    0 0 1px 1px rgba(35, 53, 57, 0.11), 0 3px 2px 0 rgba(35, 53, 57, 0.1),
    0 4px 9px 4px rgba(35, 53, 57, 0.08);
  box-shadow: 0 1px 1px 0 rgba(35, 53, 57, 0.07),
    0 0 1px 1px rgba(35, 53, 57, 0.11), 0 3px 2px 0 rgba(35, 53, 57, 0.1),
    0 4px 9px 4px rgba(35, 53, 57, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border-radius: 32px;
  background: white;
  cursor: pointer;
  flex: none;
}

.cwb-btn-more {
  &.cwb-dropdown .dropdown-toggle::after {
    display: none;
  }
  &.cwb-dropdown.more-actions.dropdown button {
    background: transparent;
    border-color: transparent;
  }
  &.cwb-dropdown.more-actions.dropdown.show button {
    border-color: #00aaff;
    border-width: 2px;
  }

  .dropdown-item {
    color: #0a1f44;
    font-weight: 600;
  }

  .dropdown-item {
    &:not(:disabled):not(.disabled):focus,
    &:not(:disabled):not(.disabled):focus:active,
    &:not(:disabled):not(.disabled):active,
    &:not(:disabled):not(.disabled):active:focus,
    &:not(:disabled):not(.disabled):hover {
      color: #00aaff;
      cursor: pointer;
    }
  }

  button.dropdown-toggle {
    background: transparent;
    min-width: 0px;
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    vertical-align: middle;
    border-color: transparent;
  }
}
