/**
 * Copyright 2016 Google Inc.
 *
 * 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 {
  /* this allows containers inside this to be constrained by percent height */
  height: 100%;
}

body {
  margin: 0.5em;
  padding: 0.5em 1em;

  font-family: Roboto, sans-serif;
  font-weight: 300;
  word-wrap: break-word;
}

body.noinput {
  /* noinput mode: constrain the body to its size minus margin and padding, so
     that nested elements can constrain to body */
  width: 100%;
  width: calc(100% - 3em);
  height: 100%;
  height: calc(100% - 2em);
}

a {
  color: #4183C4;
  text-decoration: none;
}

a:hover {
  color: #3d85c6;
  text-decoration: underline;
}

button {
  background-color: #d84a38;
  border: none;
  border-radius: 2px;
  color: white;
  font-family: Roboto, sans-serif;
  font-size: 0.9em;
  font-weight: 600;
  margin: 0;
  padding: 0.5em 0 0.5em 0;
  width: 7.5em;
}

button:active {
  background-color: #cf402f;
}

button:hover {
  background-color: #cf402f;
}

button[disabled] {
  background-color: #888;
  color: #ccc;
}

details {
  margin: 1em 0 1em 0;
}

details div {
  margin: 0 0 1.2em 0;
}

h1 {
  border-bottom: 1px solid #ccc;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 2.0em;
  font-weight: 600;
  margin: 0 0 0.5em 0;
  padding: 0 0 0.2em 0;
}

input[type=text] {
  font-family: Roboto, sans-serif;
  font-size: 0.9em;
  padding: 1px 2px 3px 6px;
}

label, .label {
  color: #444;
  display: inline-block;
  font-family: 'Roboto Condensed';
  font-weight: 400;
  width: 11em;
}

input[type=checkbox] + label {
  width: auto;
}

p {
  color: #444;
  font-size: 0.9em;
  font-weight: 300;
  line-height: 1.6em;
  margin: 0.5em 0;
}

p.links {
  border-bottom: 1px solid #eee;
  border-top: 1px solid #eee;
  margin: 1.5em 0 1.5em 0;
  padding: 0.5em 0 0.5em 0;
}

select {
  font-family: sans-serif;
  height: 2em;
  -webkit-appearance: menulist-button;
}

strong {
  font-weight: 600;
}

summary {
  cursor: pointer;
  display: block;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1.1em;
  outline: none;
  margin: 0 0 1em 0;
}

#assetList, #customAsset div {
  margin: 0 0 1.2em 0;
  /* Otherwise, this causes horizontal scrolling on narrow screens */
  max-width: 80%;
}

#container {
  margin: 0 auto 0 auto;
  max-width: 40em;
}

#container.noinput {
  /* noinput mode: use all available space */
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

#container.noinput .input {
  /* noinput mode: hide all input fields */
  display: none;
}

#container.noinput h1 {
  /* noinput mode: restrict h1 to 50px tall, center it */
  height: 50px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

#container.noinput #videoContainer {
  /* noinput mode: use all available space,
     but also constrain to the screen size */
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  height: calc(100% - 50px);
  margin: 0;
  padding: 0;
}

#customAsset {
  display: none;
}

#customAsset input {
  /* Otherwise, this becomes a two lines tall on narrow screens */
  height: 1.4em;
}

#errorDisplay {
  background-color: #d84a38;
  margin: 0;
  padding: 0;
  line-height: 2em;
  text-align: center;
  width: 100%;
  display: none;
}

#errorDisplayText {
  background-color: #d84a38;
  color: white;
  margin-left: 2em;
  margin-right: 2em;
  float: center;
}

#errorDisplayCloseButton {
  background-color: #d84a38;
  color: white;
  position: relative;
  padding: 0 0;
  top: 0em;
  right: 0.5em;
  float: right;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

#progressDiv, #offlineNameDiv {
  display: none;
}

#loadButton {
  margin: 0 1em 1em 0;
}

#logSection {
  display: none;
}

#log {
  background-color: #f4f4f4;
  border: 1px solid #aaa;
  color: #000;
  font-family: monospace;
  height: 200px;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 5px;
}

#log div {
  border-bottom: 1px solid #ddd;
  line-height: 1.4em;
  margin: 0;
  padding: 0 0.5em;
  width: 100%;
}

#log div span {
  padding-right: 0.5em;
  white-space: pre-wrap;
}

#videoContainer {
  background-color: transparent;
}

#video {
  /* height and margin needed in fullscreen mode */
  width: 100%;
  height: 100%;
  margin: auto;
}

.errorLog {
  background-color: #fee;
  color: #f00;
}

.warnLog {
  background-color: #ffc;
}

.infoLog {
  background-color: #eff;
}

.flex {
  display: flex;
}

.flex-grow {
  flex-grow: 1;
}

.overlay-parent {
  /* Makes this a positioned ancestor of .overlay */
 // position: relative;
}

.overlay {
  /* Allows this to be positioned relative to a containing .overlay-parent */
  position: absolute;
}

.for-screen-readers {
  /* Hide the content from sighted users, but not screen readers */
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media screen and (max-width: 650px) {
  h1 {
    font-size: 1.5em;
  }

  p {
    font-size: 0.8em;
  }
}

@media screen and (max-width: 550px) {
  button {
    margin: 0 0.6em 0.8em 0;
    padding: 9px 0 10px 0;
  }

  button:active {
    background-color: darkRed;
  }

  h1 {
    font-size: 1.4em;
  }

  input[type=text] {
    font-size: 0.8em;
  }

  label, .label {
    font-weight: 500;
    margin: 0 0 0.4em 0;
  }

  select {
    display: block;
    margin: 0 1em 0.3em 0;
  }

  summary {
    font-weight: 600;
  }
}

@media screen and (max-width: 400px) {
  button {
    font-size: 0.8em;
    margin: 0 0.4em 1em 0;
    padding: 5px 0 7px 0;
  }
}
