/* 
Copyright 2022 The Manifold Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. 
*/

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  font-family: 'Rubik', sans-serif;
  font-size: 24px;
  line-height: 24px;
  font-weight: 800;
  -webkit-font-smoothing: antialiased;
}

button {
  display: block;
  padding: 0 1em;
  cursor: pointer;
  height: 36px;
  border: none;
  border-radius: 18px;
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 800;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

a:link,
a:visited {
  color: black;
  text-decoration: underline;
}

a:hover,
a:active {
  color: black;
  text-decoration: none;
}

button:disabled {
  color: black;
  background-color: #eee !important;
  cursor: auto;
}

button:hover {
  filter: brightness(0.9);
}

.name {
  border: none;
  height: 36px;
  background-color: transparent;
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 800;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.name:focus {
  outline: none;
}

p {
  margin: 18px;
  text-align: left;
}

model-viewer {
  position: relative;
  flex: 3;
  width: 100%;
  background-color: #ddd;
}

#console {
  flex: 1;
  min-height: 0;
  max-height: 25vh;
  overflow-y: scroll;
  background-color: #eee;
  white-space: pre-wrap;
  font-size: 14px;
  font-weight: 100;
  line-height: 20px;
  padding: 8px;
}

.page {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  display: flex;
}

.col {
  position: relative;
  width: 50vw;
}

.center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
}

.header .margin {
  font-size: 16px;
  margin: 18px 8px;
}

.dropdown {
  display: none;
  position: absolute;
  z-index: 1;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.show {
  display: block;
}

.hide {
  display: none;
}

.uparrow {
  display: inline-block;
  position: relative;
  border: solid black;
  border-width: 0 3px 3px 0;
  padding: 3px;
  transform: rotate(-135deg);
}

.down {
  transform: rotate(45deg);
}

.item {
  width: 100%;
  position: relative;
}

.top-edit {
  display: inline-block;
  vertical-align: middle;
  height: 36px;
  top: 18px;
  border: none;
  border-radius: 18px;
}

.top-icon {
  display: inline-block;
  vertical-align: middle;
  width: 36px;
  background-size: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
}

.squish {
  margin-right: -12px;
}

.icon {
  display: inline-block;
  background-color: transparent;
  position: absolute;
  width: 36px;
  top: 0px;
  right: 0px;
  background-size: 20px;
  background-repeat: no-repeat;
  background-position: center;
}

.undo {
  background-image: url(/icons/undo.png);
}

.redo {
  background-image: url(/icons/redo.png);
}

.star {
  background-image: url(/icons/star.png);
}

.share {
  background-image: url(/icons/share.png);
}

.cancel {
  background-image: url(/icons/close.png);
  background-size: 20px;
  background-repeat: no-repeat;
  background-position: center;
}

.edit {
  background-image: url(/icons/pencil.png);
  right: 30px;
}

.trash {
  background-image: url(/icons/trash.png);
}

.play {
  background-image: url(/icons/play.png);
}

.pause {
  background-image: url(/icons/pause.png);
}

.icon:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

.top-icon:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

.blue {
  background-color: rgb(148, 221, 255);
}

.green {
  background-color: rgb(131, 255, 131);
}

.red {
  background-color: rgb(255, 177, 177);
}

#file-margin {
  position: relative;
  width: 250px;
}

#save {
  width: 125px;
}

#animation {
  display: none;
  align-items: center;
  position: absolute;
  width: 100%;
  bottom: 0px;
  margin: 2px;
}

#play {
  position: relative;
  background-color: #ccc;
  margin: 8px;
}

.slider {
  position: relative;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  margin-right: 16px;
  background: #ffffff55;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
}

@media only screen and (max-width: 820px) {
  .container {
    flex-direction: column;
    width: 100%;
  }

  .col {
    width: 100%;
    height: 50%;
  }

  #file-margin {
    width: calc(100% - 32px);
  }

  p {
    margin: .2em 1em;
    text-align: center;
  }

  .header .margin {
    margin: 0.2em 16px;
  }

  #button-container {
    flex-direction: row;
    margin-left: 8px;
    margin-right: 8px;
    width: calc(100% - 16px);
  }

  #button-container .margin {
    width: calc(50% - 16px);
    margin: 8px;
  }
}