@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap');

body.exercizer {
  -webkit-text-size-adjust: 100%;
	-ms-text-size-adjust: 100%;
	font-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
  color: $grey-black;
  line-height: 24px !important;

  @import "./components/";
  @import "./views/";
  @import "./layout";

  >* {
    box-sizing: border-box;
  }

  &.dragging {
    [drop-item].drag-over {
      background: $orange;
      color: #fff;
    }
  }

  svg[class*="icon"] {
    flex-shrink: 0;
  }

  editor {
    margin: 0;
    line-height: 28px !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    line-height: 22px;
  }

  h1 {
    font-weight: 500;
    font-size: 22px;
    line-height: 28px;
    color: $purple;

    i {
      margin-right: 10px;
    }

    i,
    i:before {
      display: inline-block !important;
    }
  }

  h2,
  h3,
  h4 {
    color: $grey-black;
  }

  h2 {
    font-size: 18px;
  }

  h4 {
    font-size: 16px;
    font-weight: 600;
  }

  .lightbox h4 {
    color: $grey-black;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 22px;
    font-family: var(--font-primary);
  }

  .lightbox>.content h2 {
    font-size: 1.125rem;
    color: $grey-black;
  }

  button {
    margin-left: 0.5em;
    margin-right: 0.5em;

    &.right-magnet:first-of-type,
    &:not(.right-magnet):last-of-type {
      margin-right: 0;
    }

    &.right-magnet:last-of-type,
    &:not(.right-magnet):first-of-type {
      margin-left: 0;
    }

    &>i {
      margin-right: 8px;
    }

    &.label-badge {
      padding: 8px 16px;
    }
  }

  .in-place-toaster {
    position: relative;
    margin: 0 -1.6rem 0;
    top: 1.6rem;
    padding: 0 1rem;
    background-color: $grey-fog;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid $lightest-grey;

    .btns {
      border-radius: 8px;

      &:hover {
        color: $hover;
      }
    }
  }

  [drag-item] {
    cursor: move;
  }

  .image-select-radius img {
    border-radius: 4px;
    height: 160px;
    object-fit: cover;
  }

  .base-image {
    margin: 0;
    aspect-ratio: 4 / 3;
    height: auto;
    background: #fff;
    border-radius: .25rem;
    position: relative;
    overflow: visible;

    article {
      background: transparent;
      margin: 0 !important;
      overflow: inherit;
      z-index: 2 !important;
    }

    .image-container {
      display: flex;
      justify-content: center;
      vertical-align: middle;
      flex-direction: column;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      box-sizing: border-box;
      transition: border 250ms ease;
      border: 1px dashed transparent;
      border-radius: .25rem;

      &:hover {
        border: 1px dashed $orange;
      }

      >image-select {
        width: 100%;
        height: 100%;

        >div {
          width: 100%;
          height: 100%;
          display: flex;
          align-items: center;

          >img {
            border-radius: 0;
            aspect-ratio: 4 / 3;
            object-fit: contain;
            width: 100%;
            max-height: 100%;

            @media screen and (max-width: $wide-screen),
            print {
              margin-left: auto;
              margin-right: auto;
              display: block;
            }
          }
        }
      }

      >img[id*=-bckgrnd] {
        aspect-ratio: 4 / 3;
        object-fit: contain;
        width: 100%;
        max-height: 100%;
      }

      >div {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;

        >img {
          aspect-ratio: 4 / 3;
          object-fit: contain;
          width: 100%;
          max-height: 100%;
          border: none;

          /* @media screen and (max-width: $wide-screen),
          print {
            border-radius: 0;
            width: initial;
            margin-left: auto;
            margin-right: auto;
            display: block;
          } */
        }
      }
    }


    i {

      &.trash,
      &.edit.pick-file {
        display: none;
        visibility: hidden;
      }
    }

  }

  .eight-desktop {

    @media screen and (min-width: $wide-screen),
    print {
      width: 66.66667%;
    }
  }

  .grain-divider {
    border-bottom: 1px solid $grey-cloudy;
    padding: 1.6rem;
    margin: -1.6rem -1.6rem 1.6rem;
  }

  article {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: .5rem;
    transition: z-index 0s 0.35s;
    box-shadow: 0 2px 6px rgba($color: #000000, $alpha: .1);

    header {
      color: $grey-black;
      font-weight: 600;
    }

    &.textZoneOpen {
      z-index: 1000 !important;
      transition: z-index 0s;

      text-zone {

        .text-zone-size {
          max-width: 200px;
          max-height: 40px;
          transition: all 250ms ease, max-width 0.15s 0s ease-in,
            max-height 0.15s 0.15s ease-out;
          white-space: normal;
          text-overflow: inherit;
        }
      }

    }

    &.placed-block--dragging {
      text-zone {
        cursor: move !important;
      }
    }

    &.article-column {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
  }

  .edit-order-list {
    header {
      font-weight: 600;
      background-color: #e4f4ff;
      vertical-align: middle;
      padding: 0 16px;
      border-radius: 4px;
      font-size: .875rem;

      .cell:first-of-type {
        width: 71px;
      }
    }

    ul {
      padding: 0;
      margin: 0;

      >li {
        @include grid-cell-width(12);
        @include cell;
        list-style-type: none;
        padding: 4px 12px;
        border-radius: 4px;

        &:hover {
          background-color: #e4f4ff;
        }

        .edit-order-index {
          height: 32px;
          width: 32px;
          margin: 8px 25px 8px 4px;
          float: left;
          font-size: 15px;
          text-align: center;
          line-height: 32px;
          border: 2px solid $primary;
          border-radius: 50%;
          color: $primary;
        }

        input[type="text"] {
          margin-top: 2px;
        }

        .edit-order-delete {
          top: 15px;
          fill: currentColor;
        }
      }
    }
  }

  ul.order-list {
    padding: 12px;
    margin: 4px 0;
    border-radius: 4px;
    background-color: $grey-fog;
    border: 1px solid $lightest-grey;
  }

  .order-index {
    height: 1.5rem;
    width: 1.5rem;
    margin-right: 1.5rem;
    border-radius: 50%;
    background: transparent;
    border: 1px solid $flash-blue;
    color: $flash-blue;
    float: left;
    font-size: .875rem;
    text-align: center;
    line-height: 1.5rem;
    transition: background 250ms ease;
  }

  ul.thought-out-actions li {
    padding: 12px;
    margin: 4px 0;
    border-radius: 4px;
    background-color: $grey-fog;
    border: 1px solid $lightest-grey;

    /* &::after {
      @include fonticon;
      content: "\e847";
      font-size: 20px;
      position: absolute;
      right: 25px;
      top: calc(50% - 12px);
      opacity: 0.75;
    } */
  }

  // Delete border from Order question in correction, and constraint size
  input[data-ng-model="filled_answer.order_by"] {
    border: none;
    max-width: 4em;
    min-width: 4em;
  }

  grain-copy-footer {
    display: block;
    position: relative;
    background: rgba($cyan, 0.1);
    border: 1px solid rgba($cyan, 0.25);
    padding: 15px;
    border-radius: 7px;
    min-height: 23px;
    margin-top: 15px;
  }

  .flex-row.justify-center.centered>button.flat-button.five {
    span {
      float: none;
      display: inline-block;

      i {
        font-size: 25px;
        vertical-align: middle;
        padding-right: 8px;
      }
    }
  }

  .custom-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    color: #555;
  }

  /*  COLOR CORRECTED / CORRECTION ON GOING / HAS BEEN START / IS SUBMITTED */
  .color-corrected,
  .color-training-done,
  .color-is-submitted {
    color: $green !important;
  }

  .color-is-correction-on-going,
  .color-training-sided {
    color: $purple !important;
  }

  .color-has-been-started,
  .color-training-on-going {
    color: $orange !important;
  }

  /* Custom tags for subject library list */
  .subject-library-tag {
    font-size: .8125rem;
    color: white;
    background-color: $orange;
    border-radius: 2px;
    padding: 1px 3px 1px 2px;
    margin: 5px 5px 0 0;
    display: inline-block;
  }

  /* OVERWRITE THEME */

  .down-open:hover {
    color: $orange;
  }

  .hover-orange:hover {
    color: $orange;
  }

  #surcharge-force-cursor-default:before {
    cursor: default !important;
  }

  #edit-subject .surcharge-force-margin-zero {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
  }

  .association-possible-answer-left {
    margin: .3rem;
    border: 1px dashed $grey-grey;
    padding: 5px 10px;
    border-radius: 8px;
    background-color: $white;

    &:hover {
      border: 1px dashed $orange;
      background-color: white;
    }
  }

  .association-drop-hover {
    border: 1px dashed $orange !important;
    background-color: lighten($orange, 45%);
  }

  .subject-dragged-grain {
    z-index: 1000;
    width: 100%;
    border: 1px dashed $orange !important;
    background-color: white;
    cursor: move;
  }

  .row-like-input {
    line-height: 25px;
    height: 25px;
  }

  .import-files-custom {
    display: inline-grid;
    grid-template-columns: 1fr;
    background: $white;
    padding: 12px 16px !important;
    border-radius: 8px;
    border-width: 1px;

    &>article {
      display: flex;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      padding: 0;
      margin-bottom: 0;
      position: static;
      width: auto;
      height: auto;
      box-shadow: none;
      grid-column: 1 / 1;
      grid-row: 1 / 1;

      @media (max-width: $tablette) {
        flex-direction: column;
      }

      .select-file {
        & + div {
          display: inline-flex;
          align-items: center;
          gap: 8px;
        }
        @media (max-width: $tablette) {
          order: 1;
        }
      }

      .help {
        height: auto;
        line-height: 18px;
      }

      .icon-upload {
        flex-shrink: 0;

        /* @media (max-width: $tablette) {
          display: none;
        } */
      }
    }

    @media (max-width: $tablette) {
      .default {
        position: static;

        div:last-child {
          display: inline-flex;
        }
      }
    }
  }

  // & body
  editor.small-editor.edit div[contenteditable] {
    width: 100%;
    max-height: 100px !important;
    min-height: 100px !important;
    overflow-y: auto;
  }

  editor.small-editor.edit div[contenteditable] {
    padding: .75rem 1rem;
  }

  editor.small-editor.edit div[contenteditable]:focus {
    width: 100%;
    max-height: none !important;
    min-height: 100px !important;
    overflow: visible;
  }

  table tbody tr:hover {
    background-color: transparent;
  }

  table.scores {
    width: 70%;
    overflow: hidden;
    float: left;
    border-left: 1px solid $cyan;

    tbody {
      max-height: 450px;
      overflow: auto;
      overflow-x: hidden;
      display: block;
    }
  }

  table.infos {
    width: 30%;
    overflow: hidden;
    float: left;

    tbody {
      max-height: 450px;
      overflow: hidden;
      display: block;
    }
  }

  .small-cell {
    width: 10px;
  }

  @media screen and (max-width: $wide-screen),
  print {
    .cell-initial-float {
      float: initial;
    }
  }

  th.nav {
    border-left: 1px solid;
    border-right: 1px solid;

    i {
      color: $white;
    }
  }

  tr.hover-hidden {
    background: $white;
  }

  .display-table {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  .good-answer {
    color: $green;
    background-color: rgba($green, 0.1);
  }

  .bad-answer {
    color: $red;
    background-color: rgba($red, 0.1);
  }

  .association {
    &__left {
      justify-content: flex-end;
      border-bottom: 1px solid $solid-grey;
      padding: 10px;
    }

    &__right {
      padding-left: 1rem;
      padding-right: 1rem;
      border: 1px dashed $solid-grey !important;
      border-radius: 10px;
      text-align: center;
      min-height: 50px;
      display: flex;
      justify-content: space-between;

      .close {
        padding-right: 15px;
      }
    }

    &__delete {
      right: 8px;
      display: inline-flex;
    }
  }

  // BACK TO TOP
  .back-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    font-size: 20px;
    background-color: $orange;
    color: white;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(black, 0.25);
    cursor: pointer;

    &::before {
      @include fonticon;
      content: "\e838";
      display: block;
    }

    &:hover {
      background-color: darken($orange, 10%);
    }
  }

  .grain-correction {
    background-color: rgba($green, 0.1);
    border: 1px solid $green !important;
    border-radius: 7px;

    h2 {
      color: $green;
    }

    input[type="text"] {
      margin: 0;
      border: none;
      height: inherit;
      line-height: inherit;
      color: inherit !important;
    }

    .input-response-correct,
    .input-response-incorrect {
      padding: 5px 15px;
      border: none !important;
      background-color: rgba(black, 0.025);
    }
  }

  @media screen and (max-width: $tablette),
  print {
    .main-col {
      padding-left: 0 !important;
    }

    ul.thought-out-actions li {
      margin: 10px 0;
    }

    .right-spacing-twice {
      margin-top: .5rem;
      margin-right: 0 !important;
    }
  }

  @media screen and (max-width: $fat-mobile),
  print {
    .association {
      flex-direction: column;
      padding: 10px;
    }

    .association__left {
      justify-content: center;
    }

    .dominos {
      .item {
        .domino {
          .top {
            display: none !important;
          }

          .bottom {
            margin-left: 0 !important;
            height: 150px;

            .content {
              flex-direction: column;
              justify-content: center;
              align-items: flex-start;
            }
          }

          .due-date {
            font-size: 13px;

            &::before {
              font-size: 16px;
            }
          }
        }
      }
    }
  }

  .item-selected {
    background-color: rgba(42, 154, 198, 0.2) !important;
    border: 2px dashed #2a9cc8 !important;

    .text-zone-size {
      background-color: transparent;
    }
  }

  .left-margin-5 {
    margin-left: 5px;
  }

  .default-img image-select i.trash {
    color: $dark-grey;
    pointer-events: none;
  }

  @media screen and (max-width: $fat-mobile),
  print {
    .text-zone-size {
      font-size: 70%;
    }
  }

  textarea:focus {
    border: 2px solid #ff8500;
    outline: 0;
  }

  @media screen and (max-width: $wide-screen),
  print {
    .rigid-grid>.twelve {
      width: 100%;
    }

    .rigid-grid {

      >.margin-one,
      >.margin-two,
      >.margin-three,
      >.margin-four,
      >.margin-five,
      >.margin-six,
      >.margin-seven,
      >.margin-eight,
      >.margin-nine,
      >.margin-ten,
      >.margin-eleven,
      >.margin-twelve {
        margin: 0;
      }
    }

    .simple-drop {
      width: 100% !important;
    }

    .simple-button {
      width: inherit !important;
    }
  }

  .article-edit {
    &.selected {
      color: unset;
      background: white;
    }
  }

  .padding-top-50 {
    padding-top: 50px;
  }

  .padding-top-70 {
    padding-top: 70px;
  }

  .final-score {
    color: gray;
    font-weight: bold;
  }

  .final-score-button {
    color: white;
    background-color: $primary;
    border-radius: 25px;
    font-size: large;
  }

  .final-score-list {
    display: flex;

    >div {
      display: flex;
      margin-left: auto;
      margin-right: auto;
    }

    ul {
      padding-left: 10px;
      border-left: none;

      li {
        width: 300px;
        height: 70px;
        float: none;
        display: block;
        font-size: 14px;
        font-weight: normal;
        top: 0;
        border-top: 0;
        margin-bottom: 5px;
        margin-left: 10px;
        margin-right: 10px;
        background: $white;
        border-radius: 1px;
        margin-left: auto;
        margin-right: auto;

        a {
          font-size: 20px;
          display: block;
          position: relative;
          line-height: 20px;
          box-sizing: border-box;
          width: 100%;
          margin: 0;
          margin-top: 5px;
          margin-bottom: 5px;
          padding: 5px;
          overflow: hidden;
          text-overflow: ellipsis;
          cursor: initial;

          &:hover {
            color: unset;
          }
        }
      }
    }
  }

  .input-block input+i.loaded {
    font-size: 20px;
    padding-left: 5px;
    padding-right: 5px;
    color: #46bfaf;
  }

  .zone-image {
    image-zone {
      border: 1px solid $white;
    }
  }

  .zone-image,
  .zone-text {

    @media (min-width: $tablette),
    print {
      display: flex;
      gap: 16px;

      >.row {
        flex: 1;
      }
    }

    >.select-zone {
      margin-top: 1rem;
      margin-bottom: 1rem;
      display: flex;
      flex-wrap: wrap;


      >button {
        margin: 0 !important
      }

      >.options {
        margin: 0 !important;
        flex: 1;
        align-self: stretch;

        @media screen and (max-width: $tablette),
        print {
          flex-basis: 100%;
        }
      }

      @media screen and (min-width: $tablette),
      print {
        width: 15rem;
        margin-top: 0;
        margin-bottom: 0;
        flex-direction: column;
        align-items: flex-start;
        flex-wrap: wrap;
        justify-content: flex-start;
      }
    }
  }

  @media screen and (max-width: $tablette),
  print {
    .mobile-row {
      @include row;
    }
  }

  @media screen and (min-width: $wide-screen),
  print {
    .desktop-three {
      width: 25%;
    }
  }

  .no-responsive {
    @include responsive-only {
      display: none !important;
    }
  }

  .no-desktop {
    @include desktop-only {
      display: none !important;
    }
  }

  div.hidden-content>* {
    display: none;
  }

  strong {
    font-weight: 600;
  }

  dropdown-buttons open {
    border-radius: 8px;
  }

  a.comment {
    color: $flash-blue;
    border-radius: 8px;
  }

  .lightbox {
    .content {
      min-height: auto;
      padding: 24px;

      h2 {
        margin-top: 0px;
      }
    }

    .close-lightbox {
      margin: 20px;

      i.close-2x:before {
        content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' id='close' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.222 4.222a1.1 1.1 0 0 1 1.556 0l14 14a1.1 1.1 0 1 1-1.556 1.556l-14-14a1.1 1.1 0 0 1 0-1.556Z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M19.778 4.222a1.1 1.1 0 0 1 0 1.556l-14 14a1.1 1.1 0 1 1-1.556-1.556l14-14a1.1 1.1 0 0 1 1.556 0Z'/%3E%3C/svg%3E");
        display: block;
        width: 22px;
      }
    }
  }

  share-panel {
    h1 {
      color: #4a4a4a;
    }

    .input-help > label {
      &:first-child {
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.5rem !important;
        font-style: italic;
        color: $grey-stone;
        opacity: 1;
        padding: 6px 16px;
      }

      &.move {
        display: none;
      }
    }
  }
}