@use 'variables';

$turnover-amount-size: 96px;

// TURNOVER

.turnover-container {
  position: relative;
  background-color: variables.$secondary-background-color;
  width: min-content;
  border-radius: variables.$border-radius;

  &.parent-width {
    width: 100%;
  }

  @media screen and (max-width: 768px) {
    width: 100%;
  }
}

.turnover-title {
  width: 100%;
  font-size: 16px;
  text-align: center;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
}

.turnover-percent {
  font-size: calc(#{$turnover-amount-size} / 3);
  position: absolute;
  top: 0;
  right: 12px;

  @media screen and (max-width: 768px) {
    font-size: calc(#{$turnover-amount-size} / 3.8);
  }
}

.turnover-percent--positive {
  color: variables.$green-positive;
}

.turnover-percent--negative {
  color: variables.$red-negative;
}

.turnover-percent--neutral {
  color: darken($color: variables.$text-color, $amount: 20%);
}

.turnover-amount {
  width: 100%;
  font-size: $turnover-amount-size;
  text-align: center;
  padding: calc(#{$turnover-amount-size} / 2) $turnover-amount-size;

  @media screen and (max-width: 768px) {
    font-size: calc(#{$turnover-amount-size} / 1.8);
    padding: calc(#{$turnover-amount-size} / 3.6)
      calc(#{$turnover-amount-size} / 1.8);
  }
}

// CHART

.card-chart {
  overflow: hidden;
  .card-header {
    .card-title {
      i {
        font-size: 16px;
        margin-right: 5px;
        margin-bottom: 3px;
      }
    }
    .card-category {
      margin-bottom: 5px;
    }
  }
  .card-body {
    padding-left: 5px;
    padding-right: 5px;
    .tab-space {
      padding: 0;
    }
  }
  .table {
    margin-bottom: 0;

    td {
      border-top: none;
      border-bottom: 1px solid rgba(#fff, 0.1);
    }
  }

  .card-progress {
    margin-top: 30px;
    padding: 0 10px;
  }

  .chart-area {
    height: 220px;
    width: 100%;
  }
  .card-footer {
    margin-top: 15px;

    .stats {
      color: gray;
    }
  }

  .dropdown {
    position: absolute;
    right: 20px;
    top: 20px;

    .btn {
      margin: 0;
    }
  }

  &.card-chart-pie {
    .chart-area {
      padding: 10px 0 25px;
      height: auto;
    }

    .card-title {
      margin-bottom: 10px;
      i {
        font-size: 1rem;
      }
    }
  }
}

// DATA CARD

// align items top?
@mixin flexrow {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.card.data-card {
  background-color: variables.$secondary-background-color;
  border-radius: calc(variables.$border-radius * 2);
  // padding: 0.5em;
  padding: 32px 40px;

  .card-header {
    @include flexrow;
    justify-content: space-between;
    padding: 0;

    background-color: variables.$secondary-background-color;
    border-bottom: none;

    .card-title {
      margin: 0;
      // margin-top: 0.5em;
      margin-top: 16px;
      font-weight: 300;
    }

    .card-subtitle {
      color: variables.$text-muted-color;
    }

    .legend {
      .legend-item {
        @include flexrow;
        font-size: 12px;

        .fa-circle {
          font-size: 6px;
          margin-right: 6px;
        }
      }
    }
  }

  .card-body {
    padding: 0;
    padding-top: 16px;
  }
}

// DATA TABLE
.table-responsive {
  border-radius: calc(variables.$border-radius * 2);
  padding-top: 16px;
  padding-bottom: 16px;
}

table,
.table {
  color: variables.$text-color;
  // padding: 32px 64px;

  thead {
    th {
      color: variables.$text-muted-color;
      // border-bottom: 1px solid
      //   lighten(variables.$secondary-background-color, 5%);
      border-bottom: variables.$secondary-background-color;
    }
  }

  td,
  th {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  th {
    font-weight: 500;
  }

  tbody tr {
    // border-bottom: 1px solid lighten(variables.$secondary-background-color, 5%);
    border-bottom: variables.$secondary-background-color;
    font-weight: 500;

    // &:hover {
    //   background-color: variables.$hover-background-color;
    // }

    &:nth-child(odd) {
      background-color: variables.$tertiary-background-color;
    }
  }

  td,
  th[scope='row'] {
    white-space: nowrap;
  }
}

.ch-datatable {
  th:first-child {
    padding-left: 48px;
  }

  th.img-active {
    padding-top: 16px;
    padding-bottom: 16px;

    img,
    .img-placeholder {
      width: 41px;
      height: 41px;
    }
  }

  td:last-child,
  thead th:last-child {
    padding-right: 48px;
  }

  .link-clicks input {
    width: 100px;
  }
}

// PROJECTS
.brief > p {
  margin-bottom: 0;
}

.brief * {
  font-size: inherit;
  margin-bottom: 0;
}

// @include media-breakpoint-down(sm) {
//   .card.card-chart {
//     .card-header .btn-group-toggle {
//       .tim-icons {
//         font-size: $font-size-base;
//         top: -1px;
//       }
//     }
//   }
// }
