@import 'shared';

.root {
  // Spacing
  --line-width: 2px;
  --dot-width: 12px;
  --padding: 50px;
  --gap: 40px;

  // Palette
  --text-color: #333;
  --background-color: #f7f8fa;
  --dot-color: #2a74da;
  --line-background: #e0e0e0;
  --line-growing-line: #5a5a5a;
  --curve-color: magenta;

  width: 100vw;
  min-height: 100svh;
  padding: var(--padding);
  text-align: left;
  color: var(--text-color);
  background-color: var(--background-color);

  .instructions {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;

    p {
      text-transform: none;
    }

    select {
      @include font-body;
      background-color: var(--background-color);
      border: var(--line-width) solid var(--line-background);
      border-radius: px(8);
      color: var(--text-color);
      padding: px(3) px(10) px(3) px(5);
      min-width: px(100);
      max-width: fit-content;
      position: relative;
      cursor: pointer;
      transition: border-color 0.3s;

      &:hover,
      &:focus {
        border-color: var(--dot-color);
        outline: none;
      }
    }
  }

  .eases {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    margin-top: var(--gap);

    .curveContainer {
      outline: 1px dashed var(--curve-color);
      border-radius: 5px;
      padding: calc(var(--padding) / 2);
      width: min-content;

      .titleContainer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        gap: 30px;
      }

      .graphContainer {
        width: min-content;
        display: grid;
        grid-template-columns: repeat(2, auto);
        gap: var(--ui-gap);
        gap: 40px;

        p {
          color: var(--secondary-text-color);
        }

        :global(.background),
        :global(.line) {
          position: absolute;
          width: 100%;
          height: 100%;
          transform-origin: bottom left;
        }

        :global(.background) {
          background-color: var(--line-background);
        }

        :global(.line) {
          background-color: var(--line-growing-line);
        }

        :global(.dot) {
          @include transform-center-horiz;
          background-color: var(--dot-color);
          position: absolute;
          bottom: calc(var(--dot-width) / 2 * -1);
          width: var(--dot-width);
          height: var(--dot-width);
          z-index: 1;
          border-radius: 50%;
        }

        .editor {
          position: absolute;
          padding: 0;
          margin-top: -77px;

          svg {
            fill: transparent;
          }
        }

        .vertical {
          height: var(--size);
          width: var(--line-width);
          position: relative;

          > p {
            position: absolute;
            left: -3em;
            bottom: 50%;
            transform: rotate(-90deg);
          }
        }

        .horizontal {
          position: relative;
          width: var(--size);
          height: var(--line-width);

          > p {
            @include transform-center-horiz;
            position: absolute;
            top: -2em;
          }
        }

        .graph {
          path {
            stroke-width: var(--line-width);
            fill: none;
          }

          .mainPath {
            stroke: var(--line-growing-line);
          }

          .grid {
            stroke: var(--line-background);
          }
        }
      }

      .bezier {
        position: relative;
        margin: 15px 0 0;
        font-size: 12px;
        font-family: monospace;
      }
    }
  }

  pre {
    background-color: var(--text-color);
    color: var(--background-color);
    border-radius: 2px;
    padding: 3px 9px;
    margin: 0;
    width: fit-content;
    font-size: 12px;
  }

  p {
    font-size: 12px;
  }

  button {
    font-size: 12px;
    border: 1px solid rgba($black, 0.2);
    padding: 5px;
  }
}
