/* Base */

:root {
  /* Colors */
  --primary-bg-color: #fafafa;

  --alert-standard-color: #666666;
  --alert-standard-color-bg: #e6e6e6;
  --alert-info-color: #00539f;
  --alert-info-color-bg: #e6eef5;
  --alert-success-color: #4caf50;
  --alert-success-color-bg: #edf7ee;
  --alert-warning-color: #ff9800;
  --alert-warning-color-bg: #fff5e6;
  --alert-error-color: #d93025;
  --alert-error-color-bg: #faefeb;

  --mdc-theme-primary: #03a9f4;
  --mdc-dialog-z-index: 998;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background-color: var(--primary-bg-color);
}

/* Layout */
.valign-wrapper {
  position: absolute;
  width: 100vw;
  height: 100vh;
}

.valign {
  width: 100%;
}

main {
  margin-top: 64px;
  flex: 1 0 auto;
}

.esphome-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 64px;
  background-color: #e0e0e0;
  padding: 0 24px;
}

.esphome-header > div {
  flex: 1;
}

.esphome-header img {
  width: auto;
  height: 48px;
}

/* Alerts & Errors */
.alert {
  width: 100%;
  margin: 10px auto;
  padding: 10px;
  border-radius: 2px;
  border-left-width: 4px;
  border-left-style: solid;
}

.alert .title {
  font-weight: bold;
}

.alert .title::after {
  content: "\A";
  white-space: pre;
}

.alert.alert-error {
  color: var(--alert-error-color);
  border-left-color: var(--alert-error-color);
  background-color: var(--alert-error-color-bg);
}

.card.card-error {
  border-top: 4px solid var(--alert-error-color);
}

/* Login Page */
#login-page .row.no-bottom-margin {
  margin-bottom: 0 !important;
}

#login-page .logo {
  display: block;
  width: auto;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

#login-page .input-field input:focus + label {
  color: #000;
}

#login-page .input-field input:focus {
  border-bottom: 1px solid #000;
  box-shadow: 0 1px 0 0 #000;
}

#login-page .input-field .prefix.active {
  color: #000;
}

#login-page .version-number {
  display: block;
  text-align: center;
  margin-bottom: 20px;
  color: #808080;
  font-size: 12px;
}

#login-page footer {
  color: #757575;
  font-size: 12px;
}

#login-page footer a {
  color: #424242;
}

#login-page footer p {
  -webkit-margin-before: 0px;
  margin-block-start: 0px;
  -webkit-margin-after: 5px;
  margin-block-end: 5px;
}

#login-page footer p:last-child {
  -webkit-margin-after: 0px;
  margin-block-end: 0px;
}

#js-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.editor {
  margin-top: 0;
  margin-bottom: 0;
  border-radius: 3px;
  height: calc(100% - 56px);
}

.inlinecode {
  box-sizing: border-box;
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
    monospace;
}

ul.browser-default {
  padding-left: 30px;
  margin-top: 10px;
  margin-bottom: 15px;
}

ul.browser-default li {
  list-style-type: initial;
}

.select-action {
  width: auto !important;
  height: auto !important;
  white-space: nowrap;
}

.modal {
  width: 95%;
  max-height: 90%;
  height: 85% !important;
}
.modal .modal-footer mwc-button {
  margin: 6px 0;
}

.page-footer {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding-top: 0;
  color: grey;
}

.page-footer a {
  color: #afafaf;
}

@media only screen and (max-width: 992px) {
  .esphome-header {
    height: 52px;
    padding: 0 8px;
  }
  .esphome-header img {
    height: 38px;
  }
  main {
    margin-top: 52px;
  }
  .page-footer {
    padding-bottom: 72px; /* allow reading footer while fab hovers */
  }
  .page-footer .left,
  .page-footer .right {
    width: 100%;
    text-align: center;
  }
  .modal {
    top: 0 !important;
    width: 100vw;
    height: 100vh !important;
    max-height: initial;
  }
  .modal h4 {
    padding: 8px;
    font-size: 1.5rem;
    margin: 0;
  }
  .modal .modal-content {
    padding: 0;
  }
}
