$primary-blue: rgb(0, 117, 255);
$primary-blue-60: rgba(0, 117, 255, 0.60);
$primary-blue-50: rgba(0, 117, 255, 0.50);
$primary-blue-20: rgba(0, 117, 255, 0.20);
$primary-blue-10: rgba(0, 117, 255, 0.10);
$primary-blue-7: rgba(0, 117, 255, 0.07);
$primary-blue-2: rgba(0, 117, 255, 0.02);
$primary-dark: rgb(16, 38, 64);
$primary-dark-50: rgba(16, 38, 64, 0.5);
$primary-dark-30: rgba(16, 38, 64, 0.3);
$primary-dark-15: rgba(16, 38, 64, 0.15);
$primary-dark-10: rgba(16, 38, 64, 0.10);
$primary-dark-5: rgba(16, 38, 64, 0.05);
$error-red: rgb(233, 31, 79);
$error-red-50: rgba(233, 31, 79, 0.5);
$error-red-10: rgba(233, 31, 79, 0.10);
$secondary-purple: rgb(108, 25, 173);
$alert-yellow-50: rgba(255, 238, 88, 0.50);
$alert-yellow: rgb(255, 238, 88);
$benchmark-orange: rgb(245, 129, 21);
$benchmark-orange-50: rgba(245, 129, 21, 0.50);
$benchmark-orange-25: rgba(245, 129, 21, 0.25);
$action-green: rgb(158, 206, 56);
$action-green-50: rgba(158, 206, 56, 0.5);
$box-shadow: 5px 5px 30px 0 rgba(24, 45, 70, 0.05);
$background-color: #F6F9FB;

body.gh_reporting {

  #wpcontent{
    padding: 0;
  }

  .wrap {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
  }

  .gh-header + h2.gh-nav {
    margin-left: 0 !important;
  }

  .number-total,
  .groundhogg-quick-stat-number, {
    font-family: "Helvetica Neue", Helvetica, Arial, Lucida Grande, sans-serif;
  }

  .gh-panel {
    .notice {
      margin: 10px;
      border-radius: 5px;
    }

    h2.title:has(.dashicons) {
      display: flex;
      align-items: center;
      gap: 3px;
    }
  }

  .display-grid {
    .gh-panel {
      position: relative;
    }
  }

  .wrap.blurred {
    filter: blur(3px);
  }

  .gh-loader-overlay {
    position: absolute;
    top: 0;
    right: 0;
    left: -20px;
    bottom: 0;
    background: #FFF;
    opacity: 0.5;
    z-index: 9999;
  }

  .gh-tooltip {
    max-width: 200px;
  }

  .gh-loader {
    top: 50vh;
    margin: 0 !important;
    left: 50%;
    font-size: 40px !important;
    position: absolute !important;
    z-index: 99999;
  }

  img {
    max-width: 100%;
  }

  #screen-meta-links {
    display: none;
  }

  .nav-tab-wrapper {
    margin-bottom: 20px !important;
  }

}

#groundhogg-datepicker-wrap {
  max-width: 450px;
  //float: right;
  //margin-top: 25px;
}

.big-chart-wrap {
  height: 400px;
  padding: 10px;
}

.groundhogg-report {
  border-radius: 5px;
  background: #FFF;
  border: 1px solid #ccd0d4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.groundhogg-report .inside {
  padding: 20px;
}

.groundhogg-quick-stats {
  margin-top: 20px;
}

.groundhogg-quick-stats .groundhogg-report {
  display: flex;
}

.groundhogg-quick-stats .groundhogg-quick-stat:first-child {
  border-left: none;
  border-radius: 5px 0 0 5px;
}

.groundhogg-quick-stats .groundhogg-quick-stat:last-child {
  border-radius: 0 5px 5px 0;
}

.groundhogg-quick-stats .groundhogg-quick-stat {
  width: 25%;
  position: relative;
  padding: 17px 20px 15px;
  border-left: 1px solid #ccd0d4;;
  background: #FFF;
}

.groundhogg-quick-stat .groundhogg-quick-stat-number {
  font-size: 40px;
  line-height: 1;
  //display: inline-block;
  //float: left;
  //margin-top: 10px;

  a {
    text-decoration: none;
    line-height: 1;
  }
}

.groundhogg-quick-stat .groundhogg-quick-stat-previous {
  /*margin: 10px 0 0 0;*/
  font-size: 16px;
  //float: right;
  text-align: right;
}

.groundhogg-quick-stat .groundhogg-quick-stat-previous.red {
  color: #d73638;
}

