@use '/src/components/config' as *;

.module-container {
  .tab-name {
    margin-bottom: 1rem;

    h1 {
      font-size: 1.625rem;
      line-height: normal;
      font-weight: 500;
    }
  }

  .module-option-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;

    .module-list-item {
      border-radius: $border-radius-small;
      box-shadow: 0 0 1rem rgba($color: #000000, $alpha: 0.125);
      padding-top: 1.5rem;
      max-width: 20rem;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      flex-direction: column;
      background-color: $color-white;
      overflow: hidden;
      min-height: 24.25rem;
      position: relative;

      @media screen and (max-width: 48rem) {
        max-width: 100%;
      }

      fieldset{
        border: $border-light-small;
        margin-top:0.313rem;
        padding: 0.5rem;
        padding-top: 0;
        legend {
          background-color: #7598c66e;
          color: $color-black;
          padding: 0.188rem 0.375rem;
          margin-left: 0.25rem;
          border-radius: $border-radius-small;
          text-align: left;
        }
      }
      .admin-pro-tag {
        right: 1.25rem;
        width: fit-content;
        top: 1.75rem;
      }

      .module-icon {
        i {
          width: 3.024rem;
          height: 3.024rem;
          background: $menu-color;
          color: $color-active;
          border-radius: 0.189rem;
          font-size: 2rem;
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }

      .card-meta {
        text-align: center;
        margin: 0.5rem 0.75rem 1rem;

        .meta-name {
          font-size: 1.5rem;
          margin-bottom: 0.5rem;
          line-height: normal;
        }

        .meta-description {
          font-size: 0.875rem;
          min-height: 5.25rem;
          .highlight{
            font-weight: 600;
            background-color: transparent;
          }
        }
      }

      .card-footer {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: $background-color;
        position: absolute;
        bottom: 0;

        .toggle-checkbox-content {
          margin-left: auto;
          position: relative;


          &::after {
            content: "";
            position: absolute;
            top: 0.55rem;
            left: 2.3rem;
            width: 0.25rem;
            height: 0.25rem;
            border: $border-theme-small;
            border-radius: $border-radius-button;
            transition: 0.3s;
            z-index: 0;
          }

          input {
            height: 0;
            width: 0;
            visibility: hidden;
            display: none; // hide for toggle button
          }

          label {
            cursor: pointer;
            width: 3.3rem;
            height: 1.5rem;
            background: 0 0;
            display: block;
            border-radius: $border-radius-button;
            position: relative;
            border: $border-light-medium;

            &::before {
              content: "";
              position: absolute;
              top: 50%;
              transform: translateY(-50%);
              left: 0.5rem;
              width: 0.188rem;
              height: 0.563rem;
              background: $color-white;
              -webkit-transition: 0.3s;
              transition: 0.3s;
            }

            &::after {
              content: "";
              position: absolute;
              top: 50%;
              transform: translateY(-50%);
              left: 0.313rem;
              width: 0.875rem;
              height: 0.875rem;
              background: $color-active;
              border-radius: 90rem;
              transition: 0.3s;
              z-index: 1;
            }
          }

          input:checked+label {
            background: $color-active;
            border: $border-theme-medius;
          }

          input:checked+label::after {
            left: calc(100% - 1.313rem);
            transform: translateY(-50%);
            background: $background-color;
          }
        }

        .card-support {
          display: flex;
          align-items: center;
          justify-content: flex-start;
          gap: 0.5rem;

          .card-support-btn {
            box-shadow: 0 0 1.25rem rgba(0, 0, 0, 0.2);
            overflow: hidden;

            &::before {
              content: "";
              position: absolute;
              width: 6.25rem;
              height: 100%;
              background-image: linear-gradient(120deg,
                  rgba(255, 255, 255, 0) 30%,
                  rgba(255, 255, 255, 0.8),
                  rgba(255, 255, 255, 0) 70%);
              top: 0;
              left: -6.25rem;
              opacity: 0.6;
            }

            &:hover {
              transform: scale(1.05);
              border-color: #fff9;

              &::before {
                animation: shine 1.5s ease-out infinite;
              }
            }

            @keyframes shine {
              0% {
                left: -6.25rem;
              }

              60% {
                left: 100%;
              }

              to {
                left: 100%;
              }
            }
          }
        }
      }
    }
  }
}