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

.slideMode {
  user-select: none;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  height: 480px;
  position: relative;

  &,
  * {
    box-sizing: border-box;
  }

  &-Viewer {
    width: 100%;
    padding: 0;
    position: relative;
    background-color: #fff;
    border: 1px solid lighten(#999, 15%);
    border-bottom: 0;
    border-top-right-radius: 4px;
    border-top-left-radius: 4px;
    overflow: hidden;
    font-size: 2.2em;
    cursor: pointer;
    pointer-events: none;
    flex: 1;

    &_content {
      pointer-events: auto;
      height: 100%;
      padding: 1em;
      overflow-y: auto;

      * {
        pointer-events: none;
      }

      a,
      img {
        pointer-events: auto;
      }

      &--firstSlide {
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;

        h1 {
          margin-top: 0.8em;
          margin-bottom: 0.3em;
          padding-bottom: 0.3em;
          border-bottom: 1px solid lighten(#999, 20%);
          font-size: 1.2em;
          font-weight: bold;
          line-height: 1.2;
        }

        &Author {
          font-size: 0.4em;
          color: #999;
        }
      }
    }

    @media (max-width: $qiita-slide-mode-break-point-xs) {
      font-size: 1.3em;
    }

    @media (min-width: $qiita-slide-mode-break-point-s) {
      font-size: 1.6em;
    }

    @media (min-width: $qiita-slide-mode-break-point-m) {
      font-size: 1.9em;
    }

    @media (min-width: $qiita-slide-mode-break-point-l) {
      font-size: 2.2em;
    }

    .it-MdContent & {
      @media (min-width: $qiita-slide-mode-break-point-l) {
        font-size: 2em;
      }
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      margin-top: 1em;

      .emoji {
        vertical-align: text-top;
      }
    }

    h1 {
      font-size: 1.5em !important;
    }

    h2 {
      font-size: 1.3em !important;
    }

    > div > h1,
    > div > h2,
    > div > h3,
    > div > h4,
    > div > h5,
    > div > h6 {
      &:first-child {
        margin-top: 0;
        margin-bottom: 0.4em;
      }
    }

    > div > h1,
    > div > h2,
    > div > h3,
    > div > h4,
    > div > h5,
    > div > h6,
    &_content--firstSlide {
      &:only-child {
        border-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
        padding-bottom: 0;
        width: 90%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-weight: bold;
        font-size: 1em;
        text-align: center;
        line-height: 1.3;
      }

      .fa-link {
        display: none;
      }
    }

    h1 {
      margin: 1em 0 !important;
    }

    > div > h1:only-child {
      font-size: 2.5em;
    }

    p:only-child > a:only-child img {
      margin-bottom: 0;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 80%;
    }

    img {
      max-width: 100%;
    }

    .emoji {
      width: 0.8em;
      height: 0.8em;
      vertical-align: baseline;
    }

    p {
      margin: 0 0 0.6em;
      line-height: 1.6;
    }

    ul,
    ol {
      margin: 0 0 0.6em;
    }

    ul {
      padding-left: 1.2em;
    }

    li {
      margin-bottom: 0.3em;
      line-height: 1.4;
    }

    .code-frame {
      pointer-events: auto;

      pre {
        cursor: text;
        font-size: 0.7em;
      }
    }

    .task-list-item-checkbox {
      margin-left: -1em;
      transform: scale(1.5);
      vertical-align: text-top;
    }
  }

  &-Dashboard {
    margin: 0;
    padding: 0 5px;
    width: 100%;
    min-height: 50px;
    background: linear-gradient(to bottom, #59bb0c 0%, desaturate(#59bb0c, 20%) 100%);
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
    color: #fff;
    display: flex;
    align-items: center;

    &-Team {
      background: linear-gradient(to bottom, #458ac5 0%, darken(#458ac5, 10%) 100%);
    }

    &_button {
      transition: color 0.1s linear;
      padding: 15px;
      background-color: transparent;
      border: 0;
      outline: 0;
      color: #42860d;
      font-size: 14px;
      cursor: default;

      &--clickable {
        color: lighten(desaturate(#59bb0c, 40%), 30%);
        cursor: pointer;

        &:hover {
          color: #fff;
        }
      }

      &-Team {
        color: #20517b;

        &.slideMode-Dashboard_button--clickable {
          color: lighten(#458ac5, 20%);
          cursor: pointer;

          &:hover {
            color: #fff;
          }
        }
      }
    }

    &_pageCount {
      min-width: 45px;
      margin: 0 10px;
      padding-right: 10px;
      font-size: 10px;
      text-align: right;
    }

    &_progress {
      cursor: pointer;
      display: flex;
      align-items: stretch;
      background: gray;
      flex: 1;
      height: 10px;
      border-radius: 4px;
      overflow: hidden;
      background: #428b09;
      margin-right: 8px;

      &-Team {
        background-color: lighten(#458ac5, 30%);
      }
    }

    &_progressFill {
      transition: width 0.15s ease-out;
      background: #c6e6ad;

      &-Team {
        background-color: darken(#458ac5, 15%);
      }
    }

    &_logo {
      width: 48px;
      margin-right: 8px;
      height: 16px;
      fill: #fff;
      margin-left: 8px;
    }
  }

  &-Tooltip {
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(0, 0, 0, 0.85);
    position: absolute;
    margin-left: 131px;
    margin-top: 0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    letter-spacing: 3px;
    animation: slideModeFadeIn 0.25s ease-out;
    bottom: 42px;
    pointer-events: none;

    &::after {
      content: "";
      position: absolute;
      left: calc(50% - 14px);
      bottom: -18px;
      border: solid 14px transparent;
      border-top: solid 10px rgba(0, 0, 0, 0.85);
      border-bottom: solid 10px transparent;
    }
  }

  .editorPreview_article & &_preview {
    padding: 0.7em;
    font-size: 2vw;
  }

  code.code {
    white-space: pre;
  }

  &.fullscreen {
    z-index: $qiita-slide-mode-fullscreen-z-index;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin: 0;
    height: 100%;

    .slideMode-Dashboard {
      border-bottom-right-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
}
