/*!
 * Start Bootstrap - Simple Sidebar HTML Template (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

/* Toggle Styles */

body.jscoq-main * {
  box-sizing: border-box;
}

body.jscoq-main {
  margin: 0;
  padding: 0;
  font-family: Helvetica, Geneva, Swiss, Arial, SunSans-Regular, sans-serif;
  font-size: 11pt;
  overscroll-behavior-y: none;
}

a, a:link, a:visited, a:active {
  text-decoration: none;
}

#ide-wrapper {
  height: 100vh;
  margin-right: auto;
  margin-left: auto;
  overscroll-behavior: none;
}

#ide-wrapper.layout-fixed {
  padding-right: 45%;
  transition: padding 0.5s ease;
}

#ide-wrapper.layout-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

#ide-wrapper.layout-fixed.toggled {
  padding-right: 0px;
}

#ide-wrapper.layout-flex > * {
  flex-grow: 1;
  flex-shrink: 1;
  overflow-x: hidden;
  max-height: 100%;
  box-sizing: border-box;
}

#ide-wrapper.layout-flex > #panel-wrapper {
  overflow-x: visible;  /* needed for power button to be visible */
}

#ide-wrapper #document {
  max-width: 51em;
}

.on-hold * {
  cursor: progress !important;
}

/* CodeMirror */

.jscoq.CodeMirror {
  font-size: 11pt;
  height: 100%;  /* auto-size to fit content */
  line-height: initial;
}

.jscoq.CodeMirror span[role=presentation] {
  line-height: 12px;  /* because some characters are too tall (due to alternative font glyph rendering) */
  font-family: monospace, times, Arial Unicode MS;
}

.coq-crosshair .jscoq.CodeMirror .CodeMirror-lines {
  cursor: crosshair;
}

.jscoq.CodeMirror .CodeMirror-crosshair {
  cursor: text; /* overrides CodeMirror (normally set when Alt is held) */
}

.jscoq.CodeMirror .CodeMirror-dialog {
  padding: .75em;
}

.jscoq.CodeMirror .CodeMirror-dialog a.dialog-link {
  cursor: pointer;
  text-decoration: underline;
  font-family: sans-serif;
  font-size: 80%;
  padding-left: 2em;
}

/*
 * This is here for the time interval between document load and creation of
 * the CodeMirror editors from textareas.
 */
#ide-wrapper textarea {
  width: 100%;
  height: auto;
  padding: 4px;
  margin-bottom: .5em;
  border: 1px dashed #888;
  font-family: monospace;
  font-size: 80%;
}

/* Panel and sub-panels */

#panel-wrapper {
  padding: 0;
  width: 45%;
  height: 100%;
  transition: width 0.5s ease;
  z-index: 20;  /* notice: CodeMirror-dialog is at index 15 */

  font-family: Helvetica, Geneva, Swiss, Arial, SunSans-Regular, sans-serif;
  font-size: 11pt;
}

#panel-wrapper * {
  box-sizing: border-box;
}

#ide-wrapper.layout-fixed #panel-wrapper {
  top: 0;
  right: 0;
  position: fixed;
}

#ide-wrapper.layout-flex #panel-wrapper {
  position: relative; /* for the power button */
  max-width: 48em;
  flex-shrink: 0;
  flex-grow: 0;
}

#ide-wrapper.toggled #panel-wrapper {
  width: 0px;
  /* overflow: auto; */
}

.flex-container {
  display: flex;
  flex-direction: column;
  height: calc(100% - 36px);  /* 36px = height of toolbar */
  overflow: hidden;
}

.flex-panel {
  display: flex;
  flex-direction: column;
  flex: 1000 1;
  overflow: hidden;
  transition: flex 0.5s ease-in-out;
}

.flex-panel > .caption {
  flex-shrink: 0;
  font-size: 11px;
  height: 20px;
  padding: 3px 10px 0 10px;
  position: relative;
  z-index: 3;
  width: 100%;
  cursor: pointer;
}

.flex-panel > .caption:after {
  /* css arrow */
  position: absolute;
  content: "";
  border-top: 8px solid transparent;
  border-right: 8px solid #565656;
  border-bottom: 8px solid transparent;
  top: 1px;
  right: 7px;
  transform: rotate(-90deg);
  transition: transform 0.5s ease-in-out;
}

