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

.resourceManagement-container {
  .navigation-wrapper {
    @include flex-space-between;
    justify-content: space-around;

    .navigation {
      padding: 4px 12px;
      border-radius: 20px;
      text-wrap: nowrap;
      margin: 6px 0;
      cursor: pointer;

      &.active {
        background: var(--background-color-button);
      }
    }
  }

  .search-container {
    position: relative;
    padding: 4px 2px;

    .search-wrapper {
      padding: 0;

      input {
        padding-right: 85px;
      }
    }

    .select-catagory {
      position: absolute;
      top: 50%;
      right: 8px;
      transform: translate(0, -50%);
      z-index: 10;

      .regularDropdown-container {
        padding: 2px 8px;
      }
    }
  }

  .category-wrapper {
    display: flex;
    gap: 12px;
    width: 100%;
    overflow: auto;
    padding: 8px 10px;

    .category {
      text-wrap: nowrap;
      position: relative;
      cursor: pointer;
      color: var(--text-disabled);

      &.active {
        color: var(--text-color);

        &::after {
          content: "";
          position: absolute;
          bottom: -6px;
          left: 0;
          width: 100%;
          height: 2px;
          border-radius: 100px;
          background: var(--background-color-button);
        }
      }
    }
  }

  .assetManagement-wrapper {
    max-height: calc(62vh - 12px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 7px;
    // padding: 7px 2px;
  }

  // HRM
  .hrm-container {
    .analysis-wrapper {
      border-radius: 20px;
      padding: 16px;

      display: flex;
      flex-direction: column;
      gap: 14px;

      outline: 1px solid var(--border-color);
      outline-offset: -1px;
      background: var(--background-color);

      &.active {
        outline: 1px solid var(--Color-Hover, #ccacff);
      }

      header {
        position: relative;
        @include flex-space-between;
        padding: 3px 0;

        .user-details {
          display: flex;
          gap: 6px;

          .user-image-wrapper {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: #fff;
            position: relative;

            .status {
              border-radius: 50%;
              width: 6px;
              height: 6px;
              outline: 1px solid #2f2c32;

              position: absolute;
              bottom: 0;
              right: 0;

              &.Active {
                background-color: #44e5c6;
              }
            }
          }

          .details {
            max-width: 144px;
            .employee-id {
              color: #b7b7c6;
              font-size: $tiny;
            }
          }
        }

        .see-more {
          padding: 4px 12px;
          border-radius: 20px;
          text-wrap: nowrap;
          margin: 6px 0;
          cursor: pointer;
          background: var(--background-color-button);
        }

        &::after {
          content: "";
          position: absolute;
          bottom: -7px;
          left: 0;
          width: 100%;
          height: 1px;
          background-color: #6f6f7a;
        }
      }

      .content {
        display: flex;
        flex-direction: column;
        gap: 4px;

        .task-info {
          padding: 8px 0;
          display: flex;
          flex-direction: column;
          gap: 6px;

          .task-wrapper {
            display: flex;
            justify-content: space-between;
            align-items: center;

            .task-label {
              display: flex;
              align-items: center;
              gap: 3px;

              .label-text {
                color: #b7b7c6;
              }
            }
          }
        }

        .task-stats {
          display: grid;
          grid-template-columns: repeat(1, 1fr); // Two equal-width columns
          gap: 4px;

          .stat-item {
            border-radius: 100px;
            @include flex-space-between;
            background: linear-gradient(
              162.53deg,
              rgba(51, 51, 51, 0.7) 0%,
              rgba(45, 36, 55, 0.7) 106.84%
            );
            border: 1px solid #ffffff0d;
            padding: 6px;

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

            span,
            .stat-value {
              font-size: 10px;
              display: flex;
            }
          }
        }

        .location-wrapper {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 6px 0;

          .location-header {
            display: flex;
            gap: 6px;

            .icon {
              display: flex;
            }

            .header {
              font-size: 12px;
              color: #b7b7c6;
            }
          }
        }

        .task-actions {
          display: grid;
          grid-template-columns: repeat(2, 1fr); // Two equal-width columns
          gap: 4px;
          margin-top: 3px;

          button {
            line-height: 133%;
            font-size: 11px;
            border: 1px solid var(--Linear-Border, #564b69);
            border-radius: 100px;
            padding: 4px 0;

            &:last-child {
              background-color: #cc2c1e;
            }
          }
        }
      }
    }
  }

  // ASSET MANAGEMENT
  .assetManagement-container {
    display: flex;
    flex-direction: column;
    gap: 6px;

    .assetManagement-card-wrapper {
      padding: 16px;
      border: 1px solid #564b69;
      border-radius: 20px;
      gap: 10px;

      header {
        border-bottom: 1px solid #595965;
        padding-bottom: 8px;

        .header-wrapper {
          display: flex;
          gap: 8px;

          .icon {
            min-width: 28px;
            height: 28px;
            border-radius: 7px;
            @include flex-center;
            background: var(--background-color-button);
          }

          .asset-image {
            width: 114px;
            height: 112px;
            border-radius: 15.2px;
            object-fit: cover;
          }

          .asset-details-container {
            width: 100%;
            @include flex-space-between;

            .asset-details {
              display: flex;
              gap: 4px;
              width: 100%;
              max-width: 160px;
              .input-value {
                width: fit-content;
              }
              .asset-model {
                color: var(--text-disabled);
                display: none;
              }
            }
          }

          .asset-status-wrapper {
            padding: 4px 8px;
            border: 1px solid var(--text-color-dark, #f3f3fdd9);
            border-radius: 100px;
            @include flex-space-between;
            gap: 4px;

            .indication {
              width: 6px;
              height: 6px;
              border-radius: 100%;

              &.Online {
                background-color: #44e5c6;
              }
            }

            .status {
              font-size: $small;
            }
          }
        }
      }

      .asset-contents {
        display: flex;
        flex-direction: column;
        gap: 3px;

        .asset-wrapper {
          @include flex-space-between;
          padding: 6px 0;
          gap: 20px;

          .key-wrapper,
          .viewMore {
            display: flex;
            align-items: center;
            gap: 6px;

            .icon {
              @include flex-center;
            }
          }

          .viewMore {
            padding: 8px;
            border-radius: 100px;
            background: var(--background-color-button);
            cursor: pointer;
          }

          .progress-wrapper {
            flex: 1;
            @include flex-space-between;
            gap: 4px;

            .progress-bar {
              width: 100%;
              height: 5px;
              border-radius: 20px;
              background-color: #6f6f7a;
              position: relative;

              .filled-value {
                position: absolute;
                top: 0;
                left: 0;
                height: 100%;
                width: 10px;
                background-color: #ccacff;
                border-radius: 20px;
              }
            }
          }
        }
      }

      .asset-estimate {
        display: flex;
        flex-direction: column;
        gap: 10px;

        &__label {
          color: #b7b7c6;
          font-size: 14px;
        }

        &__value {
          font-weight: 500;
          font-size: 16px;
        }

        &__unit-cost {
          display: flex;
          flex-direction: column;
          gap: 4px;
        }

        &__breakdown {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          gap: 2px;
        }

        &__view-button {
          cursor: pointer;
          display: flex;
          justify-content: center;
          align-items: center;
          gap: 4px;
          background-color: var(--background-color-button);
          border-radius: 20px;
          padding: 8px 0;
        }

        &__view-text {
          font-weight: 500;
          // color: #4A4AFF;
        }
      }

      &.openViewMore {
        outline-offset: -1px;
        outline: 1px solid var(--Color-Hover, #ccacff);

        header {
          display: flex;
          flex-direction: column;
          gap: 6px;

          .header-wrapper {
            gap: 14px;

            .asset-details-container {
              flex-direction: column;
              align-items: start;
              justify-content: start;

              .asset-details {
                display: flex;
                flex-direction: column;
                gap: 4px;
                max-width: 144px;
                .input-value {
                  text-wrap: wrap;
                  font-size: 1rem;
                }
              }

              .asset-status-wrapper {
                margin-top: 8px;
              }
            }
          }
        }
      }
    }
  }
}

// ASSET MANAGEMENT
.assetManagement-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;

  .assetManagement-card-wrapper {
    padding: 16px;
    border: 1px solid #564b69;
    border-radius: 20px;
    gap: 10px;
    position: relative;

    header {
      border-bottom: 1px solid #595965;
      padding-bottom: 8px;

      .header-wrapper {
        display: flex;
        gap: 8px;

        .icon {
          min-width: 28px;
          height: 28px;
          border-radius: 7px;
          @include flex-center;
          background: var(--background-color-button);
        }

        .drop-icon {
          position: absolute;
          top: 18px;
          right: 16px;
          cursor: pointer;
        }

        .asset-image {
          width: 114px;
          height: 112px;
          border-radius: 15.2px;
          object-fit: cover;
        }

        .asset-details-container {
          width: 100%;
          @include flex-space-between;

          .asset-details {
            // .asset-name{
            //     overflow: hidden;
            // }
            .asset-model {
              color: var(--text-disabled);
            }
          }
        }

        .asset-status-wrapper {
          padding: 4px 8px;
          border: 1px solid var(--text-color-dark, #f3f3fdd9);
          border-radius: 100px;
          @include flex-space-between;
          gap: 4px;

          .indication {
            width: 6px;
            height: 6px;
            border-radius: 100%;

            &.Online {
              background-color: #44e5c6;
            }
          }

          .status {
            font-size: $small;
          }
        }
      }
    }

    .asset-contents {
      display: flex;
      flex-direction: column;
      gap: 3px;

      .asset-wrapper {
        @include flex-space-between;
        padding: 6px 0;
        gap: 20px;

        .key-wrapper,
        .viewMore {
          display: flex;
          align-items: center;
          gap: 6px;

          .icon {
            @include flex-center;
          }
        }

        .viewMore {
          padding: 8px;
          border-radius: 100px;
          background: var(--background-color-button);
          cursor: pointer;
        }

        .progress-wrapper {
          flex: 1;
          @include flex-space-between;
          gap: 4px;

          .progress-bar {
            width: 100%;
            height: 5px;
            border-radius: 20px;
            background-color: #6f6f7a;
            position: relative;

            .filled-value {
              position: absolute;
              top: 0;
              left: 0;
              height: 100%;
              width: 10px;
              background-color: #ccacff;
              border-radius: 20px;
            }
          }
        }
      }
    }

    .asset-estimate {
      margin-top: 5px;
      display: flex;
      flex-direction: column;
      gap: 10px;

      &__label {
        color: #b7b7c6;
        font-size: 14px;
      }

      &__value {
        font-weight: 500;
        font-size: 16px;
      }

      &__unit-cost {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      &__breakdown {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 2px;
      }

      &__view-button {
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        background-color: var(--background-color-button);
        border-radius: 20px;
        padding: 8px 0;
      }

      &__view-text {
        font-weight: 500;
        // color: #4A4AFF;
      }
    }

    &.openViewMore {
      outline-offset: -1px;
      outline: 1px solid var(--Color-Hover, #ccacff);

      header {
        display: flex;
        flex-direction: column;
        gap: 6px;

        .header-wrapper {
          gap: 20px;

          .asset-details-container {
            flex-direction: column;
            align-items: start;
            justify-content: center;

            .asset-details {
              display: flex;
              flex-direction: column;
              gap: 4px;

              .asset-name {
                font-size: 16px;
              }
            }

            .asset-status-wrapper {
              margin-top: 4px;
            }
          }
        }
      }
    }
  }
}
