#wp_statistics_editor_meta_box,
#wp-statistics-summary-widget,
#wp-statistics-words-widget,
#wps_hits_postbox,
#wps_top_visitors_postbox,
#wps_search_postbox,
#wps_words_postbox,
#wps_recent_postbox,
#wps_map_postbox,
#wps_pages_postbox,
#wps_summary_postbox,
#wps_browsers_postbox,
#wps_referring_postbox,
#wps_countries_postbox,
#wps_pages_postbox,
.wps-wrap {
  .o-table {
    width: 100%;
    border-collapse: collapse;

    thead {

      tr th {
        padding: 8px 0 12px 40px;
        font-weight: 400;
        font-size: 13px;
        line-height: 16px;
        border-bottom: 1px solid $light-secondary-color;
        color: $low-color;
        text-align: left;

        .rtl & {
          text-align: right;
        }

        &:first-child {
          padding-left: 16px;

          @media screen and (min-width: 1300px) {
            padding-left: 24px;
          }
        }


        &:last-child {
          padding-right: 16px;

          @media screen and (min-width: 768px) {
            padding-right: 24px;
          }
        }
      }

      tr td.row-id {
        color: $low-color !important;
      }
    }

    tr {
      .o-table__td--sm-width {
        max-width: 40px;
        width: 25px;
        min-width: 40px;

        + .o-table__link {
          padding-left: 20px !important;
        }
      }
    }

    tr:first-child td {
      text-align: left;

      .rtl & {
        text-align: right;
      }
    }

    tr td {
      min-width: 60px;

      .wps-flag {
        margin-right: 4px;
        margin-bottom: 2px;
        vertical-align: middle;
      }

      .wps-flag--first {
        float: unset !important;
      }

      &:first-child {
        min-width: unset;
      }

      span.truncate {
        max-width: 147px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: inherit;
        display: inline-block;

        &:hover {
          color: inherit;
        }
      }

      span.disabled {
        color: #999;
      }

      a {
        color: $primary-color !important;
        display: inline-block;

        &:hover {
          color: $dark-color !important;
        }
      }

      a.is-normal-text {
        color: $dim-black-color !important;
      }

      a.button {
        border-radius: 4px;
        font-weight: 500 !important;
        padding: 7px 10px;
        background-color: #fafafb !important;
        line-height: 0;
        text-align: center;
        font-size: 11px;

        span {
          font-size: inherit;
          color: inherit;
        }

        .hover-effect {
          min-width: 70px;
        }

        .hover-effect--show {
          display: none !important;
        }

        &:hover {
          .hover-effect--show {
            display: inline-block !important;
          }

          .hover-effect--hide {
            display: none !important;
          }
        }

        svg {
          vertical-align: middle;
        }
      }
    }

    a.button.disabled {
      margin: 0 !important;

      &:hover {
        color: #A7AAAD !important;
      }

      span:hover {
        color: #A7AAAD !important;
      }
    }

    tbody {
      tr th {
        padding: 14px 0 14px 40px;
        font-weight: 500;
        font-size: 14px;
        line-height: 16px;
        color: $low-color;
        text-align: left;


        &:last-child {
          padding-right: 24px;
        }
      }

      tr td {
        padding: 14px 0 14px 40px;
        font-weight: 400;
        font-size: 13px;
        color: $dim-black-color;
        border: none;

        &:first-child {
          padding-left: 16px;

          @media screen and (min-width: 1300px) {
            padding-left: 24px;
          }
        }

        a.table-icon-btn, a.table-icon-btn .dashicons {
          font-size: 16px !important;
        }

        a.table-icon-btn {
          margin: 0 4px;
        }

        &:last-child {
          padding-right: 24px;
        }

        a, a span {
          font-weight: 400;
          font-size: 13px;
          color: $dim-black-color;

          &:hover {
            color: $primary-color;
          }
        }

        .table-cell-scroller {
          //max-width: 100%;
          //overflow-x: auto;
          //white-space: nowrap;
          //scroll-behavior: smooth;
          //scrollbar-width: thin;
          //scrollbar-color: #DADCE0 $light-tertiary-color;
          //
          ///* width */
          //::-webkit-scrollbar {
          //  width: 4px;
          //  border-radius: 2px;
          //}
          //
          ///* Track */
          //::-webkit-scrollbar-track {
          //  background: $light-tertiary-color;
          //}
          //
          ///* Handle */
          //::-webkit-scrollbar-thumb {
          //  background: #DADCE0;
          //}
        }
      }

      tr:nth-child(even) {
        th, td {
          background-color: $light-tertiary-color;
        }
      }

      tr td.row-id {
        color: $low-color !important;
      }
    }
  }

  .o-table--link {
    tbody tr td {
      img {
        margin-right: 8px;
      }

      a {
        color: $primary-color;
        transition: 0.22s;
        display: inline-flex;
        align-items: center;

        span, svg {
          max-height: 17px;
          color: $primary-color;
          transition: 0.22s;
        }

        svg {
          margin-left: 2px;
        }

        &:hover {
          color: $dark-color;

          span {
            color: $dark-color;
          }

          svg {
            transform: translateX(3px);
            filter: grayscale(1) brightness(0.9);
          }
        }
      }
    }
  }

  table {
    svg {
      transition: 0.22s;
    }
  }

  .o-table--space-between {
    tr td, tr, th {

      &:first-child {
        text-align: left;
      }

      &:last-child {
        text-align: left;
      }
    }
  }

  .o-table-wrapper {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #DADCE0 $light-tertiary-color;

    table {
      position: relative;
    }

    /* width */
    &::-webkit-scrollbar {
      width: 4px !important;
      border-radius: 2px !important;
    }

    /* Track */
    &::-webkit-scrollbar-track {
      width: 4px !important;
      background: $light-tertiary-color !important;
    }

    /* Handle */
    &::-webkit-scrollbar-thumb {
      border: 5px solid transparent;
      border-radius: 100px;
      background-color: #DADCE0;
      background-clip: content-box;
    }

    .quickstats-values {
      font-weight: 500;
      font-size: 13px;
      color: #404BF2;
    }
  }

  .o-table--visitors {

    thead {
      tr th {
        text-align: left;
        max-width: max-content;
        padding-left: 40px;

        &:first-child {
          text-align: left;
        }

        &:last-child {
          text-align: left;
        }
      }
    }

    tbody {
      tr td {
        text-align: left;
        max-width: max-content;
        padding-left: 40px;

        &:first-child {
          padding-right: 10px;
        }

        &:nth-child(2) {

        }

        a {
          display: inline-flex;
          align-items: center;
        }

        a img {
          float: unset;
          margin: 0 4px 0 0;
        }

        .wps-flag {
          margin-right: 4px;
          vertical-align: middle;
        }

        a {
        }

        &:last-child {
          text-align: left;
        }
      }

      .o-table__browser {
        &::after {
          content: attr(title);
          display: inline-block;
          margin-left: 2px;
        }
      }
    }

    .o-table__link a {
      color: $primary-color;
      padding-right: 0;

      &:hover {
        color: $dark-color;
      }
    }
  }

  .o-table.o-table--responsive {

    tr:first-child td {
      text-align: left;
    }

    tr td {
      min-width: 60px;

      .wps-flag {
        margin-right: 4px;
      }

      &:first-child {
        min-width: unset;
      }
    }
  }

  .o-table--tracker {
    tbody {
      tr {
        td {
          a {
            display: inline !important;

            &.button {
              color: #0C0C0D;
              font-size: 12px;
              font-weight: 400;
              line-height: 20px;
              border: 1px solid #EEEFF1;

              &:hover {
                font-weight: 500;
                border: 1px solid #DADCE0;
                background: #FAFAFB;
              }

              &.disabled, &.disabled:focus {
                border: 1px solid #DADCE0;
                background: #EEEFF1;

                span, span:hover {
                  color: #56585A !important;
                }

              }
            }
          }

          &.head {
            white-space: nowrap;

            .wps-tooltip {
              margin-left: 2px;
            }
          }

          &.o-table__cell--right {
            text-align: right;
          }

          ul {
            display: flex;
            margin: 0;
            gap: 5px;
            justify-content: flex-end;
            align-items: center;

            li {
              margin-bottom: 0;
            }
          }

        }
      }
    }
  }
}