.groundhogg-quick-stat .groundhogg-quick-stat-previous.green {
  color: #5cc0a5;
}

.groundhogg-quick-stat .groundhogg-quick-stat-arrow:before {
  display: inline-block;
  content: '\279C';
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.groundhogg-quick-stat-arrow.up:before {
  transform: rotate(-90deg);
}

.groundhogg-quick-stat-arrow.down:before {
  transform: rotate(90deg);
}

.groundhogg-quick-stat .groundhogg-quick-stat-compare {
  //clear: right;
  //float: right;
  text-align: right;
  font-size: 12px;
  color: #acbdc9;
  display: inline-block;
}

.groundhogg-chart {
  width: 50%;
  position: relative;
  /*padding: 17px 20px 15px;*/
  /*border-left: 1px solid #ccd0d4;;*/
  background: #FFF;
  padding: 20px;
  border: 1px solid #ccd0d4;
  border-radius: 5px;
}

.groundhogg-chart-no-padding {
  width: 50%;
  position: relative;
  /*padding: 17px 20px 15px;*/
  /*border-left: 1px solid #ccd0d4;;*/
  background: #FFF;
  border: 1px solid #ccd0d4;
  border-radius: 5px;
  /*min-height: 200px;*/
}

.groundhogg-chart-no-padding.full-width {
  width: 100%;
  margin: 0 !important;
}

.groundhogg-chart-no-padding .notice {
  margin: 10px;
}

.groundhogg-chart:first-child, .groundhogg-chart-no-padding:first-child {
  margin-right: 15px;
}

.groundhogg-chart-no-padding div.inner {
  border-radius: 0 0 5px 5px;
}

.groundhogg-chart-wrapper {
  margin-bottom: 15px;
  margin-top: 15px;
  display: flex;
  border-radius: 5px;
}

.percentage-change.bad {
  color: #ff0000;
}

.percentage-change.good {
  color: #99cc00;
}

.gh-panel {

  #table_funnel_stats {
    td:first-child {
      a.step-title {
        font-size: 16px;
        font-weight: normal;
      }
    }
  }

  .table-scroll {
    overflow-x: auto;
  }

  table.groundhogg-report-table {

    tr {
      th, td {
        font-size: 14px;
        padding: 13px;

        &:not(:first-child) {
          //width: 80px;
          padding-left: 0;
        }

        &.great {
          background-color: #d3e6cb;
        }

        &.good {
          background-color: #eef7e3;
        }

        &.fair {
          background-color: #fef8e3;
        }

        &.poor {
          background-color: #ffe6dd;
        }

        &.bad {
          background-color: #F4CCCC;
        }

        .step-icon {
          position: absolute;
          width: 46px;
          top: 6px;
          left: 6px;

          &.benchmark {
            //border: 2px solid $benchmark-orange;
          }

          &.action {
            //border: 2px solid $action-green;
          }
        }
      }
    }
  }
}

/* NEW CSS FOR TABLE */
table.groundhogg-report-table tbody tr:nth-child(odd) {
  background-color: $primary-blue-2;
}

.groundhogg-table-box {
  width: 100%;
  margin: 0 auto;
}

table.groundhogg-report-table {

  table-layout: auto;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  overflow: hidden;
}

table.groundhogg-report-table a {
  text-decoration: none;
}

table.groundhogg-report-table th {
  line-height: 1.2;
  display: table-cell;
  padding: 15px;
  font-weight: 500;
  font-size: 15px;
  vertical-align: top;
}

table.groundhogg-report-table th,
table.groundhogg-report-table td {
  text-align: center;
}

table.groundhogg-report-table th:last-child,
table.groundhogg-report-table td:last-child {
  text-align: right;
}

table.groundhogg-report-table th:first-child,
table.groundhogg-report-table td:first-child {
  text-align: left;
}

table.groundhogg-report-table td {
  font-size: 15px;
  color: #666666;
  line-height: 1.2;
  /*font-weight: unset !important;*/
  //border-top: 1px solid #f2f2f2;
  display: table-cell;
  padding: 15px;
  text-decoration: none;
  /*word-break: break-word;*/
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 75px;
  white-space: nowrap;
}

table.groundhogg-report-table tr:last-child td {
  border-bottom: none;
}

table.groundhogg-report-table tr:last-child td:first-child {
  border-radius: 0 0 0 5px;
}

table.groundhogg-report-table tr:last-child td:last-child {
  border-radius: 0 0 5px 0;
}


#table_broadcast_stats table.groundhogg-report-table td:first-child,
#table_email_stats table.groundhogg-report-table td:first-child {
  width: 40px;
  font-weight: bold;
}

