.convert {
  h2 {
    font-size: 1.2rem;
    place-self: start;
  }

  > .loading {
    transition: all 0.5s;
    width: 100%;
    height: 737px;
    position: relative;
    &.loaded {
      display: none;
    }
  }

  .converter {
    transition: all 0.5s;
    display: none;
    width: 100%;
    grid-template:
      "selection selection" 360px
      "preview  preference" 360px
      / 0.5fr 0.5fr;
    gap: 1rem;
    padding-bottom: 36px;

    @media (max-width: 640px) {
      grid-template:
        "selection" 360px
        "preview" 360px
        "preference" 300px
        / 1fr;
    }

    &.loaded {
      animation: appear 0.5s ease-in;
      display: grid;

      @keyframes appear {
        0% {
          opacity: 0;
        }
        100% {
          opacity: 1;
        }
      }
    }

    .selection {
      grid-area: selection;

      .dropzone {
        height: 300px;
        position: relative;
        width: 100%;
        place-content: center;
        place-items: center;
        display: grid;

        input[type="file"] {
          position: absolute;
          z-index: 1;
          opacity: 0;
          width: 100%;
          height: 100%;
          &:after {
            content: "aaaa";
            opacity: 0.9 !important;
          }
        }

        label {
          z-index: -1;
          position: absolute;
          color: var(--fg);
          width: 100%;
          height: 100%;
          cursor: pointer;
          transition: 0.3s;
          background: rgba(200, 200, 200, 0.1);
          display: grid;
          place-content: center;
          border: 3px dashed var(--link);
          border-radius: 0.375rem;
          font-weight: bold;

          &:hover {
            opacity: 0.8;
          }
        }
      }
    }

    .convert-heading {
      margin: 0 0 1rem;
      font-weight: 700;
    }

    .convert-subheading {
      font-size: 0.875rem;
      line-height: 1.25rem;
      font-weight: 700;
    }

    .convert-input-row {
      margin-bottom: 0.5rem;
    }

    .convert-input {
      width: 6rem;
      height: 2rem;
      padding-left: 0.5rem;
      color: #000;
    }

    .preview {
      position: relative;
      grid-area: preview;
      display: grid;
      place-items: center;
      width: 100%;
      height: 100%;
      grid-template-rows: 3rem 1fr;

      .skeleton {
        display: grid;
        place-content: center;
        font-weight: 700;
        width: 100%;
        height: 100%;
        background: rgba(200, 200, 200, 0.1);
        border-radius: 0.375rem;

        &.loaded {
          display: none;
        }
      }

      .images {
        display: flex;
        gap: 8px;
        height: 100%;
        overflow: scroll;
        align-items: flex-start;

        canvas {
          width: 100%;
          height: auto;
        }
      }
    }

    .preference {
      grid-area: preference;
      display: grid;
      grid-template-rows: 3rem 1fr;

      form {
        display: grid;
        grid-template-rows: 1fr auto;
        align-items: center;

        .input {
          label {
            margin-top: 8px;
            display: inline-block;
            width: 160px;
          }

          input,
          select {
            width: 130px;
          }
        }

        .download {
          place-self: end;
          position: relative;
          height: 40px;

          .loading {
            width: 100%;
            position: relative;
            display: none;
            &:before {
              font-size: 3px;
              left: 60px;
              top: 22px;
            }
            &.downloading {
              display: block;
            }
          }

          input {
            padding: 12px 24px;
            background: var(--link);
            color: var(--bg);
            border: none;
            border-radius: 0.375rem;
            &[disabled] {
              background: #ccc;
              pointer-events: none;
            }
          }
        }
      }
    }
  }
}
