@import 'theme';
@import 'bootstrap.scss';

// crowi component
@import 'layout';
@import 'page';
@import 'page_list';
@import 'form';
@import 'wiki';
@import 'user';
@import 'portal';
@import 'search';
@import 'backlink';
@import 'notification';
@import 'attachments';
@import 'share';
@import 'tree';

a:hover {
  text-decoration: none;
}

ul {
  padding-left: 18px;
}

code {
  border-radius: 4px;
  background: lighten($pink, 40);
}

.mdi-svg {
  fill: currentColor;
  width: 1.12em;
  margin-top: -2px;
}

.mdi-svg.mdi-spin {
  -webkit-animation: mdi-spin 2s infinite linear;
  animation: mdi-spin 2s infinite linear;
}

@-webkit-keyframes mdi-spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(359deg);
    transform: rotate(359deg);
  }
}

@keyframes mdi-spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(359deg);
    transform: rotate(359deg);
  }
}

.meta {
  margin-top: 0;
  padding: 16px;
  color: #666;
  border-top: solid 1px #ccc;
  background: #f0f0f0;
  font-size: 0.95em;
  color: #888;

  .picture {
    width: 16px;
    height: 16px;
  }
}

.page-meta {
  margin-bottom: 0;
}

.form-text {
  font-size: .9em;
}

header nav ul img {
  vertical-align: middle;
}

footer, aside {
  h4:first-child, h3:first-child {
    margin-top: 0;
  }

  h4 {
    font-size: 1.1em;
  }
}


.form-element {
  margin-bottom: 1em;
}

footer {
  h4,
  h3 {
    margin-bottom: 0.5em;
    font-weight: normal;

    &:first-child {
      margin-top: 0;
    }
  }

  p {
    margin: 0.3em 0 0.5em 0;

    &:first-child {
      margin-top: 0;
    }
  }
}

.modal-backdrop {
  z-index: 1060;
}
.modal {
  z-index: 1061;
  p {
    font-size: 1em;
  }

  h3, h4 {
    font-size: 18px;
    margin: 0;
  }
}
.modal-body.alert {
  margin-bottom: 0;
  border-radius: 0;
}

.modal.create-page {
  .modal-body {
    h3, h4 {
      margin-bottom: 10px;
    }

    form {

      input {
        border: none;
        border-bottom: 1px dotted gray("800");
        border-radius: 0;
        padding-right: 6px;
        padding-left: 6px;
        background: gray("100");

        &:focus {
          background: gray("200");
        }
      }

      .page-today-form {
        display: flex;
        align-items: center;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;

        .page-today-input1 {
          width: 60px;
        }

        .page-today-input2 {
          flex: 1;
          min-width: 0;
        }

        .page-today-prefix,
        .page-today-suffix {
          padding: 6px;
        }
      }

      .page-under-tree-form {
        display: flex;
        align-items: center;

        > input {
          flex: 1;
          margin-right: 0.5rem;
        }
      }
    }
  }
}

.popular-page-high {
  color: #e80000;
  font-size: 1.1em;
  font-weight: bold;
}
.popular-page-mid {
  color: #e47800;
  font-weight: bold;
}
.popular-page-low {
  color: #ab7c7c;
}

.dropdown-menu {
   z-index: 10060;
  .dropdown-button {
    padding: 3px 20px;
  }
}

.notif {
  a {
  }

  .badge {
    position: absolute;
    top: 6px;
    right: 1px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: normal;
  }
}

.dropdown-menu {
  li {
    a {
      padding: 5px 20px;
    }
  }
}

// user picture
.picture {

  // 通常サイズ
  width: 24px;
  height: 24px;

  // size list
  &.picture-lg {
    width: 48px;
    height: 48px;
  }
  &.picture-sm {
    width: 16px;
    height: 16px;
  }
  &.picture-xs {
    width: 12px;
    height: 12px;
  }

  // design option
  &.picture-sq {
    border-radius: 2px;
    border: solid 1px #ccc;
  }
  &.picture-rounded {
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0,0,0,.3);
  }
}