#dashboard-widgets-wrap {

  .wps-new-table {
    position: relative;
    border-collapse: collapse;

    tr {
      th {
        &.wps-pd-l {
          font-weight: 400;
          font-size: 13px;
          line-height: 16px;
          border-bottom: 1px solid #eeeff1;
          text-align: left;
          padding: 8px 0 12px 40px;

          .rtl & {
            text-align: right;
            padding: 8px 40px 12px 0;
          }
        }
      }

      td {
        padding: 14px 0 14px 40px;
        font-weight: 400;
        font-size: 13px;
        color: #0c0c0d;
        border: none;

        .rtl & {
          padding: 14px 40px 14px 0;
        }

      }

    }

    tbody {
      tr:nth-child(even) td {
        background-color: #fafafb;
      }
    }
  }

  #wp-statistics-quickstats-widget, #wp-statistics-hits-widget, #wp-statistics-search-widget, #wp-statistics-countries-widget, #wp-statistics-pages-widget,
  #wp-statistics-browsers-widget, #wp-statistics-platforms-widget, #wp-statistics-models-widget, #wp-statistics-devices-widget, #wp-statistics-source-categories-widget,
  #wp-statistics-referring-widget, #wp-statistics-top-visitors-widget, #wp-statistics-recent-widget, #wp-statistics-useronline-widget, #wp-statistics-hitsmap-widget {

    .handle-order-lower, .handle-order-higher {
      display: none;
    }

    .c-footer {
      padding: 20px 12px 0;
    }

    &.postbox .inside {
      padding-right: 0;
      padding-left: 0;
      margin-bottom: 12px;
      padding-bottom: 0;

      a {
        text-decoration: none;
      }

      td, th {
        white-space: nowrap;
      }
    }

    .o-wrap {
      padding: 0 12px;
    }

    .o-table-wrapper {
      overflow-x: auto;
      scroll-behavior: smooth;
      scrollbar-width: thin;
      scrollbar-color: #dadce0 #fafafb;
    }
  }

  #wp-statistics-browsers-widget, #wp-statistics-platforms-widget, #wp-statistics-models-widget, #wp-statistics-devices-widget, #wp-statistics-source-categories-widget {
    &.postbox .inside {
      margin-top: 20px;
    }
  }

  #wp-statistics-countries-widget, #wp-statistics-referring-widget, #wp-statistics-pages-widget, #wp-statistics-top-visitors-widget, #wp-statistics-recent-widget, #wp-statistics-useronline-widget {
    th:last-child, td:last-child {
      text-align: right !important;
      padding-right: 24px;
      white-space: nowrap;

      .rtl & {
        text-align: left !important;
        padding-left: 24px;
      }
    }
  }

  #wp-statistics-countries-widget, #wp-statistics-referring-widget {
    tbody {
      tr {
        td {
          &.wps-middle-vertical a {
            color: #404bf2 !important;
            font-weight: 500;
            text-decoration: none;
          }

          .wps-country-flag .wps-ellipsis-text {
            max-width: 250px;
          }
        }
      }
    }

  }

  #wp-statistics-quickstats-widget {

    .inside {
      margin-bottom: 12px !important;
    }

    .wp-quickstats-widget__enable-email{
      margin: 0;
      width: 100%;
    }

    .c-live__status {
      margin-right: 13px !important;
      .rtl &{
        margin-right: 12 !important;
       }
    }

    .handle-actions.hide-if-no-js {
      display: flex;
      align-items: center;

      .wps-refresh {
        top: 0;
      }
    }

    .wps-overview-btn {
      background: #2271B1;
      padding: 4px 12px;
      border-radius: 4px;
      color: #FFFFFF;
      font-size: 13px;
      font-weight: 600;
      line-height: 22px;
      text-decoration: none;
      margin: 8px 12px;

      &:hover {
        background-color: #1e27bf;
      }
    }

    .wps-postbox-chart--data .wps-postbox-chart--item {

      width:50%;

      & > span {
        font-size: 12px;
        font-weight: 500;
        line-height: 15;
        color: #444F5C;
        text-transform: uppercase
      }
    }

    .wps-postbox-chart--data {
      .wps-postbox-chart--items:first-child {
        display: none;
      }


      .wps-postbox-chart--items {
        .wps-postbox-chart--item {

          & > span {
            display: flex;
            gap: 6px;
            align-items: center;
            font-style: normal;
            line-height: unset
          }

          .wps-postbox-chart--item--color {
            width: 8px;
            min-width: 8px;
            height: 8px;
            display: inline-block;
            border-radius: 8px;
          }

          & > div span:first-child {
            line-height: 21px;
            font-size: 18px;
            font-weight: 400;
          }

          &:first-child {
            .wps-postbox-chart--item--color {
              background: #3288D7;
            }
          }

          &:nth-child(2) {
            .wps-postbox-chart--item--color {
              background: #7362BF;
            }
          }

          &__active {
            cursor: default;
          }
        }
      }
    }



    .o-wrap {
      border: 1px solid #EEEFF1;
      border-radius: 8px;
      padding: 12px
    }

    .o-table-wrapper {
      border: 1px solid #EEEFF1;
      border-radius: 8px;

      tr th{
        background: #FAFAFB;
        border-bottom: 1px solid #EEEFF1;
        color: #56585A!important;
      }
    }
  }

  #wp-statistics-hits-widget, #wp-statistics-search-widget, #wp-statistics-hitsmap-widget {
    .o-wrap {
      padding: 12px 24px !important;
      padding-top: 0 !important;

      .wps-postbox-chart--data {
        margin-top: 0 !important;
        @media (max-width: 550px) {
          gap: 0 !important;
        }
      }
    }
  }
}

