/* Sizes must be defined for child elements to use them in fluid calculations. */
#pagewrapper {
  height: 100%;
  height: 100vh;
  display: -webkit-flex;
  display:         flex;
  -webkit-flex-flow: column;
          flex-flow: column;
  min-width: 630px;
  min-height: 675px;
  top: 0; /* this is why we can't have nice things. See #776 */
}

#timerSection,
#statusbar,
#questions,
#notes,
#topbar,
#presenterPopup {
  font-size: .8em;
}

#topbar,
#topbar a,
#topbar .ui-widget,
#presenterPopup,
#notes-wrapper {
  color: #ffffff;
  background-color: #546E7A;
}

#topbar {
  display: flex;
  flex-flow: row;
  line-height: 3em;
  height: 3em;
  box-shadow:0 0 1em rgba(0,0,0,0.35);
  z-index: 3;
}

  #topbar a,
  #topbar .ui-widget {
    text-decoration: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }

  #topbar a i {
    padding-left: .25em;
  }

  #topbar a:hover,
  #topbar .ui-widget:hover {
    background-color: #263238;
  }
  #topbar a:active,
  #topbar a.enabled:active,
  #topbar .ui-widget:active {
    background-color: #2e424c;
  }

  #close-sidebar {
    padding: .25em;
    transition: all 200ms;
  }
    #close-sidebar.disabled {
      color: grey;
    }
    #close-sidebar.disabled:hover {
      background-color: transparent;
      cursor: default;
    }

  #slideSource {
    float: right;
  }

  #links {
    display: flex;
    flex-shrink: 0;
    margin: 0 0 0 auto;
  }

  #links a,
  #topbar .ui-widget {
    display: inline-block;
    padding: 0 1em;
  }

  #topbar .ui-button {
    border: none;
    border-radius: 0;
    line-height: 3em;
    vertical-align: inherit; /* overrides a jquery-ui style */
  }

  #links a.enabled,
  #topbar .ui-state-active {
    background-color: #263238;
  }
  #links a.warning {
    background-color: #8e030a;
  }

  #links .mobile {
    display: none;
  }

  .desktop span {
    margin: 0 0.5em;
  }

#presenterPopup {
  display: none;
  position: absolute;
  z-index: 2147483647;
  top: 2.95em;
  left: 25%;
  max-height: 80%;
  width: 50%;
  padding-bottom: 1em;
  border-radius: 0 0 .5em .5em;
  overflow: auto;
  background-color: #263238;
}

  #presenterPopup a {
    color: #ffffff;
  }

  #presenterPopup #stats .zoomline {
    color: #000;
  }

