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

.marketplace-wrapper {
  height: 100vh;
  width: 100vw;
  z-index: #{$z-index-marketplace};
  background: var(--background-color-secondary);
  position: absolute;
  left: 0;
  top: 0;
  padding: 10px;
  padding-top: 100px;

  .marketplace-container {
    position: relative;
    padding: 20px 2px;
    height: 100%;
    background: var(--background-color);
    box-shadow: #{$box-shadow-medium};
    border-radius: #{$border-radius-xxx};
    outline: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
  }

  .marketPlace {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;

    .skeleton-wrapper {
      display: flex;
      flex-wrap: wrap;
      gap: 18px;
      margin: 0;
      width: 100%;

      .skeleton-content {
        width: calc(25% - 14px) !important;
        height: 100%;
        border-radius: #{$border-radius-xlarge};
        padding: 12px;
        box-shadow: 0px 2px 10.5px 0px #0000000d;
        background: var(--background-color-solid-gradient);
        border: 1px solid var(--border-color);
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;

        .asset-image {
          width: 100%;
          height: 100%;
        }

        .asset-details {
          width: 100%;
          height: 33px;
        }

        .organization {
          width: 40%;
          height: 15px;
        }

        .asset-review {
          width: 100%;
          height: 20px;
        }

        .button {
          width: 100%;
          height: 35px;
          border-radius: 20px;
        }
      }
    }

    .filter-search-container {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 12px;
      margin-top: 2px;
      padding: 0 24px;

      .search-wrapper {
        min-width: 60%;
        max-width: 684px;
        padding: 0;
        border-radius: $border-radius-large;

        .search-container {
          border-radius: $border-radius-large;
          outline: 1px solid var(--border-color);
          border: none;

          input {
            border: none !important;
            outline: none;
          }
        }
      }

      .regularDropdown-container {
        max-width: 159px;
        height: 100%;
        border-radius: #{$border-radius-extra-large};
        border: 1px solid var(--border-color);
        padding: 0 10px;

        .dropdown-header {
          align-items: center;
        }
      }

      .button {
        padding: 5px 20px;
        border-radius: #{$border-radius-large};
        background: var(--background-color-button);
        color: var(--text-button-color);
      }

      .rating-container {
        display: flex;
        align-items: center;
        gap: 6px;

        .stars {
          display: flex;
          align-items: center;

          .star-wrapper.filled {
            svg {
              fill: #f3a50c;
            }
          }
        }
      }
    }

    .cards-container-wrapper {
      position: relative;
      height: calc(100% - 60px);
      padding: 0px 10px;
    }

    .cards-container-container {
      display: flex;
      padding: 0 10px;
      flex-direction: column;
      gap: 6px;
      height: 100%;
      overflow: auto;

      .header {
        color: var(--text-color);
        font-weight: $medium-weight;
        font-size: $xlarge;
        margin-bottom: 12px;
      }

      .cards-wrapper-container {
        display: flex;
        flex-wrap: wrap;
        gap: 18px;

        .card-container {
          width: calc(25% - 14px);
          border-radius: #{$border-radius-xlarge};
          padding: 12px;
          box-shadow: 0px 2px 10.5px 0px #0000000d;
          background: var(--background-color-solid-gradient);
          border: 1px solid var(--border-color);
          position: relative;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          gap: 6px;

          .icon {
            position: absolute;
            top: 12px;
            left: 12px;
            width: 30px;
            height: 30px;
            border-radius: #{$border-radius-large};
            padding: 5px;
            background: var(--accent-color);
          }

          .image-container {
            width: 100%;
            display: flex;
            height: 180px;
            justify-content: center;
            border-radius: #{$border-radius-medium};
            overflow: hidden;

            img {
              height: inherit;
              width: 100%;
              object-fit: cover;
            }
          }

          .assets-container {
            height: auto;
            display: flex;
            justify-content: space-between;
            padding: 0;
            height: auto;
            .name-container {
              display: flex;
              flex-direction: column;
              gap: 3px;

              .assets-name {
                text-transform: capitalize;
              }

              .asstes-container {
                font-weight: #{$bold-weight};
                font-size: $regular;
              }

              .assets-date {
                color: var(--accent-color);
                font-size: $small;
              }
            }

            .details {
              display: flex;
              align-items: center;
              gap: 10px;

              .content {
                display: flex;
                align-items: center;
                gap: 6px;
              }
            }
          }

          .vendor-icon {
            display: flex;
            align-items: center;
            gap: 4px;
            font-weight: #{$bold-weight};
            font-size: $regular;
          }

          .stars-container {
            display: flex;
            justify-content: space-between;
          }

          .buy-now-button {
            width: 100%;
            background: var(--background-color-button);
            border-radius: $border-radius-extra-large;
            padding: 8px 0;
            @include flex-center;
            color: var(--text-button-color);
            transition: all 0.1s linear;

            &:hover {
              cursor: pointer;
              transform: translateY(-2px);
            }
          }
        }
      }
    }
  }
}

