@import "font-awesome/variables";
@import "font-awesome/mixins";

.primary-button {
  @extend %primary-button;
}

/* action buttons bar */
#modx-action-buttons {
  position: fixed;
  top: 65px;
  right: 33px;
  z-index: 9;
  left: auto;
  background: none;
  padding: 0;
  border: 0;
  font-family: $buttonfonts;

  .x-toolbar-left {
    width: auto !important;
    zoom: 1;
  }
}

/* btn style */
.x-btn {
  *display: inline;
  background-color: $white;
  /*@include linear-gradient($white, $gainsboro);*/
  line-height: 1;
  border-radius: 3px;
  cursor: pointer;
  display: inline-block;
  margin: 0 1px;
  padding: 5px 6px;
  position: relative;
  text-decoration: none;
  zoom: 1;
  border:1px solid $primaryBorder;
  transition: background-color .2s;
  button {
    font-size: 12px;
    color: $labelText;
    cursor: pointer;
    height: 16px;
    min-width: 100%;
    vertical-align: middle;
  }
  &.primary-button {
	@extend %primary-button;
  }
}

.x-btn-over {
  border-color:darken($gainsboro,40%);
  background-color:$gainsboro;
}

.primary-button, #modx-abtn-save {
  @extend %primary-button;
  background: lighten($primaryAction,5%);
}

.x-btn-icon button {
  height: 16px;
  width: 16px;
}

.x-btn-icon {
    &.arrow_up {
      button {
        background:none !important; /* #shame */
        position:relative;
        &:before {
          @extend %pseudo-font-x-btn;
          content:$level-up;
          top:1px;
          bottom:auto;
        }
      }
    }
    &.arrow_down {
      button {
        background:none !important; /* #shame */
        position:relative;
        &:before {
          @extend %pseudo-font-x-btn;
          content:$level-down;
          top:1px;
          bottom:auto;
        }
      }
    }
    &.refresh {
      button {
        background:none !important; /* #shame */
        position:relative;
        &:before {
          @extend %pseudo-font-x-btn;
          content:$refresh;
          top:1px;
          bottom:auto;
        }
      }
    }
}

.x-btn-text-icon button {
  padding-left: 20px !important;
}

.x-html-editor-tb .x-btn {
  -moz-box-shadow: none;
  -o-box-shadow: none;
  -webkit-box-shadow: none;
  background-color: transparent;
  background-image: none;
  border: 0 none;
  box-shadow: none;
  margin: 0;
}

.x-html-editor-tb .x-btn-over {
  border: 0 none;
}

.x-btn-click {
  -moz-box-shadow: 0 0 3px #aaaaaa inset;
  -o-box-shadow: 0 0 3px #aaaaaa inset;
  -webkit-box-shadow: 0 0 3px #aaaaaa inset;
  background-color: #ffffff;
  background-image: none;
  /*border-color: #CFCFCF #C0C0C0 #AAAAAA;*/
  box-shadow: 0 0 3px #aaaaaa inset;
  margin: 0 1px;
}

.x-btn-focus {
  background: $gainsboro;
  background: url(../images/modx-theme/form/button-bg-over.svg) repeat-x scroll 0 bottom rgba(223, 223, 223, 1);
  border: 1px solid $darkNeutral;
}

.x-btn-group {
  border-radius: 3px;
  border: 1px solid #dbe0e4;
  margin-right: 2px;
  padding: 0;
}

.x-btn-group .x-btn {
  -moz-box-shadow: transparent 0 0 1px;
  -o-box-shadow: transparent 0 0 1px;
  -webkit-box-shadow: transparent 0 0 1px;
  background-color: transparent;
  background-image: none;
  border: 1px solid transparent;
  box-shadow: transparent 0 0 1px;
}

.x-btn-group .x-btn button {
  color: #868b8f;
  height: auto !important;
  /*text-shadow: 0 1px 0 #ffffff;*/
}

.x-btn-group .x-btn-over {
  background: #dfdfdf;
  background: $gainsboro;
  border: 1px solid #dbe0e4;
}

.x-btn-group .x-btn-over button {
  color: #5b7a98;
  /*text-shadow: 0 1px 0 #ffffff;*/
}

.x-btn-group .x-btn-click {
  background-color: #ffffff;
  background-image: none;
  box-shadow: 0 0 3px #aaaaaa inset;
  margin: 0 2px 0 0;
}

.x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text {
  color: #73797f;
}

.x-btn-disabled * {
  color: gray !important;
}

.x-btn-group-bwrap {
  padding: 1px 0 0;
}

.x-btn-group-header {
  background-color: #dbe0e4;
  color: #73797f;
  text-shadow: 0 1px 0 #fafafa;
}