#main {
  display: -webkit-flex;
  display:         flex;
  -webkit-flex-flow: row;
          flex-flow: row;
  -webkit-flex: 5;
          flex: 5;
  background-color: #fff;
  min-height: 0px;
}
  #sidebar {
    display: -webkit-flex;
    display:         flex;
    -webkit-flex-flow: column;
            flex-flow: column;
    -webkit-flex: 1;
            flex: 1;
    -webkit-order: 0;
            order: 0;
    min-width: 210px;
    padding: 0;
    margin: 0;
    background-color: #fff;
    box-shadow:0 0 1em rgba(0,0,0,0.35);
    z-index: 3;
  }
    #timerSection {
      margin-bottom: 0.25em;
      height: 2.15em;
      min-height: 2.15em;
      line-height: 2.15em;
      vertical-align: middle;
    }
    #timerSection.open {
      height: 100px;
      min-height: 100px;
    }

    #timerDisplay {
      height: 100px;
      width: 100px;
    }

    #timerDisplay.paused {
      -webkit-filter: grayscale(100%);
      filter: grayscale(100%);
      opacity: 0.25;
    }

    #timerSection input[type='button'] {
      margin: 2px 0px;
    }

    #timerSection #startTimer {
      float: right;
    }
    #timerSection #pauseTimer {
      float: left;
      position: absolute;
      display: none;
    }
    #timerSection #stopTimer {
      float: right;
      display: none;
    }
    #timerSection #timerDisplay {
      display: none;
      margin: 0 auto;
    }

    .intervalHalf,
    .intervalQuarter,
    .intervalWarning,
    .intervalCritical {
      -webkit-transition: background-color 1000ms linear;
      -moz-transition:    background-color 1000ms linear;
      -o-transition:      background-color 1000ms linear;
      -ms-transition:     background-color 1000ms linear;
      transition:         background-color 1000ms linear;
    }
    .intervalHalf     { background: #99ff99; }
    .intervalQuarter  { background: #ffff66; }
    .intervalWarning  { background: #ffcc66; }
    .intervalCritical { background: #ffcccc; }

    #feedbackPace {
      height: 40px;
      min-height: 40px;
      position: relative;
      border-bottom: 1px solid #ccc;
    }
      #feedbackPace .gradient {
        position: absolute;
        bottom: 0;
        width: 100%;
        height: 20px;
        background-color:#ff0000;
        filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr=#ff0000, endColorstr=#eeff00);
        background-image:-moz-linear-gradient(left, #ff0000 10%, #eeff00 30%,#00ff00 50%,#eeff00 70%,#ff0000 90%);
        background-image:linear-gradient(left, #ff0000 10%, #eeff00 30%,#00ff00 50%,#eeff00 70%,#ff0000 90%);
        background-image:-webkit-linear-gradient(left, #ff0000 10%, #eeff00 30%,#00ff00 50%,#eeff00 70%,#ff0000 90%);
        background-image:-o-linear-gradient(left, #ff0000 10%, #eeff00 30%,#00ff00 50%,#eeff00 70%,#ff0000 90%);
        background-image:-ms-linear-gradient(left, #ff0000 10%, #eeff00 30%,#00ff00 50%,#eeff00 70%,#ff0000 90%);
        background-image:-webkit-gradient(linear, left bottom, right bottom, color-stop(10%,#ff0000), color-stop(30%,#eeff00),color-stop(50%,#00ff00),color-stop(70%,#eeff00),color-stop(90%,#ff0000));
      }
      #feedbackPace .obscure {
        position: absolute;
        background-color: #f0f0f0;
        bottom: 0;
        height: 20px;
        transition: width 0.25s;
      }
      #feedbackPace .obscure.left {
        left: 0;
        width: 50%;
        border-right: 1px solid black;
      }
      #feedbackPace .obscure.right {
        right: 0;
        width: 50%;
        border-left: 1px solid black;
      }

      #paceFast,
      #paceSlow {
        display: none;
      }
      #paceFast {
        float: left;
        margin-left: 1em;
      }
      #paceSlow {
        float: right;
        margin-right: 1em;
      }
      #paceMarker {
        left: 50%;
        position: absolute;
        transform: translate(-50%, -50%);
        -webkit-transform: translate(-50%, 0);
        -moz-transform: translate(-50%, 0);
        -ms-transform: translate(-50%, 0);
        -o-transform: translate(-50%, 0);
        transition: left 0.25s;
      }

    .submenu {
      flex-grow: 10;
      display: block;
      overflow-x: hidden;
      overflow-y: auto;
    }

    #questions {
      -webkit-flex: 1;
              flex: 1;
      -webkit-order: 0;
              order: 0;
      min-width: 210px;
      min-height: 210px;
      height: 210px;
      border-top: 3px solid #ccc;
      overflow: auto;
    }

    #questions #answered li {
      text-decoration: line-through;
      color: #ccc;
    }

    #questions #unanswered li:hover {
      background-color: #dedede;
    }
    #questions #unanswered li:hover:after {
      font-family: FontAwesome;
      font-style: normal;
      font-weight: normal;
      text-decoration: inherit;
      padding: 0 8px;
      float: right;
      content: "\f058"; /* fa-check-circle */
    }

    #questions li {
      cursor: default;
    }


  #presenter {
    display: -webkit-flex;
    display:         flex;
    -webkit-flex-flow: column;
            flex-flow: column;
    -webkit-flex: 4;
            flex: 4;
    -webkit-order: 1;
            order: 1;
    min-width: 0px;
    justify-content: space-between;
    background-color: #ECEFF1;
  }
    #frame {
      display: -webkit-flex;
      display:         flex;
      -webkit-flex-flow: row;
              flex-flow: row;
      -webkit-flex: 10;
              flex: 10;
      min-height: 250px;
    }


    #preview {
      position: relative;
      -webkit-flex: 10;
              flex: 10;
      overflow: hidden;
      padding: 1em;
    }

    /* thumbnails layout */
      #preview.thumbs {
        padding-top: 100px;
      }
      #preview .thumb {
        display: none;
        position: absolute;
        top: 0;
        padding: 1em;
      }
        #nextSlide.thumb .label {
          text-align: right;
        }

      #preview .thumb .container {
        overflow: hidden;
        height: 150px;
        width: 200px;
        top: 0;
        background-color: #ffffff;
        box-shadow:0 0 1em rgba(0,0,0,0.35);
      }
        #preview .thumb .content {
          transform: scale(.5);
          transform-origin: 0 0;
          width: 200%;
        }

        #prevSlide.thumb {
          left: 0;
        }

        #nextSlide.thumb {
          right: 0;
        }

        #preview.thumbs #preso {
          position: absolute;
          bottom: 1em;
          margin-left: auto;
          margin-right: auto;
          left: 0;
          right: 0;
        }

        /* allow us to actually see images! */
        #navigationHover img,
        .thumb img {
          width: 100%;
          height: 100%;
        }

    /* beside layout */
      #preview.beside .thumb {
        display: none;
        overflow: hidden;
        width: 34%;
        padding: 1em;
      }
        #preview.beside .thumb .container {
          width: auto;
        }

        #nextSlide.beside {
          right: 1em;
        }
        #preview.beside #preso {
          position: absolute;
          left: 1em;
        }


      #preview input[type=button].display {
        display: inline;
      }
      #preview .tools input[type=submit] {
        display: none;
      }

      .correct {
        font-weight: 900;
      }

      #preview img#disconnected {
        margin: 0.5em 1em;
        float: none;
        position: absolute;
        bottom: 0;
        left: 0;
      }

      #preview .incremental.hidden {
        visibility: visible;
        color: #ccc;
      }
      #preview .inverse .incremental.hidden {
        color: #404040;
      }

    /* floating layout */
    body.floating {
      margin: 0.5em;
      width: unset !important;
      max-width: unset !important;
    }
      body.floating.next {
        transform: scale(.5);
        transform-origin: 0 0;
        width: 200% !important;
      }
      html > body.floating.notes,
      body.floating.notes {
        overflow: auto;
        height: auto;
      }


    #preso {
      box-shadow:0 0 1em rgba(0,0,0,0.35);
      position: absolute;
    }

    #statusbar {
      padding: 0 1em;
    }
    #progress {
      width: 100%;
      height: 8px;
      background-color: transparent;
    }
      #progress.ui-widget.ui-widget-content{
        border: none;
        border-radius: 0;
      }
      #progress .ui-progressbar-value {
        border: none;
        background: #f44336;
        border-radius: 0;
      }
    #debugInfo {
      display: inline;
    }

  #annotationToolbar {
    display: -webkit-flex;
    display:         flex;
    -webkit-flex-flow: column;
            flex-flow: column;
    -webkit-flex: 0.5;
            flex: 0.5;
    -webkit-order: 2;
            order: 2;
    min-width: 48px;
    width: 48px;
    padding: 0;
    margin: 0;
    background-color: black;
    color: white;
    text-align: center;
  }
    #annotationToolbar label {
      font-size: 0.8em;
      padding-top: 1em;
      margin-bottom: 1px;
      border-bottom: 1px solid #ccc;
    }
    #annotationToolbar i {
      padding: 5px;
      margin: 0 6px;
      border-radius: 3px;
    }
    #annotationToolbar i:hover {
      background-color: #555;
    }
    #annotationToolbar i.active {
      background-color: #003d96;
      border: 1px solid white;
    }
    #annotationToolbar i.lines.color1 { color: red    }
    #annotationToolbar i.lines.color2 { color: cyan   }
    #annotationToolbar i.lines.color3 { color: orange }
    #annotationToolbar i.lines.color4 { color: green  }
    #annotationToolbar i.shapes.color1 { color: red    }
    #annotationToolbar i.shapes.color2 { color: cyan   }
    #annotationToolbar i.shapes.color3 { color: orange }
    #annotationToolbar i.shapes.color4 { color: green  }