#table_broadcast_link_clicked table.groundhogg-report-table th:nth-child(2),
table.groundhogg-report-table th:last-child,
table.groundhogg-report-table td:last-child {
  width: 100px;
}

/* Sent, Opens, Clicks */
.emails-list table th:nth-child(4),
.emails-list table td:nth-child(4),
.emails-list table th:nth-child(3),
.emails-list table td:nth-child(3),
.emails-list table th:nth-child(2),
.emails-list table td:nth-child(2) {
  width: 70px;
}

/*table.groundhogg-report-table tr:last-child{*/
/*    border-radius: 0 0 5px 5px;*/
/*}*/

.chart-legend li span {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
}

.chart-legend {
  max-height: 250px;
  overflow: auto;
}

.chart-legend li {
  cursor: pointer;
}

.strike {
  text-decoration: line-through !important;
}

.float-left {
  float: left;
}

.notice-no-data {
  text-align: center;
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
}

#table_funnel_stats table td:first-child {
  position: relative;
  padding-left: 65px;
}

.donut-chart-left {
  width: 60%;
}

.donut-chart-right {
  width: 40%;
}

#leadscore-ad {
  width: 100%;
  filter: blur(3px);
  opacity: 0.3;
}

.gh-donut-chart-wrap {
  width: 100%;
  box-sizing: border-box;
}

.broadcast-type {
  font-size: 10px;
  font-weight: 600;
  margin-right: 10px;
  opacity: 0.7;
}

#groundhogg-datepicker {
  .dr-preset-list {
    left: 0;
  }

  .dr-selections {
    right: 0;
  }
}

#chart_funnel_breakdown{
  display: flex;
  padding: 0 25px;
  align-items: stretch;
  justify-content: space-evenly;

  --spacer-height: 20px;
  --stage-height: 60px;

  div.funnel-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;

    //.spacer {
    //  height: var(--spacer-height);
    //}

    div.funnel-stage-label{
      height: var(--stage-height);
      display: flex;
      align-items: center;
      font-size: 14px;

      a {
        color: $benchmark-orange;
      }
    }
  }

  div.funnel-stages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    //gap: 10px;
    //flex-grow: 1;
    font-family: "Helvetica Neue", Helvetica, Arial, Lucida Grande, sans-serif;
    width: 50%;

    .stage-percentage {
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: $primary-dark;
      color: #fff;
      height: var(--spacer-height);
      line-height: 0;
    }

    div.funnel-stage-layer {
      position: relative;
      height: var(--stage-height);
      background: $benchmark-orange-50;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      //clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);

      font-size: 22px;
      font-weight: bold;
      color: #000;

      a {
        color: #000;
      }

      &:hover {
        color: #fff;
        background-color: $benchmark-orange;

        a {
          color: #fff;
        }
      }
    }
  }
}

@media only screen and (max-width: 700px) {

  .groundhogg-chart-wrapper {
    display: inline-block;
    margin-bottom: 0px;
    margin-top: 0px;
    width: 100%;
  }

  .groundhogg-chart-no-padding {
    width: 100%;
    margin-top: 15px;
    position: relative;
    /* padding: 17px 20px 15px; */
    background: #FFF;
    border: 1px solid #d6e2ed;
    border-radius: 5px;
    min-height: 200px;
  }

  .groundhogg-chart {
    width: 100%;
    margin-top: 15px;
    position: relative;
    /*padding: 17px 20px 15px;*/
    background: #FFF;
    border: 1px solid #d6e2ed;
    border-radius: 5px;
    min-height: 250px;
    padding: 0px;
    float: left;
  }

  #groundhogg-datepicker-wrap {
    //width: 100%;
    //float: unset;
    //margin-top: 0px;
  }

  div:not(#table_broadcast_stats) {
    > table.groundhogg-report-table {

      tr {
        position: relative;
      }

      th:not(:first-child) {
        display: none;
      }

      td {
        display: block !important;
        position: relative;
        width: 100% !important;
        box-sizing: border-box;
        text-align: left !important;
      }

      td:not(:first-child) {

        padding-left: 60% !important;
        border-top: none !important;
        padding-top: 0 !important;
        font-size: 13px !important;

        &:before {
          position: absolute;
          left: 30px;
          display: block;
          overflow: hidden;
          width: 32%;
          content: attr(data-colname);
          white-space: nowrap;
          text-overflow: ellipsis;
          text-align: left;
        }
      }
    }

  }

  #edit-funnel {
    display: none;
  }
}
