@use '../../globals/fonts';
@use 'pix-design-tokens/typography';

.mission-card {
  &__container {
    position: relative;
    width: 248px;
    height: 368px;
    padding: var(--pix-spacing-2x);
    font-family: fonts.$font-nunito;
    font-style: normal;
    background-color: var(--pix-neutral-0);
    border-radius: 16px;
    box-shadow: 2px 4px 6px 0 rgb(70 77 98 / 20%), 0 0 2px 0 rgb(70 77 98 / 32%);

    .area-code-1 {
      color: var(--pix-information-dark);

      .background {
        fill: var(--pix-information-light);
      }
    }

    .area-code-2 {
      color: var(--pix-communication-dark);

      .background {
        fill: var(--pix-communication-light);
      }
    }

    .area-code-3 {
      color: var(--pix-contenu-dark);

      .background {
        fill: var(--pix-contenu-light);
      }
    }

    .area-code-4 {
      color: var(--pix-securite-dark);

      .background {
        fill: var(--pix-securite-light);
      }
    }

    .area-code-5 {
      color: var(--pix-environnementnum-dark);

      .background {
        fill: var(--pix-environnementnum-light);
      }
    }

    .status {
      position: absolute;
      top: 30px;
      left: 50%;
      width: fit-content;
      color: var(--pix-primary-500);
      font-weight: 700;
      font-size: var(--pix-spacing-4x);
      line-height: 21.82px;
      text-align: center;
      background: var(--pix-neutral-0);
      border: solid 2px var(--pix-primary-500);
      border-radius: 4px;
      transform: translate(-50%);

      &--completed {
        color: var(--pix-success-500);
        border: none;
      }

      p {
        padding: var(--pix-spacing-1x) var(--pix-spacing-4x);
      }
    }

    .started-icon {
      position: absolute;
      top: -32px;
      left: 164px;
    }

    .mission-card-bottom {
      margin-top: var(--pix-spacing-2x);

      .mission-name {
        @extend %pix-title-xs;

        min-height: 62px;
        margin-bottom: var(--pix-spacing-3x);
        text-align: center;

        p {
          white-space: break-spaces;
        }
      }

      .fake-button {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        width: 140px;
        height: 40px;
        margin: auto;
        padding: var(--pix-spacing-3x) var(--pix-spacing-8x);
        color: var(--pix-primary-500);
        border: 1px solid var(--pix-primary-500);
        border-radius: 100px;
      }
    }

    .mission-icon {
      position: absolute;
      top: 85px;
      right: 0;
      left: 0;

      .icon {
        width: 121px;
        height: 112px;
      }
    }

    .mission-icon-default {
      position: absolute;
      top: 100px;
      right: 0;
      left: 0;
    }

    .mission-icon--completed {
      position: absolute;
      top: 130px;
      left: 50%;
      transform: translate(-50%);
    }

    .completed-mission-card-bottom {
      position: absolute;
      bottom: var(--pix-spacing-8x);
      left: 50%;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      justify-content: center;
      width: 200px;
      height: 62px;
      transform: translate(-50%);

      p {
        color: var(--pix-neutral-0);
        font-weight: 800;
        font-size: 22.38px;
        line-height: normal;
        white-space: break-spaces;
        text-align: center;
      }
    }
  }
}
