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

.dashboard-main {
  height: 100vh;
  width: 100vw;
  display: flex;
  padding: 27px 17px;

  .side-pannel-container {
    padding: 32px;
    min-width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--background-color);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: var(--box-shadow-medium);

    .side-pannel-header {
      @include flex-space-between;

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

        .user-profile {
          height: 32px;
          width: 32px;
          line-height: 32px;
          text-align: center;
          font-weight: var(--font-weight-medium);
          background: var(--background-color-accent);
          color: var(--text-button-color);
          border-radius: #{$border-radius-circle};
        }

        .user-name {
          color: var(--accent-color);
        }
      }

      .notifications-container {
        @include flex-center;
        height: 24px;
        width: 24px;
        cursor: pointer;
      }
    }

    .new-project-button {
      position: relative;
      padding: 12px 16px;
      color: var(--text-color);
      background: #7b4cd323;
      border-radius: #{$border-radius-xxx};
      overflow: hidden;
      cursor: pointer;
      transition: color 0.3s;
      &::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 0px;
        width: 0px;
        border-radius: 50%;
        background: var(--background-color-accent);
        z-index: -1;
        transition: all 0.25s ease-in-out;
      }
      &:hover {
        color: var(--text-button-color);
        &::after {
          height: 260px;
          width: 260px;
          left: 50%;
          scale: 1;
        }
      }
    }

    .side-bar-content-container {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 100%;

      .side-bar-options-container {
        .option-list {
          display: flex;
          position: relative;
          align-items: center;
          gap: 8px;
          padding: 8px 10px;
          margin: 4px 0;
          border-radius: #{$border-radius-extra-large};
          width: 100%;
          overflow: hidden;
          cursor: pointer;
          transition: color 0.3s;

          &::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translate(-50%, -50%);
            height: 0px;
            width: 0px;
            border-radius: 50%;
            background: #7b4cd323;
            z-index: -1;
            transition: all 0.5s ease-in-out;
          }

          &:disabled {
            cursor: help;
          }

          &:hover {
            &::after {
              height: 260px;
              width: 260px;
              left: 50%;
              scale: 1;
            }
          }
        }

        .active {
          color: var(--text-button-color);
          font-weight: var(--font-weight-medium);
          background: var(--background-color-button);

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

  .dashboard-home-container {
    width: 100%;
    padding-left: 18px;

    .dashboard-navbar-container {
      margin-top: 28px;
      margin-bottom: 22px;
      @include flex-center;

      .title {
        text-transform: capitalize;
        font-size: var(--font-size-large);
        width: 100%;
      }

      .market-place-button {
        @include flex-center;
        gap: 6px;
        padding: 8px 14px;
        background: var(--background-color-button);
        white-space: nowrap;
        border-radius: #{$border-radius-extra-large};

        color: var(--text-button-color);
      }

      .search-wrapper {
        width: 400px;
      }
    }

    .dashboard-container {
      margin: 22px 0;
      width: 100%;
      height: calc(100% - 357px);

      .header-wrapper {
        font-size: var(--font-size-large);

        .header {
          color: var(--input-text-color);
          padding: 6px 8px;
          border-radius: #{$border-radius-extra-large};

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

      .cards-container {
        height: auto;
        max-height: 100%;
        display: flex;
        flex-wrap: wrap;
        position: relative;
        width: 100%;
        padding-top: 18px;
        gap: 18px;
        overflow: auto;
      }
    }
  }
}

.dashboard-card-container {
  height: 242px;
  width: calc((100% / 5) - 23px);
  min-width: 260px;
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  cursor: pointer;
  overflow: hidden;
  &:hover {
    border-color: var(--accent-color);
    .preview-container {
      img {
        scale: 1.05;
      }
    }
  }

  .dashboard-card-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    padding-bottom: 1px;
  }

  .preview-container {
    height: 100%;
    width: 100%;
    border-radius: #{$border-radius-extra-large};
    overflow: hidden;

    img {
      height: 100%;
      width: 100%;
      object-fit: cover;
      vertical-align: top;
      border: none;
      outline: none;
      transition: scale 0.2s;
    }
  }

  .project-details-container {
    @include flex-space-between;
    position: absolute;
    bottom: 1px;
    width: 100%;
    padding: 13px 16px;
    background: var(--background-color);
    border-radius: #{$border-radius-extra-large};
    backdrop-filter: blur(6px);
    // transform: translateY(100%);///////hovered
    transition: transform 0.2s linear;

    .project-details {
      display: flex;
      flex-direction: column;
      align-items: flex-start;

      .project-name {
        margin-bottom: 7px;
      }

      .project-data {
        text-align: start;
        color: var(--input-text-color);
      }
    }

    .users-list-container {
      @include flex-center;
      gap: 6px;
      position: relative; // Needed for absolute positioning of kebab-options-wrapper

      .user-profile {
        height: 26px;
        width: 26px;
        line-height: 26px;
        text-align: center;
        background: var(--background-color-accent);
        color: var(--text-button-color);
        border-radius: #{$border-radius-circle};
      }

      .kebab {
        padding: 10px;
        @include flex-center;
        transform: rotate(90deg);
      }
    }
  }

  &:hover {
    overflow: visible;

    .kebab-options-wrapper {
      display: flex;
    }

    .project-details-container {
      transform: translateY(0);
    }
  }
}

.market-place-banner-container {
  width: 100%;
  height: 230px;
  overflow: hidden;
  position: relative;

  img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: #{$border-radius-xxx};
  }

  .hero-text {
    position: absolute;
    left: 52px;
    bottom: 25px;
    font-size: 48px;
    font-family: #{$font-roboto};
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
  }

  .context {
    position: absolute;
    top: 20px;
    right: 58px;
    text-transform: uppercase;
    font-size: 22px;
    width: 300px;
    color: #ffffff;
    font-family: #{$font-roboto};
  }

  .arrow-context {
    position: absolute;
    bottom: 27px;
    right: 300px;
  }

  .explore-button {
    position: absolute;
    top: 95px;
    right: 52px;
    padding: 10px 20px;
    text-transform: uppercase;
    font-size: 24px;
    border: 1px solid #ffffff;
    color: #ffffff;
    font-family: #{$font-roboto};
    cursor: pointer;
  }
}

.kebab-options-wrapper {
  min-width: 140px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  flex-direction: column;
  // transform: translate(100%, 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translate(0%, 0%);
  .option {
    padding: 8px 12px;
    font-size: 14px;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease;
    text-transform: capitalize;

    &:hover {
      background-color: var(--background-color-selected);
    }
  }
}