.wps-wrap, #dashboard-widgets-wrap {
  #wp-statistics-pages-widget {
    &.postbox .inside {
      padding-right: 0;
      padding-left: 0;
    }
  }

  .c-footer {
    .c-footer__more__link {
      color: #56585a;
      font-size: 12px;
      font-weight: 400;
      display: flex;
      align-items: center;
      gap: 2px;
      text-decoration: none;

      svg {
        margin: 0 !important;
      }

      &:hover {
        color: #000;

        svg {
          filter: contrast(1.5);
        }
      }
    }

    .c-footer__filter.is-active .c-footer__filter__btn::after {
      transform: rotate(180deg);
    }

    .c-footer__filter__btn {
      color: #56585a;
      font-size: 12px;
      font-weight: 400;
      display: flex;
      align-items: center;
      gap: 2px;
      padding: 0;

      &:after {
        content: "";
        width: 16px;
        height: 16px;
        background: url(data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjE3IiBoZWlnaHQ9IjE3IiB2aWV3Qm94PSIwIDAgMTcgMTciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik04LjMzMzIyIDEwLjYxMTFMMTEuNDQ0NCA3LjVMMTIuMzMzMyA4LjM4ODg5TDguMzMzMjIgMTIuMzg4OUw0LjMzMzI1IDguMzg4ODlMNS4yMjIxNCA3LjVMOC4zMzMyMiAxMC42MTExWiIgZmlsbD0iIzU2NTg1QSIvPgo8L3N2Zz4K) center center no-repeat;
        transform: rotate(0deg);
      }

      &:hover {
        color: #000;

        &:after {
          filter: contrast(1.5);
        }
      }
    }
  }
}

