/**
 * Styles for the Widget to be displayed in the Clearfy plugin

 * @author Alex Kovalev <alex.kovalevv@gmail.com> 
 * @copyright Webcraftic 13.06.2018
 */

@positiveColor: #8CC152;
@negativeColor: #D2D3D6;
@neutralColor: #828282;

@errorColor: #fb5d49;
@waringColor: #ffb635;

@greyButtonBg: #f3f3f3;
@greyButtonColor: #656565;

@greenButtonBg: #c9deb2;
@greenButtonColor: #586549;

@orangeButtonBg: #fdd599;
@orangeButtonColor: #a57b3c;

#WBCR {
  .wio-clear {
    clear: both;
  }

  // Right sidebar

  .wbcr-factory-sidebar-widget {
    &.wbcr-rio-servers {
      margin-top: 30px;
      background: none;
      padding: 0;

      h4 {
        font-size: 15px;
        font-weight: 700;
      }

      button {
        padding: 5px 10px;
        border: 0;
        font-size: 11px;
        text-transform: uppercase !important;
        font-weight: bold;
        border-radius: 4px;
        outline: none;
        background: @greyButtonBg;
        color: @greyButtonColor;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);

        &:active {
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
        }

        &.wbcr-rio-loading {
          width: 56px;
          font-size: 0;
          background: @greyButtonBg url("../img/quick-start-loader.gif") center no-repeat;
        }

        &.wbcr-rio-selected {
          background: #f3efe2;
          color: #d8d8d8;
          &:active {
            box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
          }
        }
      }

      table {
        width: 100%;
        box-sizing: border-box;
        border-spacing: 3px;
        background: #fff;

        th, td {
          padding: 16px 10px;
          text-align: center;
        }
        th {
          background: #efefef;
          color: #777777;
          box-shadow: 0 1px 0 rgb(216, 216, 216);
        }
        .wbcr-rio-server-check-proccess {
          display: inline-block;
          height: 10px;
          width: 30px;
          background: url("../img/quick-start-loader.gif") center no-repeat;
        }
        .wbcr-rio-servers-list-item-selected {
          background: #fffbed;
          color: #cec5a8;
          font-weight: 600;
        }
        .wbcr-rio-server-success {
          color: @positiveColor;
        }
        .wbcr-rio-server-error {
          color: @errorColor;
        }
        .wbcr-rio-server-warning {
          color: @waringColor;
        }
      }

      .wbcr-rio-warning-message {
        margin-top: 30px;
        padding: 20px;
        border: 1px dashed #bfbfbf;
        background: #ffffff;
        margin-bottom: 40px;
        font-size: 15px;
        color: #828282;
      }
    }
  }

  .wio-columns {
    overflow: hidden;
    padding: 15px 0;
    counter-reset: cols;

    [class^="col-"] {
      float: left;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }

    .col-1-3 {
      width: 33.333%;
      padding-left: 28px;
    }

    .col-2-3 {
      width: 66.666%;
      padding-left: 28px
    }

    .col-1-2 {
      width: 50%;
      padding: 0 20px;
    }

    .col-statistics.col-statistics {
      width: 60%;
    }

    .col-chart.col-chart {
      width: 40%;
      position: relative;
      padding: 20px;
      font-size: 12px;
      text-transform: uppercase;
      background: #f1f1f1b3;
      color: #abacaf;
      font-weight: bold;
      border-radius: 5px;
      margin-top: 10px;
      text-align: left;
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    }
  }

  .wio-col {
    float: left;
    width: 50%;
    box-sizing: border-box;
    -webkit-flex-basis: 50%;
    -ms-flex-preferred-size: 50%;
    flex-basis: 50%;
  }

  .wio-col {
    padding-right: 20px;
  }

  .wio-col + .wio-col {
    padding-right: 0;
    padding-left: 50px;
  }

  .wio-col:target {
    animation: wiohello 1s 3 linear backwards;
  }

  /* Number display */
  .wio-number-you-optimized {
    margin-bottom: 1.35em;
    overflow: hidden;

    #wio-total-optimized-attachments-pct {
      color: @neutralColor;
    }

    .wio-number {
      display: table-cell;
      padding-right: 15px;
      font-size: 48px;
      font-weight: bold;
      line-height: 1;
      vertical-align: middle;
      white-space: nowrap;
      color: @neutralColor;
    }

    .wio-text {
      display: table-cell;
      vertical-align: middle;
      overflow: hidden;
      font-size: 12px;
      color: @neutralColor;
    }

    & > p {
      display: table;
    }
  }

  /* Number and bars */
  .wio-bars {
    padding-right: 15px;
  }

  .wio-bars p {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .wio-bars + .wio-number-you-optimized {
    border-bottom: 0;
    padding-top: 0.85em;
  }

  .wio-bars + .wio-number-you-optimized p {
    color: darken(@positiveColor, 10);
  }

  .wio-bar-negative {
    .wio-progress {
      background: @negativeColor;
    }
    .wio-barnb {
      color: darken(@negativeColor, 20);
    }
  }

  .wio-progress {
    height: 8px;
    transition: width .3s;

    /*.wio-bar-negative {
      width: 92% !important;
    }*/
  }

  .wio-bar-positive {
    .wio-progress {
      background: @positiveColor;
    }
    .wio-barnb {
      color: darken(@positiveColor, 10);
    }
  }

  .wio-bar-primary {
    .wio-progress {
      background: @positiveColor;
    }
    .wio-barnb {
      color: darken(@positiveColor, 10);
    }
  }

  .wio-right-outside-number .wio-barnb {
    display: block;
    margin-right: -5.25em;
    text-align: right;
    font-weight: bold;
    line-height: .8;
  }

  /* Doughnut */
  .wio-chart {
    position: relative;
    top: 1px;
    display: inline-block;
    vertical-align: middle;
  }

  .wio-chart-container {
    position: relative;
    display: inline-block;
    margin-right: 5px;
    border: 10px solid #d2d3d6;
    border-radius: 100%;
  }

  .wio-chart-container canvas {
    display: block;
  }

  .wio-overview-chart-container {
    float: left;
    margin-right: 20px;
  }

  .wio-chart-percent {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    margin-top: -.5em;
    line-height: 0.8;
    text-align: center;
    font-size: 54px;
    font-weight: bold;
    color: #afafaf;
  }

  .wio-chart-percent span {
    font-size: 20px;
    vertical-align: super;
  }

  #wio-overview-chart-legend {
    overflow: hidden;
  }

  .wio-doughnut-legend li {
    display: inline-block;
    position: relative;
    margin-bottom: 15px;
    border-radius: 5px;
    padding: 3px 8px 2px 31px;
    font-size: 12px;
    cursor: default;
    -webkit-transition: background-color 200ms ease-in-out;
    -moz-transition: background-color 200ms ease-in-out;
    -o-transition: background-color 200ms ease-in-out;
    transition: background-color 200ms ease-in-out;
  }

  .wio-doughnut-legend li span {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 25px;
    height: 25px;
    border-radius: 50%;
  }

  .wio-optimize-button {
    width: 180px;
    padding: 12px 30px;
    background: @greenButtonBg;
    color: @greenButtonColor;
    border: 0;
    box-shadow: none;
    font-size: 14px;
    text-transform: uppercase !important;
    font-weight: bold;
    border-radius: 4px;
    outline: none;
    text-decoration: none;

    &:active {
      box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
    }
  }

  .wio-global-optim-phrase {
    width: 180px;
    padding-top: 20px;
    font-size: 14px;
    text-align: center;
  }

  .wio-total-percent {
    color: darken(@positiveColor, 20);
  }

  .wio-text-left {
    text-align: left;
  }

  span.wio-num {
    display: inline !important;
    position: inherit !important;
  }

  /* Widget */
  .wio-image-optimize-board {
    padding: 20px;
  }

  .wio-page-statistic {
    padding-left: 40px;

    .wio-chart-percent {
      margin-top: -1.1em;
    }
  }

  .wio-widget {
    padding: 0 !important;

    .wio-chart-percent {
      font-size: 44px;
      line-height: 1;
    }
    .wio-bars {
      width: 80%;
      margin-left: 155px;
      box-sizing: border-box;
    }
    .col-chart.col-chart {
      width: 100%;
    }
    .col-controls {
      width: 45%;
      padding-left: 5px;
      padding-top: 110px
    }
    .wio-doughnut-legend {
      margin-left: 20px;
      text-align: left;

    }
    .wio-widget-bottom {
      display: table;
      padding-top: 20px !important;
      width: 100%;
      text-align: right;
    }
    .wio-widget-bottom li {
      display: table-cell;
    }
    .wio-widget-bottom li:first-child {
      text-align: left;
    }
  }

  @media (max-width: 830px) {
    .wio [class^="col-"] {
      float: none;
      margin-bottom: 1.5em;
    }

    .wio .col-1-3,
    .wio .col-1-2 {
      width: auto;
      padding: 0 28px;
      clear: both;
      padding-top: 1em;
    }
  }

  @keyframes wiohello {
    0%, 100% {
      background: #FFF;
    }
    50% {
      background: #F4F7F9;
    }
  }

  @media (max-width: 1520px) and (min-width: 1381px), (max-width: 1086px) {
    .wio-columns {
      .col-statistics.col-statistics, .col-chart.col-chart {
        width: 50%;
      }
    }

  }

  @media (max-width: 808px) {
    .wio-columns {
      .col-statistics.col-statistics, .col-chart.col-chart {
        width: auto;
        float: none;
        padding: 0;
      }
      .col-chart.col-chart {
        margin-top: 3em;
      }
    }
  }
}