.flex-panel > .caption select {
  font-size: 8px;
  margin-left: 1em;
  position: relative;
  top: -1px;
}

.flex-panel > .content {
  flex: 1000 1;
  padding: 2px 4px 4px 4px;
  /*transition: opacity 0.5s ease-in-out;*/
  font-family: monospace;
  overflow: auto;
  overscroll-behavior: contain;
}

.flex-panel.collapsed {
  flex: 1 1000 20px;
}

.flex-panel.collapsed > .caption:after {
  transform: none;
}

#goal-panel {
  flex: 2000 1;
  position: relative;
}

#goal-panel.collapsed {
  flex: 1 1000 20px;
}

#goal-panel p {
  margin: 0;
}

#goal-panel p.splash-above {
  margin-top: 0.2em;
  margin-left: 0.5em;
}

#goal-panel div.splash-middle {
  text-align: center;
  margin: 1em 0;
  line-height: 0;
}

#goal-panel div.splash-middle div.splash-image {
  display: inline-block;
  width: 150px;
  height: 63px;
  background-size: 300px;
  background-image: url(../ui-images/jscoq-splash.png);
}

#goal-panel div.splash-middle div.wait {
  background-position-x: -150px;
}

#goal-panel div.splash-middle div.splash-image img {
  width: 100%;
}

#goal-panel p.system {
  margin: 0.75em 0; 
}

#goal-text {
  border: 0;
  white-space: pre;
}

#vsep, #hsep {
  position: absolute;
  z-index: 3;
}

#hide-panel {
  cursor: pointer;
}

#hide-panel g path {
  fill: #00a806;
}

#ide-wrapper.toggled #hide-panel g path {
  fill: #f20000
}

/* Toolbar */

#toolbar {
  white-space: nowrap;
  border-bottom: 1px solid #ddd;
  position: relative;
  overflow: hidden;
  height: 36px;
}

#toolbar .exits {
  white-space: nowrap;
  display: inline-block;
  vertical-align: top;
  padding-left: .5em;
}

#toolbar .exits.right {
  position: absolute;
  top: 4px;
  right: 4px;
  transition: opacity 620ms ease-in;
}

#ide-wrapper.toggled #toolbar .exits.right {
  opacity: 0;
  transition: opacity 120ms linear;
}

.link-to-github {
  word-spacing: -2px; /* aren't we picky */
}

.link-to-github::after {
  content: "";
  display: inline-block;
  height: 25px;
  width: 25px;
  background: url(../ui-images/github.png);
  background-size: 25px 25px;
  background-repeat: no-repeat;
  vertical-align: middle;
  margin-left: .3em;
  padding-bottom: 5px;
  box-sizing: content-box;
}

#buttons {
  display: inline-block;
  text-align: left;
  padding-left: 2em;
  transition: opacity 500ms ease;
  vertical-align: middle;
  margin-top: 5px;
}

#buttons button {
  background: none;
  border: none;
  width: 25px;
  height: 25px;
  background-size: 100%;
  vertical-align: middle;
  cursor: pointer;
  transition: opacity 1s ease;
}

#buttons button:disabled {
  opacity: 0.15;
  cursor: default;
}

#buttons button:active {
  opacity: 0.8;
}

#buttons button:focus {
  outline: none;
  transition: none;
}

#buttons button[name=up] {
  background-image: url(../ui-images/up.png);
  width: 20px;
  height: 20px;
}
#buttons button[name=down] {
  background-image: url(../ui-images/down.png);
  width: 20px;
  height: 20px;
}
#buttons button[name=to-cursor] {
  background-image: url(../ui-images/to-cursor.png);
}
#buttons button[name=interrupt] {
  background-image: url(../ui-images/stop.png);
}
#buttons button[name=reset] {
  background-image: url(../ui-images/reset.png);
}


/* Proper  */

#document {
  margin: auto;
  position: relative;
  padding: 15px;
}

#document code {
  white-space: pre;
}

#document .CodeMirror {
  margin-bottom: 0.5em;
}

#packages-panel > div {
  padding-top: 1px;
  padding-bottom: 1px;
}

