// import diff2html styles
@import "~diff2html/dist/diff2html.css";

.main-container {
  // padding controll of .header-wrap and .content-main are moved to _layout and _form

  /*
   * header
   */
  header {
    // the container of h1
    div.title-container {
      margin-right: auto;
    }

    .btn-copy, .btn-copy-link, .btn-edit {
      @extend .text-muted;
      opacity: 0.3;
      border: none;
      &:not(:hover) {
        background-color: transparent;
      }
    }
    // change button opacity
    &:hover {
      .btn.btn-copy, .btn-copy-link, .btn.btn-edit {
        opacity: unset;
      }
    }

    .like-button, .bookmark-link {
      border: none;
      font-size: 1.2em;
      line-height: 0.8em;
      &:not(:hover):not(.active) {
        background-color: transparent;
      }
    }
    .like-button {
      &.active {
        @extend .btn-info;
      }
    }
    .bookmark-link {
      &.active {
        @extend .btn-warning;
      }
    }

    .url-line {
      color: #999;
      font-size: 1rem;
    }

    h1#revision-path {
      margin-top: 0;
      margin-bottom: 0;
      .d-flex {
        flex-wrap: wrap;  // for long page path
      }

      // crowi layout only
      a.last-path {
        color: #ccc;

        &:hover {
          color: inherit;
        }
      }

    }
  }

  // alert component settings
  .alert-trash, .alert-moved, .alert-unlinked, .alert-grant {
    padding: 10px 15px;
  }

  // show PageStatusAlert in default
  #page-status-alert .myadmin-alert {
    display: block;
  }
}

.main-container .main .content-main .revision-history { // {{{

  .revision-history-list {
    .revision-history-outer {
      // add border-top except of first element
      &:not(:first-of-type) {
        border-top: 1px solid $border;
      }

      .revision-history-main {
        .picture-lg {
          width: 32px;
          height: 32px;
        }
        .revision-history-meta {
          a:hover {
            cursor: pointer;
          }
        }

        .caret {
          transform: rotate(-90deg);
          transition: 0.4s;

          &.caret-opened {
            transform: rotate(0deg);
          }
        }
      }
      .revision-history-main-nodiff {
        .picture-container {
          min-width: 32px;
          text-align: center; // centering .picture
        }
      }
      .revision-history-diff {
        padding-left: 40px;
      }
    }

    li {
      position: relative;
      list-style: none;
    }
  }
  // compacted list
  .revision-history-list-compact {
    .revision-history-outer-contiguous-nodiff {
      border-top: unset !important; // force unset border
    }
  }

  // adjust
  // this is for diff2html. hide page name from diff view
  .d2h-file-header {
    display: none;
  }
  .d2h-diff-tbody {
    background-color: white;
  }

} // }}}


/**
 * for table with handsontable modal button
 */
.editable-with-handsontable {
  position: relative;

  .handsontable-modal-trigger {
    opacity: 0;
    position: absolute;
    top: 11px;
    right: 10px;
    padding: 0;
    border: none;
    background-color: transparent;
    font-size: 16px;
    line-height: 1;
    vertical-align: bottom;
  }

  .page-mobile & .handsontable-modal-trigger {
    opacity: 0.3;
  }

  &:hover .handsontable-modal-trigger {
    opacity: 1;
  }
}

/*
 * for Presentation
 */
.fullscreen-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s ease-out;

  & > * {
    box-shadow: 0 0 20px rgba(0, 0, 0, .8);
  }
}
.overlay-on {
  #wrapper {
    filter: blur(5px);
  }

  .fullscreen-layer {
    opacity: 1;
    height: 100%;
  }
}

#presentation-container {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
  background: #000;

  iframe {
    width: 100%;
    height: 100%;
    border: 0;
  }
}