#wp-statistics-summary-widget {
  table.o-table {

    thead tr, tbody tr {
      td, th {
        &:first-child {
          padding-left: 16px !important;

          .rtl & {
            padding-left: 0px !important;
            padding-right: 16px !important;
          }

          @media screen and (min-width: 1450px) {
            padding-left: 24px !important;
            .rtl & {
              padding-left: 0px !important;
              padding-right: 24px !important;
            }
          }
        }

        &:last-child {
          padding-right: 8px !important;

          .rtl & {
            padding-left: 8px !important;
            padding-right: 0px !important;
          }

          @media screen and (min-width: 1450px) {
            padding-right: 24px !important;
            .rtl & {
              padding-left: 24px !important;
              padding-right: 0px !important;
            }
          }
        }
      }

      th {
        padding: 11.1px 0 12px 22px !important;

        @media screen and (min-width: 1450px) {
          padding: 11.1px 0 12px 40px !important;
        }
      }

      td {
        padding: 11.1px 0 11.1px 22px !important;

        @media screen and (min-width: 1450px) {
          padding: 11.1px 0 11.1px 40px !important;
        }
      }
    }
  }
}


#normal-sortables {
  .o-table.o-table--layout-fixed {
    @media screen and (min-width: 1200px) {
      table-layout: fixed !important;
    }
  }
}