@keyframes growWidth {
  from {
    transform: scale(0.65);
  }

  to {
    transform: scale(1);
  }
}

.assetPreview-wrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  padding: 0 10px;

  .assetPreview {
    width: 100%;
    height: 100%;
    background: var(--background-color);
    backdrop-filter: blur(18px);
    display: flex;
    gap: 12px;
    overflow: hidden;
    border-radius: #{$border-radius-extra-large};
    outline: 1px solid var(--border-color);
  }

  // Image Preview Section
  .image-preview {
    width: 50%;
    height: 100%;

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }

  // Asset Details Section
  .asset-details-preview {
    width: 50%;
    padding: 50px 20px;
    overflow-y: auto;
  }

  // Organization Section (Top part with image and details)
  .organization {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;

    .image {
      @include flex-center;
      height: 30px;
      width: 30px;
      min-height: 26px;
      min-width: 26px;
      border-radius: #{$border-radius-circle};
      font-weight: var(--font-weight-bold);
      color: var(--text-button-color);
      background: var(--background-color-button);
    }

    .organization-details {
      display: flex;
      flex-direction: column;

      .organization-name {
        margin-bottom: 5px;
        font-weight: #{$bold-weight};
        font-size: $regular;
      }

      .follow {
        color: var(--accent-color);
        cursor: pointer;
      }
    }
  }

  // Asset Details
  .asset-details {
    margin-top: 20px;

    .asset-name {
      margin-bottom: 10px;
      font-weight: #{$bold-weight};
      font-size: var(--font-size-large);
    }

    .asset-description {
      margin-bottom: 20px;
      color: var(--input-text-color);
    }

    .asset-review {
      width: fit-content;
      padding: 5px 14px;
      display: flex;
      align-items: center;
      margin-bottom: 20px;
      outline: 1px solid var(--border-color);
      border-radius: #{$border-radius-large};

      .asset-rating {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-right: 10px;
        position: relative;
        font-weight: #{$bold-weight};
        font-size: $regular;

        &::after {
          margin-left: 5px;
          content: "";
          display: block;
          width: 2px;
          height: 12px;
          background: #ccc;
        }
      }

      .asset-view {
        font-weight: #{$bold-weight};
        font-size: $regular;
      }
    }

    .asset-price {
      font-size: $xxlarge;
      font-weight: bold;
      margin-bottom: 20px;
    }
  }

  // Button Container and Button Styles
  .button-container {
    display: flex;
    gap: 10px;
  }

  .button {
    color: var(--text-button-color);
    padding: 8px 26px;
    border-radius: #{$border-radius-extra-large};
    cursor: pointer;
    text-align: center;

    &:first-child {
      outline: 1px solid var(--background-color-button);
      color: var(--highlight-text-color);
    }

    &:last-child {
      background: var(--background-color-button);
      color: var(--text-button-color);
    }
  }

  .closeButton {
    color: var(--highlight-text-color);
    position: absolute;
    top: 18px;
    left: 18px;
    @include flex-center;
    cursor: pointer;
    font-size: var(--font-size-large);
  }
}
