//
// Preloader
// --------------------------------------------------

#js-ajax-loader {
  position: fixed;
  z-index: 30000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: @base-dark-color;

  .spinner {
     position: absolute;
     top: 50%;
     left: 50%;
     width: 60px;
     height: 60px;
     line-height: 60px;
     margin-top: -30px;
     margin-left: -30px;
     font-size: 60px;
     color: @link-color;
     -webkit-animation: spin 1.5s infinite linear;
     -moz-animation: spin 1.5s infinite linear;
     -ms-animation: spin 1.5s infinite linear;
     -o-animation: spin 1.5s infinite linear;
     animation: spin 1.5s infinite linear;

     i {
      position: absolute;
      top: 50%;
      left: 50%;
      margin-left: -30px;
      margin-top: -30px;
     }
  }
}

#js-ajax-loader-status {
  position: absolute; top: 50%; left: 50%;
  margin-top: 70px;
  margin-left: -150px;
  text-align: center;
  width: 300px;
  height: 14px;
  font-size: 14px;
  color: @link-color;

}

@-webkit-keyframes spin {
    to { -webkit-transform: rotate(360deg); }
}

@-moz-keyframes spin {
    to { -moz-transform: rotate(360deg); }
}

@-ms-keyframes spin {
    to { -ms-transform: rotate(360deg); }
}