#packages-panel > div > button {
  padding: 0;
  border: none;
  background: none;
  outline: none;
  margin-right: 4px;
  vertical-align: middle;
  cursor: pointer;
}

button.download-icon::after {
  content:url("../ui-images/dl.png");
}

button.download-icon.checked::after {
  content:url("../ui-images/checked.png");
}

.rel-pos {
  position: relative;
  height:0;
}

.progressbar {
  background: #3c57a6;
  height:2px;
  border-radius: 2px;
  position:relative;
  top: -2px;
  width:0;
}

.progress-egg {
  background-image: url("../ui-images/egg.png");
  background-size: contain;
  position: absolute;
  top: -19px;
  right: 0;
  height: 18px;
  width: 18px;
}

/* Pretty-printing hacks */

div.Pp_box {
  display: inline;
}

div.Pp_box[data-margin="1"] {
  margin-left: 0.75em;
}

div.Pp_box[data-margin="2"] {
  margin-left: 1.5em;
}

div.Pp_box[data-mode="horizontal"] {
  cursor: text;
}

#goal-text > div.Pp_box[data-mode="vertical"],
#goal-text > div.Pp_box[data-mode="vertical"] > div.Pp_box[data-mode="vertical"] {
  display: block;
}

#goal-text p.num-goals,
#goal-text p.no-goals {
  margin-top: .2em;
  margin-bottom: 1em;
  white-space: normal;
}

#goal-text .coq-env {
  padding-left: 1.25em;
}

#goal-text p.aside {
  white-space: normal;
  color: #777;
}

#goal-text p.num-goals + p.aside {
  margin-top: -1em;
  margin-bottom: 1em;
}

.coq-hypothesis {
  margin-bottom: 2px;
}

.coq-hypothesis > label {
  font-weight: normal;  /* override bootstrap */
  margin: 0;
}

.coq-hypothesis > label::after {
  content: ",";
  margin-right: 0.25em;
}

.coq-hypothesis > label:last-of-type::after,
.coq-hypothesis > span.def::after {
  content: ":";
  margin: 0 .5em;
}

.coq-hypothesis.coq-has-def > label:last-of-type::after {
  content: ":=";
  margin: 0 .5em;
  color: #777;
}

.coq-env hr {
  margin: 0.5em 0;
  border: 1px inset;
}

.coq-subgoal-pending {
  margin: 1em 0;
}

.coq-subgoal-pending > label {
  display: block;
  margin-bottom: .2em;
  color: #777;
}
.coq-subgoal-pending > label::before {
  content: "subgoal ";
}
.coq-subgoal-pending > label::after {
  content: " is:"
}

.coq-subgoal-pending > .Pp_box {
  margin-left: .8em;
}

/* Contextual info */

#goal-panel div.contextual-info {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(0,0,0,0.25);
  font-family: monospace;
  font-size: 9pt;
  padding: 0 0.75em 2px 3px;
  white-space: pre-wrap;
  max-height: 60%;
  overflow-y: auto;
}

div.hint-package {
  float: right;
  margin-left: 1em;
  color: #aaa;
  font-size: 90%;
  position: relative;
  top: 1px;  /* this is safer than padding or margin, for floats */
}
.CodeMirror-hint-active div.hint-package {
  color: #ddd;
}

/* company-coq */

.company-coq-sub {
  font-size: 70%;
  position: relative;
  top: 0.1em;
  /* using position: relative prevents line-height increase */
  padding-top: 0.4em;
  /* the padding is to align the background with the rest of the line;
     not pixel-accurate :\ */
}

.company-coq-hidden {
  display: inline-block;
  height: 0;
  width: 0;
  overflow: hidden;
  font-size: 1pt;
}

/* Printing options */

@media print {
  #hide-panel { display: none; }
  a.link-to-github { display: none; }

  .flex-panel:not(.collapsed) .caption {
    border-bottom: 1px dashed #ccc;
  }

  /* Multi-page documents with flex are not portable (e.g. Firefox) */
  /* falling back to absolute positioning + padding */

  #ide-wrapper {
    display: block;
    padding-right: 45%;
    transition: none;
  }

  #ide-wrapper.toggled {
    padding-right: 0;
  }

  #ide-wrapper > * {
    max-height: initial;
  }

  #panel-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    border-bottom: 1px solid #aaa;
  }

}
