@use '../../scss/variables' as *;

.app-layout {
  display: flex;
  flex: 1 0 auto;
  width: 100%;

  &.is-focus-mode {
    .app-layout__source-column {
      overflow: hidden;
      opacity: $fade-alpha;
      width: 0;
      transition:
        width 0.2s ease-in-out,
        opacity 0.2s ease-in-out;
    }

    .app-layout__note-column {
      border-left-width: 0;
      transition: border-left-width 0.2s;
    }

    @media only screen and (max-width: $single-column) {
      .app-layout__source-column {
        overflow: inherit;
        opacity: 1;
        width: inherit;
      }

      .app-layout__note-column {
        transition: inherit;
      }
    }
  }

  &.is-navigation-open {
    pointer-events: none;

    &::before {
      content: '';
      background-color: var(--overlay-color);
      display: block;
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      width: 100%;
      z-index: 1;
    }

    @media only screen and (max-width: $single-column) {
      .app-layout__note-column {
        opacity: 0;
      }

      &::before {
        display: none;
      }
    }
  }

  &.is-note-open {
    .app-layout__source-column {
      transition: opacity 0.2s ease-in-out;
    }

    @media only screen and (max-width: $single-column) {
      .app-layout__source-column {
        opacity: 0;
        pointer-events: none;
      }

      .app-layout__note-column {
        opacity: 1;
        z-index: auto;
      }
    }
  }
}

.app-layout__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex: 1 0 auto;

  .logo {
    width: 200px;
    height: 200px;
    animation: pulse 2s infinite ease-in-out;

    path {
      fill: var(--secondary-color);
    }
  }

  @keyframes pulse {
    0% {
      opacity: 1;
      transform: scale(1);
    }

    50% {
      opacity: 0.85;
      transform: scale(1.05);
    }

    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
}

.app-layout__source-column {
  width: $note-list-width;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 200ms ease-in-out;

  @media only screen and (max-width: $medium) {
    width: 300px;
  }

  @media only screen and (max-width: $single-column) {
    flex: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: $anim-transition;
    opacity: 1;
    pointer-events: auto;
  }
}

.app-layout__note-column {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  border-left: 1px solid var(--secondary-color);

  @media only screen and (max-width: $single-column) {
    position: absolute;
    flex: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: -1;
    transition: $anim-transition;
  }
}
