/*
 *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree.
 */

/* General Styles */
html {
  overflow-y: scroll;
}

body {
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  margin: 0;
  padding: 1em;
  word-break: break-word;
}

img, audio, canvas {
  max-width: 100%;
  height: auto;
}

video {
  background: #222;
  margin: 0 0 20px 0;
  width: 100%;
  height: auto;
}

code, textarea {
  font-family: 'Roboto', sans-serif;
}

textarea {
  resize: none;
}

.hidden {
  display: none;
}

.highlight {
  background-color: #eee;
  font-size: 1.2em;
  margin: 0 0 30px 0;
  padding: 0.2em 1.5em;
}

.warning {
  color: red;
  font-weight: 400;
}

/* Containers */
div#container {
  margin: 0 auto;
  max-width: 100%;
  padding: 1em 1.5em;
}

div#links {
  padding: 0.5em 0;
}

div#errorMsg p {
  color: #F00;
}

div.outputSelector {
  margin: -1.3em 0 2em 0;
}

/* Sections */
section {
  border-bottom: 1px solid #eee;
  margin: 0 0 30px 0;
  padding: 0 0 20px 0;
}

section:last-of-type {
  border-bottom: none;
  padding: 0 0 1em 0;
}

section p:last-of-type {
  margin: 0;
}

p {
  color: #444;
  font-weight: 300;
}

p#data {
  border-top: 1px dotted #666;
  font-family: Courier New, monospace;
  line-height: 1.3em;
  max-height: 1000px;
  overflow-y: auto;
  padding: 1em 0 0 0;
}

p.borderBelow {
  border-bottom: 1px solid #aaa;
  padding: 0 0 20px 0;
}

p.description {
  margin: 0 0 0.5em 0;
}

/* Lists and Tables */
ul {
  margin: 0 0 0.5em 0;
}

li {
  margin: 0 0 0.4em 0;
}

table#candidates {
  font-size: 0.7em;
  overflow-x: auto;
  text-align: right;
  width: 100%;
}

th {
  font-weight: bold;
}

th:nth-child(3),
td:nth-child(3) {
  text-align: left;
}

th:nth-child(6),
td:nth-child(6) {
  text-align: left;
}

/* Headings */
h1 {
  border-bottom: 1px solid #ccc;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  margin: 0 0 0.8em 0;
  padding: 0 0 0.2em 0;
}

h1 span {
  white-space: nowrap;
}

h1 a {
  font-weight: 300;
  margin: 0 10px 0 0;
  white-space: nowrap;
}

h2 {
  color: #444;
  font-weight: 500;
}

h3 {
  border-top: 1px solid #eee;
  color: #666;
  font-weight: 500;
  margin: 10px 0;
  white-space: nowrap;
}

/* Links */
a {
  color: #409EFF;
  font-weight: 300;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a#viewSource {
  display: block;
  margin: 1.3em auto;
  border-top: 1px solid #999;
  padding: 1em 0 0 0;
  max-width: 940px;
}

/* Buttons */
button {
  background-color: #d84a38;
  border: none;
  color: white;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  margin: 20px 0 0 0;
  padding: 10px 20px;
  border-radius: 4px;
  width: 100%;
  max-width: 290px;
  box-sizing: border-box;
}

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

button[disabled] {
  color: #ccc;
}

button[disabled]:hover {
  background-color: #d84a38;
}

button#gather {
  display: block;
}

/* Forms */
select {
  margin: 0 1em 1em 0;
  position: relative;
  top: -1px;
  width: 100%;
}

section#iceServers input,
section#iceServers textarea,
section#iceServers input[type="text"],
section#iceServers input[type="password"] {
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 14px;
  resize: none;
}

section#iceServers input {
  margin: 0 0 10px;
  width: 100%;
}

section#iceConstraints label,
section#iceServers label,
section#iceOptions label {
  display: inline-block;
}

section#iceConstraints label {
  margin: 0 1em 0 0;
}

section#iceServers label {
  width: 150px;
}

section#iceOptions .radio-group {
  display: flex;
  align-items: center;
  margin: 10px 0;
}

section#iceOptions .radio-group label {
  margin-right: 20px;
}

section#iceOptions input[type="radio"] {
  margin-right: 5px;
}

select#servers {
  font-size: 1em;
  padding: 5px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Containers */
#iceServers,
#iceOptions,
#permissions,
#candidates-section {
  max-width: 900px;
  margin: 0 auto 20px auto;
  padding: 20px;
  border-radius: 8px;
  background-color: #f0f8ff;
}

/* Headings in Containers */
#iceOptions h2,
#iceServers h2,
#iceServers h3 {
  color: #409EFF;
}

#iceServers h2 {
  margin-bottom: 15px;
}

#iceServers h3 {
  font-size: 18px;
  margin-top: 25px;
}

#iceServers .title-link {
  color: #409EFF;
  font-weight: 500;
}

/* Buttons in Containers */
.button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
}

.button-container button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  flex: 1 1 100%;
}

#remove {
  background-color: #ff9800;
}

#reset {
  background-color: #007bff;
}

#add {
  background-color: #4caf50;
}

.button-container button:hover {
  opacity: 0.8;
}

/* Media Queries */
@media screen and (min-width: 1000px) {
  /* hack! to detect non-touch devices */
  div#links a {
    line-height: 0.8em;
  }
}

@media screen and (max-width: 650px) {
  .highlight {
    font-size: 1em;
    margin: 0 0 20px 0;
    padding: 0.2em 1em;
  }

  h1 {
    font-size: 24px;
  }

  button {
    width: 100%;
    max-width: none;
  }

  #iceServers,
  #iceOptions,
  #permissions,
  #candidates-section {
    padding: 15px;
  }
}

@media screen and (max-width: 550px) {
  button:active {
    background-color: darkRed;
  }

  h1 {
    font-size: 22px;
  }
}

@media screen and (max-width: 450px) {
  h1 {
    font-size: 20px;
  }
}

/* Additional Styles */
.gray {
  color: gray;
}

#poolValue {
  display: inline-block;
  width: 30px;
}

#getUserMediaPermissions,
#error-note {
  display: none;
}

