html, body { max-height: 100vh; }

body {
  background-color: #f5f7fa;
  overflow: hidden;
}

#body{
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: flex-start;
}

#alert{
  display: none;
  position: absolute;
  top: 80px;
  right: 0;
  min-width: 200px;
  width: 300px;
  height:auto;
  z-index: 1050;

  &.active {
    display: block;
  }
}

/*nav*/
#navbar {
  visibility: visible;

  h1 {
    font-size: 1.6rem;
  }

  .btn {
    background-color: #1a3e79;
    color: #ffffff;

    &:hover{
      background-color: #1d4d9b;
    }
  }

  .navbar-nav{
    .nav-item:not(:last-child) .nav-link:after{
      content: "\00B7";
      margin-left: 15px;
      font-weight: bold;
    }

    .nav-link{
      cursor: pointer;
    }
  }
}

/*div main*/
#main {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(250px, 370px) 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "history pdf";
  overflow: hidden;
  position: relative;

  & > *{
      border-right: 2px solid #eeeeee;
      padding: 15px;
  }
}

/*main*/
#pdf {
  grid-area: pdf;
  padding-bottom: 20px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  height: 100%;

  .pdf-content{
    grid-row-start: 1;
    grid-row-end: 2;

    .pdf-identificador{
      background-color: #edeff2;
      color: #b1b1b1;
    }
  }

  .pdf-doc{

    grid-row-start: 2;
    grid-row-end: 3;
    height: 100%;
    width: 100%;

    iframe {
      width: 100%;
      height: 100%;
      border: none;
      border-top: 2px solid #515559;
      padding-bottom: 20px;
    }

    &.fullscreen {
      iframe {
        height: calc(100% ~' - 38px');
        padding-bottom: 0;
      }
    }

    .btn-group{
      max-width: 200px;

      label.btn {
        border-radius: 0;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;

        &.not-active {
          pointer-events: none;
          opacity: 0.5;
        }

        &.active, &:hover {
          background-color: #515559;
          color: #ffffff;
        }
      }
    }
    .btn-fullscreen {
      float: right;
      clear: both;

      border-radius: 0;
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
    }
  }
}

/*aside*/
#history {
  grid-area: history;
  overflow: auto;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  overflow: auto;

  #history-list{
    height: 100%;

  }

  .card-history {
    position: relative;

    .card-order {
      position: absolute;
      top: 0;
      right: 0;
      z-index: 1;
      padding: 6px;
      text-align: center;
      border-bottom-left-radius: 5px;
      border-top-right-radius: 4px;
    }

    .card .card-body {
      padding: 1rem;
    }
  }
}

footer {
  margin-top: 5px;
  background-color: #ffffff;
  box-shadow: 0 3px 1rem rgba(0, 0, 0, 0.10) !important;
  z-index: 1;
}


/*animations*/
.animation-up-down{
  opacity: 0.8;
  transform: translateY(-5px);
  animation-name: up_down;
  animation-duration: 1s;
  animation-fill-mode: forwards;
}

/*keyframes*/
@keyframes up_down{
  from {
    transform: translateY(-5px);
    opacity: 0.8;
  }
  to{
    transform: translateY(0px);
    opacity: 1;
  }
}

/*functions/mixins*/
.animate-delay-loop(10);

.animate-delay-loop(@n, @i: 1) when (@i =< @n) {
  .animation-up-down:nth-child(@{i}) {
    animation-delay: (100ms + (@i * 35));
  }
  .animate-delay-loop(@n, (@i + 1));
}


/*utils*/
.shadow-h-md {
  transition: all 0.2s ease-in-out;

  &:hover{
    box-shadow: 0 3px 1rem rgba(0, 0, 0, 0.10) !important;
  }
}

.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  overflow: auto;
  background: #f5f7fa;
  z-index: 2000;
}

/*scrollbar*/
/* width */
::-webkit-scrollbar {
  width: 8px;
}

/* Track */
::-webkit-scrollbar-track {
  background: #f1f1f1;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #adadad;
}

/*media queries*/
@media (max-width: 800px)
{

  #navbar {
    .navbar-nav{
      .nav-item:not(:last-child) .nav-link:after{
        content: "";
        margin-left:0;
      }
    }
  }
  #main {
    &[data-div="history"] {
      grid-template-areas: "history history";

      #pdf{
        display: none;
      }
    }

    &[data-div="pdf"] {
      grid-template-areas: "pdf pdf";

      #history{
        display: none;
      }
    }
  }
}