#notes-wrapper {
  box-shadow:0 0 1em rgba(0,0,0,0.35);
}

#notes {
  overflow: auto;
  height: 210px;
  padding: 0 1em;
  display: block;
  position: relative;
  top: auto !important; /* jquery-ui-resizable mucks with this */
  background-color: #ffffff;
  color: #222;
}
  #notes.hidden {
    display: none;
  }

  .section-selector {
    display: inline-block;
    padding: 0;
    margin: 0;
    text-align: center;
    font-size: 0.8em;
  }
  .section-selector li {
    display: inline;
    padding: .1em 1em;
  }

  .section-selector li a {
    color: #ffffff;
    text-decoration: none;
  }

  .section-selector li.selected {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    background-color: #ffffff;
  }

  .section-selector li.selected a {
    color: #222;
  }

  .controls {
    float: right;
    margin-right: .5em;
  }
    .controls .spacer {
      display: inline-block;
      width: 1em;
    }
    .controls .fa {
      font-size: 1em;
      text-decoration: none;
    }
    .controls a,
    .controls i {
      color: #fff;
    }
    .controls .small {
      font-size: 0.75em;
      vertical-align: 15%;
    }
    .controls .notes-grippy {
      top: auto;
      position: relative;
      display: inline;
      cursor: row-resize;
    }

  #notes ol { list-style-type: decimal; }
  #notes ul { list-style-type: disc; }

  #notes .element {
    display: inline-block;
    width: 90%;
  }

  .slide.activity .count,
  #notes .count {
    display: inline-block;
    background-color: #2e2e2e;
    color: #ffffff;
    font-size: 2.5em;
    vertical-align: top;
    border-radius: .2em;
  }

  #notes .personal {
    float: right;
    border-left: 4px solid #999;
    border-bottom: 4px solid #999;
    border-radius: 0 0 0 0.5em;
    padding: 0.1em 0 0.25em 0.25em;
    margin: 0 -1em 1em 1em;                  /* compensate for the padding in the #notes section */
    background: #eee;
    max-width: 25%;
  }

  #notes .personal h1 {
    margin-top: 0;
    border-bottom: 1px solid #ccc;
    font-size: 1.5em;
  }

  #notes .pagebreak {
    display: none;
  }

