@import "inludes/datepicker";

body.dark-mode_page_dracula-analytics {
  #wpfooter {
    display: none;
  }
}

.dracula-analytics {

  * {
    box-sizing: border-box;
  }

  /**------------ Analytics Header ------------**/
  .analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 32px;
    background: #fff;
    margin: 0 0 30px -20px;
    padding: 15px;
    z-index: 1;
    border-bottom: 1px solid #eaeaea;

    .analytics-header-title {
      font-size: 18px;
      font-weight: 600;
      color: #333;
      display: flex;
      align-items: center;

      img {
        margin-right: 10px;
      }

    }

    &-desc {
      margin-left: 10px;
      font-size: 14px;
      font-weight: 400;
    }

    .analytics-range {
      display: flex;
      align-items: center;
      margin-left: auto;

      .date-field-wrap {
        position: relative;
        display: flex;
        margin-right: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        overflow: hidden;

        .date-field-prefix {
          display: inline-flex;
          align-items: center;
          font-size: .875rem;
          font-weight: 400;
          color: #7A7A7A;
          height: inherit;
          padding: 7px;
          margin: 0;

          span {
            margin-left: 5px;
          }
        }

        .date-field-suffix {
          display: inline-flex;
          align-items: center;
          vertical-align: middle;
          padding: 7px;
          height: inherit;
          margin: 0;
        }

      }

      input {
        height: 40px;
        border: none;
        border-radius: 0;
        max-width: 80px;
        padding: 0;
        color: #7A7A7A;

        &:focus {
          outline: none;
          box-shadow: none;
        }
      }

      & > button {
        height: 40px;
      }
    }

    .clear-analytics {
      margin-left: 10px;
      transform: rotate(90deg);
      cursor: pointer;

      &-tooltip {
        opacity: 1;
        padding: 15px;
        border-radius: 10px;
        margin-top: 30px;
        margin-left: 0;
        box-shadow: 0 0 10px rgba(0, 0, 0, .1);
        max-width: 200px;

        button {
          width: 100%;
        }

        .btn-info {
          margin-bottom: 10px;
        }

        &:after,
        &:before {
          top: 30px;
        }

      }
    }

    @media (max-width: 767px) {
      flex-direction: column;
      position: static;

      .analytics-header-title {
        margin-bottom: 10px;
      }

      .analytics-range {
        flex-wrap: wrap;
        justify-content: center;

        .date-field-wrap {
          width: 47%;
          margin-bottom: 10px;
          flex-wrap: wrap;
          padding: 5px 7px;

          &:nth-child(2) {
            margin-right: 0;
          }

          .date-field-prefix {
            width: 100%;
            margin: 0;
            padding: 0;
          }

          input {
            max-width: calc(100% - 44px);
            min-height: 30px;
            height: 30px;
          }

          .date-field-suffix {
            margin: 0;
          }

        }

      }
    }

  }

  .analytics-box {
    margin-bottom: 50px;
    margin-right: 20px;

    &-title {
      font-size: 18px;
      font-weight: 600;
      color: #333;
      margin-bottom: 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;

      i {
        margin-left: auto;
        cursor: pointer;
        border-radius: 50%;
        background: $dracula_color;
        color: #fff;
        padding: 5px;
        width: auto;
        height: auto;
      }
    }

    &-content {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 40px;

      .analytics-box-item {
        display: flex;
        align-items: center;
        font-size: 14px;
        font-weight: 600;
        transition: all .3s ease;
        border-radius: 15px;
        padding: 2rem 1rem;
        background: #fff;
        position: relative;
        width: calc(33.33% - 30px);

        &:before {
          content: "";
          position: absolute;
          top: 0;
          width: 90%;
          height: 5px;
          background: #f7b731;
          left: 5%;
        }

        &:last-child {
          margin-right: 0;
        }

        &:nth-child(2):before {
          background: $dracula_color_light;
        }

        &:nth-child(3):before {
          background: #3498db;
        }

        &-icon {
          margin-right: 15px;
          width: 60px;
          box-shadow: 0 0 3px rgba(0, 0, 0, .1);
          border-radius: 50%;
        }

        &-content {
          display: flex;
          flex-direction: column;
        }

        &-title {
          font-size: 1.2rem;
          font-weight: 400;
          color: #555;
          margin-top: 0;
          margin-bottom: 10px;
        }

        &-value {
          font-size: 2rem;
          font-weight: 700;
          color: #333;
          line-height: 1;
        }

        &-description {
          font-size: .875rem;
          font-weight: 400;
          color: #7a7a7a;
          margin-top: 7px;
          margin-bottom: 0;
        }


      }

      canvas {
        background: #fff;
        padding: 15px;
        border-radius: 15px;
        box-shadow: 0 0 3px rgba(0, 0, 0, .1);
      }

    }

    &.activation-deactivation {
      .analytics-box-item {
        width: calc(50% - 20px);

        &:first-child:before {
          background: $dracula_color_light;
        }

        &:nth-child(2):before {
          background: #f7b731;
        }

      }
    }

    .table-wrapper {
      max-height: 600px;
      width: 100%;
      overflow-y: auto;
      margin: 15px 0;
      border-radius: 15px;


      &::-webkit-scrollbar {
        width: 5px;
        height: 5px;
        border-radius: 10px;
      }

      &::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
        margin-top: 50px;
      }

      &::-webkit-scrollbar-thumb {
        background: rgba($dracula_color, .3);
        border-radius: 10px;
      }

      &::-webkit-scrollbar-thumb:hover {
        background: rgba($dracula_color, .5);
      }

      table {
        width: 100%;
        border-collapse: collapse;
        border-spacing: 0;
        font-size: 14px;
        color: #333;
        font-weight: 600;
        border: none;
      }

      thead {
        position: sticky;
        top: -1px;

        th {
          padding: 12px;
          font-weight: 600;
          border: none;
          background: $dracula_color;
          color: #fff;

          &:first-child {
            border-top-left-radius: 15px;
            border-bottom-left-radius: 15px;
          }

          &:last-child {
            border-top-right-radius: 15px;
            border-bottom-right-radius: 15px;
          }

          &:nth-child(1) {
            width: 62px;
          }
        }

      }

      tbody {
        &:before {
          content: "_";
          display: block;
          line-height: 1em;
          color: transparent;
        }

        tr {
          background: 0 0;

          td {
            padding: 10px;
            font-weight: 400;
            border-bottom: 1px dashed rgba($dracula_color, .2);
            vertical-align: middle;

            &.col-sl {
              padding-left: 20px;
            }

            &.col-description {
              width: 70%;
            }

          }
        }

      }

    }

    @media (max-width: 767px) {
      .analytics-box-item,
      &.activation-deactivation .analytics-box-item {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
      }
    }

  }

  /**---- Promo ----**/
  .dracula-pro-modal-wrap {
    position: absolute;
    width: calc(100% + 20px);
    margin-left: -20px;
    align-items: flex-start;
    padding-top: 100px;

    .dracula-pro-modal {
      align-self: flex-start;
      margin-top: 200px;
    }

  }

}