@-o-keyframes spin {
    to { -o-transform: rotate(360deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

// widgets preloader
#widget-preloader {
  .spinner {
    float: left;
    margin-right: 10px;
    -webkit-animation: spin 1s infinite linear;
    -moz-animation: spin 1s infinite linear;
    -ms-animation: spin 1s infinite linear;
    -o-animation: spin 1s infinite linear;
    animation: spin 1s infinite linear;
  }
}

//
// Widgets
// --------------------------------------------------

.widget {
  position: relative;
  margin-bottom: 30px;
  background-color: @widget-bg;
  .box-shadow(0 1px 5px rgba(0,0,0,.1));
  border-radius: 3px;

  // Optional header
  &-header {
    position: relative;
    z-index: 500;
    padding: 15px 20px;
    margin-bottom: -1px;
    font-size: (@font-size-base * 1.25);
    font-weight: 500;
    background-color: @widget-header-bg;
    border-bottom: 1px solid @widget-header-border;
    border-radius: 3px 3px 0 0;
    color: @widget-header-color;

    small {
      color: fade(@text-color, 50%);
    }

    .nav {
      margin-top: -7px;
      margin-right: -12px;
      font-size: 14px;

      > li > a {
        border-radius: 0;
        color: darken(@widget-header-border, 20%);

        &,
        &:focus {
          background-color: transparent;
        }

        &:hover {
          color: darken(@widget-header-border, 40%);
          background: none;
        }
      }

      .dropdown-menu label {
        display: block;
        padding: 3px 20px;
        clear: both;
        font-weight: normal;
        line-height: @line-height-base;
        color: #333;
        white-space: nowrap;

        input {
          vertical-align: middle;
          margin-top: -2px;
          margin-right: 4px;
        }

        &:hover {
          text-decoration: none;
          color: #fff;
          background-color: @link-color;
        }
      }

      .open > a {
        background: none;
        color: darken(@widget-header-border, 40%);
      }
    }
  }

  &-content {
    position: relative;
    z-index: 499;
    height: 300px;
    overflow: auto;
    padding: 20px 20px 20px;
    color: @text-color;

    > *:last-child {
      margin-bottom: 0;
    }

    &.mCustomScrollbar {
      padding-right: 10px;
    }

    // .mCSB_container {
    //   padding-right: 25px;

    //   &.mCS_no_scrollbar {
    //     padding-right: 10px;
    //   }
    // }
  }

  // Optional footer
  &-footer {
    position: relative;
    z-index: 500;
    padding: 10px 15px;
    margin-top: -1px;
    background-color: @widget-footer-bg;
    border-top: 1px solid @widget-footer-border;
    color: @widget-footer-color;
  }

  // Elements

  &-system-panel {
    margin: 0 0 15px;
    // border-bottom: 1px solid @widget-header-border;
    padding: 5px;
    font-size: 12px;
    list-style-type: none;
    background: #f5f5f5;
    .clearfix();

    > li {
      float: left;
      margin: 0 15px 0 0;

      > a {

        &.disabled,
        &.disabled:hover {
          color: #999;
          text-decoration: none;
          cursor: default;
        }
      }
    }

    label {
      padding-top: 0 !important;
      font-weight: normal;
      cursor: pointer;
      min-height: 0;

      input {
        margin-top: 2px;
        margin-left: -17px;
      }
    }
  }

  &-icon {
    font-size: 50px;
    line-height: 50px;
    color: @widget-icon-color;
  }

  &-total-stats {
    float: right;
    font-size: 20px;
    text-align: right;
    line-height: 30px;
    vertical-align: bottom;
    text-transform: lowercase;

    span {
      display: block;
      font-size: 44px;
      font-weight: bold;
    }

    @media (max-width:1366px) {
      font-size: 14px;
      line-height: 26px;

      span {
        font-size: 34px;
      }
    }
  }

  &-stats {
    float: left;
    width: 30%;
    
    table {
      margin: 0;
      width: 100%;
      font-size: 12px;

      td:first-child {
        width: 70%;
      }

      td:last-child {
        width: 30%;
        // text-align: right;
        padding-left: 10px;
        
      }      
    }
  }

  &-chart {
    text-align: right;

    &-weekdays {
      font-size: 8px;
      line-height: 10px;
      color: #ccc;
      // margin-left: -4px;

      span {
        text-align: right;
        display: inline-block;
        width: 10px;
        margin-left: 2px;
      }
    }
  }

  &-activity {

    &-item {
      .clearfix();
      margin-bottom: 6px;

      .icon {
        float: left;
        font-size: 12px;
        text-align: center;
        line-height: 18px;
        height: 18px;
        width: 18px;
        color: #fff;
        font-weight: bold;

        img {
          width: 18px;
        }
      }

      p {
        margin-left: 26px;
        font-size: 12px;
        color: #777;
        margin-right: 110px;

        @media (max-width:1366px) {
          margin-right: 0;
        }
      }

      .date {
        font-size: 12px;
        color: #999;
        float: right;

        @media (max-width:1366px) {
          float: none;
          margin-left: 26px;
        }
        
      }

      &.status {
        &-default {

          .icon {
            background: #2abbb4;
          }
        }

        &-added {

          .icon {
            background: #4dcd70;
          }
        }

        &-removed {

          .icon {
            background: #f9644e;
          }
        }
      }
    }
  }

  hr {
    border-top: 1px solid transparent;
    margin: 20px 0;
  }
}

.widget-block-group {

  .widget {
    &:first-child {
      border-radius: 3px 0 0 3px;
    }
    &:last-child {
      border-radius: 0 3px 3px 0;
    }
  }
}

.widget-header-form {
  float: right;
  margin: -2px 0 0;
  max-width: 220px;

  .input-group-sm {

    input {
      height: 30px;
    }

    .input-group-btn>.btn+.btn {
      margin-left: -5px;
    }
  }
}

// widget states

.widget {

  // minmax
  &.collapsed {

    .widget-header {
      border-bottom: 0 none;
    }

    .widget-toggle i:before {
      content: "\f078";
    }

    .widget-content {
      display: none;
      overflow: auto;
    }
  }

  &-inactive {
    display: none;
  }

  // sizes
  &-default {
    .widget-content {
      height: auto;
    }
  }

  &-large {
    
    .widget-content {
      height: 300px;
    }
  }

  &-medium,
  &-package {

    .widget-content {
      height: 210px;
    }
  }

  &-package {
  	position: relative;

  	.widget-stats {
  		position: absolute;
  		left: 15px;
  		bottom: 16px;
  	}

    .widget-chart-weekdays span {
      width: 13px;
      margin-left: 30px;
    }
  }

  &-small {
    position: relative;

    .widget-name {
      width: 70%;
      position: absolute;
      left: 15px;
      bottom: 15px;
      color: #ccc;

      // i {
      //   color: #aaa;
      //   font-size: 20px;
      // }
    }

    .widget-icon {
      float: right;
      font-size: 22px;
      line-height: 22px;
    }

    .widget-content {
      height: 115px;
    }

    .widget-total-stats {
      float: left;
      font-size: 12px;
      text-align: left;
      line-height: 16px;
      vertical-align: inherit;

      span {
        font-size: 12px;
        font-weight: normal;

        &.main-stat {
          font-size: 16px;
          margin-bottom: 6px;
        }
      }
    }

    &-config {
      background: @widget-sm-bg;
      .box-shadow(none);
      cursor: pointer;

      .widget-icon i {
        .transition(all .3s ease-out);
        color: @widget-sm-color;
        font-size: 40px;
      }

      .widget-name {
        color: @widget-sm-color;
        .transition(all .3s ease-out);
      }

      &:hover {
        .widget-icon i {
          color: @link-color;
        }

        .widget-name {
          color: @link-color;
        }
      }
    }
  }
}

// animated widgets
.animated-widgets {
  .widget-large,
  .widget-medium,
  .widget-small,
  .widget-package {
    bottom: -20px;
    .opacity(0);
  }
}

// widgets block

.widget-block {
  margin-bottom: 30px;
  display: table;
  width: 100%;

  .widget {
    display: table-cell;
    width: 50%;

    &-inactive {
      display: none;
    }
  }

  @media (max-width: @screen-sm) {
    display: block;
    width: auto;

    .widget {
      display: block;
      width: auto;
    }
  }
}

.widget-block-plates {
  // margin-bottom: 30px;
  .clearfix();
}


.special-search {
  margin: 0;
  position: relative;
  width: 180px;

  &:before,
  &:after {
    display: block;
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2px;
    height: 6px;
    background: #ddd;
  }

  &:after {
    left: auto;
    right: 0;
  }

  input {
    width: 100%;
    border: 0 none;
    border-bottom: 2px solid #ddd;
    box-shadow: none;
    font-size: 14px;
    font-weight: normal;
    padding-left: 28px;
    padding-right: 10px;
  }

  i {
    position: absolute;
    left: 6px;
    top: 7px;
    font-size: 12px;
    color: #777;
  }


  &--right {
    position: absolute;
    right: 15px;
    top: 50%;
    margin-top: -13px;
  }
}


// UNIQUE STYLES FOR WIDGETS
//---------------------------

#widget-changelog {
  .widget-content {
    font-size: 12px;
  }
}


// Customization mode
//---------------------------

#js-customize-dashboard-save,
#js-customize-dashboard-discard,
#js-customize-dashboard-reset {
  display: none;
}