.slide.activity .count {
  position: absolute;
  bottom: .25em;
  right: .5em;
  padding: 0 0.25em;
}


a.controls {
  text-decoration: none;
  padding: 0 0.25em 0.1em 0.25em;
  background-color: #fff2ce;
  border: 1px solid #ccc;
  -moz-border-radius: 0.5em;
  -webkit-border-radius: 0.5em;
  -khtml-border-radius: 0.5em;
  border-radius: 0.5em;
}

/* hide some elements when the screen is too small */
@media screen and (max-width: 1024px) {
  #links .fa {
    display: none;
  }
}

@media screen and (max-width: 880px) {
  #topbar #printSlides,
  #topbar #statslink {
    display: none;
  }
}

/* iPhone */
/* Portrait */
@media screen and (max-width: 640px) {
  .no-mobile {
    display: none;
  }

  #pagewrapper {
    min-width: 0;
  }

  #main {
    -webkit-flex-flow: column;
            flex-flow: column;
    -webkit-flex: 1;
            flex: 1;
  }
  #frame {
    -webkit-flex: 4;
            flex: 4;
  }
    #questions {
      -webkit-flex: 1;
              flex: 1;
    }
    #notes {
      -webkit-flex: 3;
              flex: 3;
      margin: 0;
    }
  #topbar,#main,#center,#preview,#bottom,#sidebar {
    margin: 0;
    padding: 0;
  }

  #slideFile {
    display: inline-block;
    width: 205px;
    max-width: 205px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  #links .desktop,
  #separator,
  #stylepicker,
  #layoutSelector {
    display: none !important;
  }
  #links {
    top: 0.5em;
    padding: 0 0.5em;
  }
  #links .mobile {
    display: inline;
  }

  #sidebar {
    display: block;
    position: absolute;
    z-index: 99999;
    height: 100%;
    overflow: scroll;
    display: none;
  }
    #timerSection,
    #feedbackPace {
      display: none;
    }


  #statusbar {
    height: auto;
    line-height: inherit;
  }
  #enableAnnotations,
  #enableRemote,
  #enableFollower {
    border: none;
    margin: 0;
    padding: 0;
  }
  #annotationsToggle,
  #remoteToggle,
  #followerToggle {
    line-height: 1em;
    height: 1em;
    margin: 0 0 0 0.25em;
    padding: 0;
  }
  #bottom {
    height: 245px;
    overflow: auto;
  }
  #preso {
    width: 976px;
    margin: 0;
    padding: 0;
    margin-left:auto;
    margin-right:auto;
  }
  #preso .slide {
    width: 100%;
    margin: 0;
    padding: 0;
  }
}
@media screen and (pointer: coarse)
{
  #buttonNav {
    position: initial;
  }
}