.x-btn-group-tl, .x-btn-group-tr {
  background-image: none;
  padding: 0;
}

.x-btn-group-tc, .x-btn-group-bc, .x-btn-group-bl, .x-btn-group-br {
  background-image: none;
}

.x-btn-group-ml {
  background-image: none;
  padding-left: 1px;
}

.x-btn-group-mr {
  background-image: none;
  padding-right: 1px;
}

.x-btn em.x-btn-split {
  /*background: transparent url(../images/modx-theme/button/s-arrow.gif) no-repeat right center;*/
  display: block;
  padding-right: 14px;
  position:relative;
  &:before {
    @extend %pseudo-font;
    content:$caret-down;
    position:absolute;
    top:4px;
    right:0;
    color:inherit;
  }
}

.x-btn em.x-btn-arrow {
  background: transparent url(../images/modx-theme/button/arrow.gif) no-repeat right center;
  display: block;
  padding-right: 10px;
}

/* //end button style */

.x-btn-over em.x-btn-split, .x-btn-click em.x-btn-split, .x-btn-menu-active em.x-btn-split, .x-btn-pressed em.x-btn-split {
  /*background-image: url(../images/modx-theme/button/s-arrow-o.gif);*/
}

.x-btn em.x-btn-arrow-bottom {
  background-image: url(../images/modx-theme/button/s-arrow-b-noline.gif);
}

.x-btn em.x-btn-split-bottom {
  background-image: url(../images/modx-theme/button/s-arrow-b.gif);
}

.x-btn-over em.x-btn-split-bottom, .x-btn-click em.x-btn-split-bottom, .x-btn-menu-active em.x-btn-split-bottom, .x-btn-pressed em.x-btn-split-bottom {
  background-image: url(../images/modx-theme/button/s-arrow-bo.gif);
}

.x-btn-group-notitle .x-btn-group-tc {
  background-image: url(../images/modx-theme/button/group-tb.gif);
}


/* Action buttons */
.actions {
  bottom: 8px;
  margin: 0;
  overflow: hidden;
  position: absolute;
}

.actions li {
  float: left;
  line-height: 0.7;
  margin-right: 2px;
}