.widget {
  &-tools {
    position: absolute;
    bottom: 0; right: 0; left: 0; top: 0;
    // border: 2px solid #b5c90f; 
    z-index: 20000;
    overflow: hidden;

    &-btns {
      position: absolute;
      bottom: 0; right: 0;
      padding: 6px 6px;
      background: #b5c90f;
      font-size: 12px;

      a {
        color: #fff;
        display: inline-block;
        margin: 0 4px;

        &:hover {
          text-decoration: none;
          
        }
      }
    }

    &-disabled {
      // border: 2px solid #f2395b;
      // background: rgba(242,57,91,.1);
      background: rgba(0,0,0,.1);

      .widget-tools-btns {
        background: #f2395b;
        // right: -2px;
        // bottom: -2px;
      }
    }
  }

  &-disabled {
    .opacity(1);
    .widget-header,
    .widget-content,
    .widget-footer {
      .opacity(.3);
    }
  }

  &-active {
    .opacity(1);
  }

  .help-block {
    font-style: italic;
  }
}


// CUSTOMIZE ADD LINK FORM
//---------------------------

.link-add {
  display: none;
}

li.dc-form {
  background: #b5c90f;

  form {
    padding: 10px;

    input {
      margin-bottom: 6px;
      border: 0 none !important;
    }

    select {
      height: 30px;
      line-height: 30px;
      border: 0 none;
      margin-bottom: 6px;
    }
  }

  label {
    font-weight: normal;
    color: #fff;
  }

}

// Server alerts

.imp-alert {
  position: relative;
  padding-left: 25px;

  .i-warning {
    position: absolute;
    width: 30px;
    height: 30px;
    line-height: 28px;
    left: -15px;
    top: 10px;
    background: @alert-danger-bg;
    border-radius: 50%;
    text-align: center;
    border: 1px solid @alert-danger-border;
  }
}