@use 'pix-design-tokens/typography';

.element-flashcards-card,
.element-flashcards-intro-card,
.element-flashcards-outro-card,
{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 345px;
  height: 440px;
  margin: auto auto var(--pix-spacing-2x);
  padding: var(--pix-spacing-6x);
  background: var(--pix-neutral-0);
  border: 5px solid var(--pix-neutral-100);
  border-radius: var(--modulix-radius-l);
  box-shadow: 0 12px 24px 0 rgb(7 20 46 / 12%);
}

/* To get higher specifity than `.modulix-passage h4` we double classes usage */
.element-flashcards-intro-card {
  .element-flashcards-intro-card {
    &__title {
      @extend %pix-title-s;
    }
  }

  &__image {
    img {
      border-top-left-radius: var(--modulix-radius-l);
      border-top-right-radius: var(--modulix-radius-l);
    }
  }
}

.element-flashcards-card {
  &__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: var(--pix-spacing-6x);
    justify-content: center;

    &--with-image {
      justify-content: flex-start;
    }
  }

  &__image {
    display: flex;
    align-items: center;
    justify-content: center;

    img {
      height: auto;
      max-height: 250px;
      border-radius: var(--modulix-radius-s);
    }
  }

  &__text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pix-neutral-900);
    text-align: center;

    &--recto {
      font-weight: bold;
    }
  }

  &__footer {
    display: flex;
    align-items: center;

    &--recto {
      flex-direction: column;
    }

    &--verso {
      justify-content: flex-start;
    }
  }
}

.element-flashcards-intro-card,
.element-flashcards-outro-card {
  align-items: center;
  padding: var(--pix-spacing-2x);
  padding-bottom: var(--pix-spacing-6x);
  border: 0;

  &__title {
    @extend %pix-title-s;

    width: 100%;
    text-align: center;
    text-wrap: balance;
  }
}

.element-flashcards-outro-card {

  &__header {
    display: flex;
    flex-direction: column;
    gap: var(--pix-spacing-4x);
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 173px;
    text-align: center;
    background-image: url("/images/modulix/flashcards-outro-image.svg");
    background-repeat: no-repeat;
    background-size: contain;
  }

  &__alert {
    @extend %pix-title-xs;

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

  &__title {
    @extend %pix-title-xs;

    padding: 0 var(--pix-spacing-4x);
    color: var(--pix-neutral-0);
  }

  &__question {
    @extend %pix-body-s;

    margin-bottom: var(--pix-spacing-2x);
    font-weight: var(--pix-font-bold);
  }

  &__counter {
    @extend %pix-body-l;

    font-weight: var(--pix-font-bold);

    &__yes {
      color: var(--pix-success-500);
    }

    &__almost {
      color: var(--pix-warning-500);
    }

    &__no {
      color: var(--pix-error-500);
    }
  }
}