.actions button,
.inline-button {
  background: #dcdcdc;
  background: -moz-linear-gradient(center bottom, gainsboro 0%, #fcfcfc 100%) repeat scroll 0 0 transparent;
  background: -ms-linear-gradient(center bottom, gainsboro 0%, #fcfcfc 100%);
  background: -o-linear-gradient(center bottom, gainsboro 0%, #fcfcfc 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fcfcfc), color-stop(100%, gainsboro));
  background: -webkit-linear-gradient(center bottom, gainsboro 0%, #fcfcfc 100%);
  background: linear-gradient(center bottom, gainsboro 0%, #fcfcfc 100%);
  border-radius: 3px;
  border: 1px solid #cccccc;
  color: #888888;
  cursor: pointer;
  display: block;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fcfcfc,endColorstr=#dcdcdc,GradientType=0);
  font: $fontSmall;
  font-weight: bold;
  padding: 3px 5px;
  text-decoration: none;
  /*text-shadow: 0 1px 0 #ffffff;*/
}

.actions button:hover,
.inline-button:hover {
  background: #e0e0e0;
  background: -moz-linear-gradient(center bottom, #e0e0e0 0%, #fcfcfc 100%) repeat scroll 0 0 transparent;
  background: -ms-linear-gradient(center bottom, #e0e0e0 0%, #fcfcfc 100%);
  background: -o-linear-gradient(center bottom, #e0e0e0 0%, #fcfcfc 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fcfcfc), color-stop(100%, #e0e0e0));
  background: -webkit-linear-gradient(center bottom, #e0e0e0 0%, #fcfcfc 100%);
  background: linear-gradient(center bottom, #e0e0e0 0%, #fcfcfc 100%);
  color: #565550;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fcfcfc,endColorstr=#e0e0e0,GradientType=0);
}

.actions button:active,
.inline-button:active {
  background-color: #ffffff;
  background-image: none;
  box-shadow: 0 0 3px #aaaaaa inset;
}

.actions button.orange {
  background: #febb4a;
  background: -moz-linear-gradient(center bottom, #febb4a 0%, #feda71 100%) repeat scroll 0 0 transparent;
  background: -ms-linear-gradient(center bottom, #febb4a 0%, #feda71 100%);
  background: -o-linear-gradient(center bottom, #febb4a 0%, #feda71 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #feda71), color-stop(100%, #febb4a));
  background: -webkit-linear-gradient(center bottom, #febb4a 0%, #feda71 100%);
  background: linear-gradient(center bottom, #febb4a 0%, #feda71 100%);
  border-color: #f5b74e #e7a93f #dfa138;
  color: #996633;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#feda71,endColorstr=#febb4a,GradientType=0);
  /*text-shadow: 0 1px 0 #fee1a0;*/
}

.actions button.orange:hover {
  background: #fec95b;
  background: -moz-linear-gradient(center bottom, #fec95b 0%, #fee1a0 100%) repeat scroll 0 0 transparent;
  background: -ms-linear-gradient(center bottom, #fec95b 0%, #fee1a0 100%);
  background: -o-linear-gradient(center bottom, #fec95b 0%, #fee1a0 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fee1a0), color-stop(100%, #fec95b));
  background: -webkit-linear-gradient(center bottom, #fec95b 0%, #fee1a0 100%);
  background: linear-gradient(center bottom, #fec95b 0%, #fee1a0 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fee1a0,endColorstr=#fec95b,GradientType=0);
}

.inline-button.green {
  background: #9fcb57;
  background: -moz-linear-gradient(center bottom, #9fcb57 0%, #d7e9a4 100%) repeat scroll 0 0 transparent;
  background: -ms-linear-gradient(center bottom, #9fcb57 0%, #d7e9a4 100%);
  background: -o-linear-gradient(center bottom, #9fcb57 0%, #d7e9a4 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d7e9a4), color-stop(100%, #9fcb57));
  background: -webkit-linear-gradient(center bottom, #9fcb57 0%, #d7e9a4 100%);
  background: linear-gradient(center bottom, #9fcb57 0%, #d7e9a4 100%);
  border: 1px solid #85a948;
  color: #556f14 !important;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#d7e9a4,endColorstr=#9fcb57,GradientType=0);
  /*text-shadow: 0 1px 0 #d7e9a4;*/
}

.inline-button.green:hover {
  background: #9fcb57;
  background: -moz-linear-gradient(center bottom, #9fcb57 0%, #e6efd1 100%) repeat scroll 0 0 transparent;
  background: -ms-linear-gradient(center bottom, #9fcb57 0%, #e6efd1 100%);
  background: -o-linear-gradient(center bottom, #9fcb57 0%, #e6efd1 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #e6efd1), color-stop(100%, #9fcb57));
  background: -webkit-linear-gradient(center bottom, #9fcb57 0%, #e6efd1 100%);
  background: linear-gradient(center bottom, #9fcb57 0%, #e6efd1 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#e6efd1,endColorstr=#9fcb57,GradientType=0);
}

/* basic tree toolbar styles */
#modx-leftbar .x-toolbar-ct .x-btn {
  background: $gainsboro;
  margin: 0 3px;
  padding: 5px;
  width: 16px;
  height: 16px;
  border: 1px solid $borderColor;
  opacity: .6;
  display: inline-block;
  position: relative;

  & > em > button {
    font-size: 15px;
    text-shadow: 0 !important;
    overflow: visible;
    position: absolute;
    width: 16px;
    height: 18px;
    top: 4px;
    left: 2px;
    color: #000;
  }

  &:hover {
    opacity: 1;
  }

  span {
    vertical-align: middle;
  }
}
#modx-leftbar #emptifier.x-item-disabled  {
  opacity: .4 !important;
}


/* resource tree toolbar icons */
.tree-new-resource > em > button:before {
  @include icon($file-alt);
}
.tree-new-weblink > em > button:before {
  @include icon($link);
}
.tree-new-symlink > em > button:before {
  @include icon($copy);
}
.tree-new-static-resource > em > button:before {
  @include icon($file-text-alt);
}
.tree-trash > em > button:before {
  @include icon($trash);
}
  /* alignment overrides */
  #modx-leftbar .x-toolbar-ct .x-btn.tree-new-symlink > em > button {
    top: 4px;
    left: 2px;
  }
  #modx-leftbar .x-toolbar-ct .x-btn.tree-new-weblink > em > button {
    left: 2px;
  }


/* element tree toolbar */
.tree-new-template > em > button:before {
  @include icon($columns);
}
.tree-new-tv > em > button:before {
  @include icon($list-alt);
}
.tree-new-chunk > em > button:before {
  @include icon($th-large);
}
.tree-new-snippet > em > button:before {
  @include icon($code);
}
.tree-new-plugin > em > button:before {
  @include icon($cogs);
}
.tree-new-category > em > button:before {
  @include icon($folder-close);
}


/* accordion header row icons */
#modx-leftbar .x-btn-fontawesome {
  background: none;
  border: 0;
  display: inline;
  opacity: 0.6;
  margin: 0;
  padding: 3px;
  text-align: center;
  i {
    font-style: normal;
  }
  button {
    display: none;
  }
  &:hover {
    opacity: 1 !important;
  }
}
