/**
 * Snippets list table
 */

.wp-list-table {
  & th {
    &#title {
      width: 20% !important;
    }

    &#winp_snippet_type {
      width: 70px !important;
    }

    &#winp_actions {
      width: 50px !important;
    }

    &#winp_where_use {
      width: 200px !important;
    }

    &#winp_priority {
      width: 90px !important;
    }

    &#winp_taxonomy-wbcr-snippet-tags {
      width: 100px;
    }
  }

  & .winp-taxonomy-href {
    text-decoration: underline;
  }

  & td {
    vertical-align: middle;

    &.column-winp_actions {
      vertical-align: top;
    }

    &.column-status {
      //text-align: center;
    }

    & .winp-snippet-active-switch, .winp-snippet-inactive-switch {
      background-color: #6366f1;
      margin-top: 5px;
      width: 40px;
      height: 20px;
      border-radius: 34px;
      display: inline-block;

      &:before {
        -webkit-transform: translateX(100%);
        transform: translateX(100%);
        -webkit-transition: all .4s;
        transition: all .4s;
        content: "";
        height: 16px;
        width: 17px;
        display: inline-block;
        margin: 2px;
        background-color: #fff;
        border-radius: 50%;
      }

      &:hover:before {
        -webkit-transform: translateX(80%);
        transform: translateX(80%);
      }
    }

    & .winp-inactive {
      &.winp-snippet-active-switch {
      background-color: #ccc;

      &:before {
        -webkit-transform: none;
        transform: none;
      }

      &:hover:before {
        -webkit-transform: translateX(20%);
        transform: translateX(20%);
      }
    }
  }


  & .winp-snippet-switch-loader {
    &:before {
      -webkit-transform: translateX(55%) !important;
      transform: translateX(55%) !important;
    }
  }

  /*&.column-snippet_type {
    text-align: center;
  }*/
}

.wbcr-inp-enable-snippet-button {
  .dashicons {
    margin-top: 3px;

    &.dashicons-controls-pause {
      color: #8bc34a;
    }
  }
}

.wbcr-inp-snippet-type-label {
  display: inline-block;
  padding: 3px 8px 6px;
  border-radius: 3px;
  font-weight: bold;
  width: 30px;
  text-align: center;
  float: right;
  margin-right: 5px;

  &.wbcr-inp-type-php {
    background: #777bb3;
    color: #ffffff;
  }

  &.wbcr-inp-type-text {
    background: #4CAF50;
    color: #fffffd;
  }

  &.wbcr-inp-type-universal {
    background: #607D8B;
    color: #ffffff;
  }

  &.wbcr-inp-type-css {
    background: #1572b6;
    color: #ffffff;
  }

  &.wbcr-inp-type-js {
    background: #f7df1e;
    color: #655b0e;
  }

  &.wbcr-inp-type-html {
    background: #e44d26;
    color: #fffffd;
  }

  &.wbcr-inp-type-advert {
    background: #d56700;
    color: #fffffd;
  }
}

.wbcr-inp-status-marker {
  display: inline-block;
  border-radius: 100%;
  width: 10px;
  height: 10px;
  margin-left: 5px;

  &.wbcr-inp-status-green {
    background: #8bc34a;
  }

  &.wbcr-inp-status-grey {
    background: #c0c0c0;
  }
}

.wbcr_inp_shortcode_input, .wbcr_inp_shortcode_input:focus {
  border: 1px solid #cbcbcb;
  background: #f6f6f6;
  box-shadow: none;
  outline: none;
  width: 100%;
  color: #555;
  font-size: 13px;
  padding: 5px;
  margin: 0;
  text-align: center;
}

.wbcr_inp_input_priority, .wbcr_inp_input_priority:focus {
  width: 50px;

  color: #555;
  font-size: 13px;
  margin: 0;
  padding: 0;
  text-align: center;
}

.wbcr_inp_input_priority.winp-loader {
  background: url('../img/loader.gif') no-repeat right center;
  background-size: 20px;
}

}

@media screen and (max-width: 1350px) {
  .wp-list-table {
    & th {
      &#description, &.column-description {
        width: 0;
        font-size: 0;
      }

      &#actions {
        width: 50px !important;
      }

      &#where_use {
        width: 100px !important;
      }

      &#taxonomy-wbcr-snippet-tags {
        width: 60px !important;
      }

      &#snippet_type {
        width: 50px !important;
      }
    }

    & td {
      &.column-description {
        width: 0;
        font-size: 0;
      }
    }
  }
}

// RTL support for snippet toggle switches
[dir="rtl"] .wp-list-table td {
  .winp-snippet-active-switch, .winp-snippet-inactive-switch {
    &:before {
      -webkit-transform: translateX(0);
      transform: translateX(0);
    }

    &:hover:before {
      -webkit-transform: translateX(-20%);
      transform: translateX(-20%);
    }
  }

  .winp-inactive.winp-snippet-active-switch {
    &:before {
      -webkit-transform: translateX(-100%);
      transform: translateX(-100%);
    }

    &:hover:before {
      -webkit-transform: translateX(-80%);
      transform: translateX(-80%);
    }
  }
}

