@use "../../../abstracts/variables.scss" as *;
@use "../../../abstracts/mixins.scss" as *;

.throughput-wrapper,
.card {
  background-color: var(--background-color);
  box-shadow: var(--box-shadow-heavy);
  @include flex-center;
  flex-direction: column;
  gap: 6px;
  border-radius: 17.22px;
  max-width: 341px;

  padding: 14px;

  .header {
    @include flex-center;
    align-items: start;
    font-weight: $medium-weight;
    font-size: $large;
  }

  .display-value {
    @include flex-center;

    .left {
      @include flex-center;
      gap: 6px;

      .icon {
        width: 27px !important;
        height: 27px !important;
        background: var(--background-color);
        border-radius: 50%;
        @include flex-center;
      }

      .value-container {
        display: flex;
        flex-direction: column;

        .value-wrapper {
          display: flex;
          gap: 6px;

          .value {
            font-size: $small;
            color: var(--accent-color);
            font-weight: $bold-weight;
          }
        }

        .total-sales {
          display: flex;
          gap: 6px;
        }
      }
    }

    .right {
      .percent-increase {
        width: 80px;
        height: 24px;
        border-radius: 7.75px;
        background: var(--background-color);
        color: #34c759;
        @include flex-center;
      }
    }
  }

  .footer {
    text-align: center;
  }
}

.returnOfInvestment {
  gap: 10px;
  min-width: 150px;

  .charts {
    width: 100%;
    height: 200px;
    min-width: 150px;
  }

  .returns-wrapper {
    display: flex;
    gap: 4px;
    align-items: center;

    .value {
      font-size: var(--font-size-xxxlarge);
      color: var(--accent-color);
    }
  }

  .footer {
    text-align: start;

    span {
      font-weight: $bold-weight;
    }
  }
}

.productionCapacity-wrapper {
  background-color: var(--background-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 313px;
  padding: 4.5px;
  border-radius: 9.74px;

  .headeproductionCapacityr-wrapper,
  .bar-chart {
    padding: 14px;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 5.2px;

    width: 100%;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;

    .header {
      font-size: $small;
      text-align: start;
      justify-content: start;
    }

    .production-capacity {
      display: flex;
      gap: 6px;

      .current,
      .target {
        display: flex;
        gap: 6px;
        align-items: center;

        .key,
        .value {
          font-size: $tiny;
        }
      }

      .current {
        .value {
          background: var(--background-color-secondary);
          color: #5783f2;
          border-radius: 12.99px;
          padding: 3px 4px;
        }
      }

      .target {
        .value {
          background: var(--background-color-secondary);
          color: #9641a7;
          border-radius: 12.99px;
          padding: 3px 4px;
        }
      }
    }
  }

  .bar-chart {
    padding: 14px 0;
  }
}

.stateWorking-wrapper {
  min-width: 445px;
  font-size: var(--font-size-small);
  backdrop-filter: blur(40px);
  background: var(--background-color-secondary);
  border-radius: 20px;
  color: var(--text-color);
  background: #252525cc;

  .header-wrapper {
    width: 100%;
    display: flex;
    justify-content: space-between;

    .header {
      display: flex;
      flex-direction: column;

      span {
        font-size: var(--font-size-xxlarge);

        &:first-child {
          color: #fcfdfd;
        }

        &:last-child {
          color: #34c759;
        }
      }
    }

    .img {
      border-radius: 4px;

      img {
        border-radius: 4px;
      }
    }
  }

  .data-wrapper {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;

    .data-table {
      display: flex;
      justify-content: space-between;
      padding: 5px;
      border-bottom: 1px dotted #ccc;

      .data {
        color: #fcfdfd;
        font-weight: bold;
      }

      .key {
        color: #fcfdfd;
        text-align: right;
      }
    }
  }
}

.total-card {
  min-height: 83px !important;
  background: var(--background-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px !important;

  .header-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;

    .header {
      color: #a0aec0;
    }

    .data-values {
      display: flex;
      align-items: center;
      gap: 6px;

      .value {
        color: var(--text-color);
      }

      .per {
        color: #01b574;
      }
    }
  }

  .icon {
    width: 45px;
    height: 45px;
    background-color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
  }
}

.warehouseThroughput {
  min-height: 250px !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--background-color);
  padding: 14px;

  .header {
    p {
      span {
        color: var(--accent-color);
      }
    }

    h2 {
      color: var(--text-color);
    }
  }
}

.productivity-dashboard {
  width: 100%;
  background-color: var(--background-color);
  color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

  header {
    @include flex-space-between;
    margin-bottom: 20px;

    h2 {
      font-size: $regular;
      margin: 0;
      font-weight: 600;
    }

    .options {
      background-color: #343b47;
      width: 30px;
      height: 30px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 4px;
      cursor: pointer;

      &:hover {
        background-color: #49505a;
      }
    }
  }

  main {
    display: flex;
    gap: 20px;

    .metrics {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 10px;

      .metric {
        background-color: #2c3e50;
        padding: 15px;
        border-radius: 4px;

        .label {
          font-size: var(--font-size-regular);
          margin: 0;
          opacity: 0.7;
        }

        .value {
          font-size: var(--font-size-xlarge);
          font-weight: bold;
          margin: 0;
        }
      }
    }

    .chart-section {
      position: relative;
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;

      .progress-circle {
        transform: rotate(-90deg);
        /* Adjust rotation for SVG */
        width: 150px;
        height: 150px;

        circle {
          transition: stroke-dashoffset 0.5s ease-in-out; // Smooth animation
        }
      }

      .chart-details {
        position: absolute;
        text-align: center;

        .title {
          font-size: var(--font-size-large);
          margin: 0;
          opacity: 0.7;
        }

        .time {
          font-size: var(--font-size-xxxlarge);
          font-weight: bold;
          margin: 0;
        }

        .subtitle {
          font-size: var(--font-size-regular);
          margin: 0;
          opacity: 0.7;
        }
      }
    }
  }
}

/* FleetEfficiency.module.css */
.fleetEfficiency {
  width: 100%;
  min-height: 240px !important;
  padding: 20px;
  background: var(--background-color);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
  width: 240px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;

  .progressContainer {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: auto !important;

    .progress {
      width: 100%;
      height: 100%;

      .barOverflow {
        width: 100%;
      }
    }
  }
}

.scaleLabels {
  background-color: var(--background-color);
  box-shadow: var(--box-shadow-heavy);
  display: flex;
  justify-content: space-between;
  color: #718096;
  font-size: var(--font-size-small);
  padding: 18px 10px;
  position: relative;
  z-index: 1;
  top: -32px;
}

.barOverflow {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100px;
  margin-bottom: -14px;
}

.bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 25px solid #eee;
  border-bottom-color: var(--accent-color);
  border-right-color: var(--accent-color);
  transition: transform 0.5s ease;
}

// progress should be progress {progress}