#dashboard-widgets {
  #normal-sortables {
    .o-table.o-table--layout-fixed {
      @media screen and (min-width: 1200px) {
        table-layout: initial !important;
      }
    }
  }
}

.rtl {
  #wp_statistics_editor_meta_box,
  #wp-statistics-hitsmap-widget,
  #wp-statistics-summary-widget,
  #wp-statistics-words-widget,
  #wps_hits_postbox,
  #wps_top_visitors_postbox,
  #wps_search_postbox,
  #wps_words_postbox,
  #wps_recent_postbox,
  #wps_map_postbox,
  #wps_pages_postbox,
  #wps_summary_postbox,
  #wps_browsers_postbox,
  #wps_referring_postbox,
  #wps_countries_postbox,
  #wps_pages_postbox,
  .wps-wrap {
    .o-table {

      thead {

        tr th {
          padding: 8px 40px 8px 0;
          text-align: right;
        }
      }

      tr:first-child td {
        text-align: right;
      }
    }

    .o-table--link {
      tbody tr td {
        img {
          margin-left: 8px;
          margin-right: 0;
        }
      }
    }
  }
}

#dashboard-widgets {
  #wp-statistics-quickstats-widget {
    .inside {
      padding: 16px !important;
      margin: 0 !important
    }

    .c-live {
      border: 1px solid #EEEFF1;
      background: #1961400A;
      border-radius: 8px;
      padding: 12px;

      .c-live__online--value {
        color: #17593B;
        font-weight: 400;
        font-style: Regular;
        font-size: 23px;
      }

      .c-live__status::before {
        background: #17593B;
        left: 4.5px;
        border-radius: 100%
      }

      .c-live__status::after {
        left: 4.5px
      }

      .c-live__title {
        font-weight: 500;
        font-size: 14px;
        line-height: 16px
      }
    }

    .o-wrap {
      padding: 12px;
      .wps-postbox-chart--title {
        display: flex;
        justify-content: space-between;
        width: 100%;
        gap: 16px;
        color: #1E1E20;
        font-weight: 500;
        font-size: 12px;
      }

      .wps-postbox-chart--info {
        margin-bottom: 0
      }

      .wps-postbox-chart--data {
        padding-right: 12px;
        padding-left: 12px;
        gap: 16px;
        border: 1px solid #EEEFF1;
        border-radius: 8px;
        margin: 16px 0;
      }

      .wps-postbox-chart--items {
        margin-bottom: 0 !important;

        .wps-postbox-chart--item__data {
          justify-content: space-between;
          width: 100%;
          gap: 16px;

          .wps-postbox-chart--item{
            padding-top:12px;
            padding-bottom:12px;
            &:first-child{
              border-right: 1px solid #EEEFF1;

              .rtl &{
                border-right: none;
                border-left: 1px solid #EEEFF1;
              }
            }
          }
        }
      }
    }

    thead tr{
      th:last-child{
        text-align:right;
        padding-right: 12px !important;

        .rtl &{
          text-align:left;
          padding-left: 12px !important;
        }
      }
    }

    tbody {
       tr {
        td {
          &:nth-child(2), &:nth-child(3) {
            a span {
              color: #0C0C0D !important
            }
          }

          &:nth-child(3) div{
            justify-content: flex-end;
          }
        }
      }
    }

    .wps-skeleton-container {
      padding: 0 !important
    }

    .c-footer {
      display: none
    }

    .wps-meta-traffic-summary {
      gap: 16px
    }

    .wps-postbox-chart--item > div {
      cursor: default;
    }

    .wps-postbox-chart--item__data {
      .wps-postbox-chart--item > div {
        .current-data span:first-child {
          cursor: pointer;
        }
      }
    }

    .wps-postbox-chart--items {
      justify-content: space-between;
      width: 100%;

      .wps-postbox-chart--item__data {
        display: flex;
        gap: 32px;
        align-items: center;
      }
    }
  }
}