.highlighted {
  color: #333;
  background-color: rgba(255,255,140,0.5);
  border-radius: 3px;
}

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


// buttons

$btn-google-color: rgb(204,89,71);
.btn-google {
  @include button-variant($btn-google-color, darken($btn-google-color, 20%));
}
$btn-github-color: rgb(68,68,68);
.btn-github {
  @include button-variant($btn-github-color, darken($btn-github-color, 20%));
}


input.searching {
  background: #fff url(/images/loading_s.gif) right no-repeat;
}
.search-list {
  padding: 0;

  li {
    list-style: none;
  }
  .list-link {
    padding-bottom: 5px;
    a {
      display: block;
      word-break: break-all;
      font-weight: bold;
      text-decoration: none;
      span {
        font-weight: normal;
      }
      &:hover {
        background: #f0f0f0;
        color: #666;
      }
    }
    .search-description {
      font-size: .8em;
      color: #999;
    }
  }

  .next-link {
    a {
      display: block;
      text-align: center;
    }
  }
}

// notification
.fk-notif {
  bottom: 0;
  left: 0;
  width: 100%;
  position: fixed;
  z-index: 1029;
  padding: 10px;
  box-shadow: -1px 0 3px 0px #666;
  font-weight: bold;
  transition: all .3s;

  &.fk-notif-danger {
    background: #b94a48;
    color: #fff;

    a {
      color: #f5ecf4;
      text-decoration: underline;
      &:hover {
        text-decoration: none;
      }
    }
  }

  &.fk-notif-warning {
    background: #fcf8e3;
    color: #8a6d3b;
  }
}
.on-edit .fk-notif {
  bottom: 50px;
  z-index: 1061;
}

// external-services
.crowi {
  .github-link {
    background: #e5f6f8;
    padding: 1px;
    border-radius: 3px;
    display: inline-block;
    border: solid 1px #ccc;
    color: #555;
    text-decoration: none;

    &:hover {
      background: #afdadf;
    }
  }
}

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

  & > * {
    box-shadow: 0 0 20px rgba(0, 0, 0, .8);
  }
}
.overlay-on {
  .container-fluid,
  .crowi-header {
    -webkit-filter: blur(5px);
    -moz-filter: blur(5px);
    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;
  }
}

.dropdown-menu-buttons {
  display: flex;
  flex-direction: column;

  & > button {
    margin: 0.5rem 1rem;
  }
}


// import
@import '../../node_modules/highlight.js/styles/tomorrow-night.css';
@import '../../node_modules/diff2html/bundles/css/diff2html.min.css';

// belows are from https://dev.materialdesignicons.com/getting-started/bootstrap
// to apply Material Design Icons into Bootstrap
.alert.mdi::before,
.breadcrumb .mdi::before,
.btn.mdi::before,
.card-title.mdi::before,
.card-subtitle.mdi::before,
.card-link.mdi::before,
.dropdown-item.mdi::before,
.list-group-item.mdi::before,
.nav-link.mdi::before {
  font-size: 1.25em;
  line-height: initial;
  position: relative;
  top: 0.09rem;
}
.alert.mdi::before,
.breadcrumb .mdi:not(:empty)::before,
.btn.mdi:not(:empty)::before,
.card-title.mdi:not(:empty)::before,
.card-subtitle.mdi:not(:empty)::before,
.card-link.mdi:not(:empty)::before,
.dropdown-item.mdi:not(:empty)::before,
.nav-link.mdi:not(:empty)::before {
  margin-right: 0.25rem;
}
.list-group-item.mdi:not(:empty)::before {
  margin-right: 0.5rem;
}
.dropdown-item.mdi:not(:empty)::before {
  margin-left: -0.75rem;
}
.alert.mdi::before,
.list-group-item.mdi:not(:empty)::before {
  margin-left: -0.5rem;
}
.modal-title.mdi::before {
  font-size: 1.5em;
  line-height: 0.5;
  position: relative;
  top: 0.26rem;
  margin-right: 0.5rem;
}
