/* 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;

  --esphome-background-header: #e0e0e0;
}

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

/* Layout */
main {
  margin-top: 64px;
  flex: 1 0 auto;
  display: grid;
}

esphome-main {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

.esphome-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 56px;
  background-color: var(--esphome-background-header);
  padding: 0 24px;
}

.flex {
  flex: 1;
}

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

#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: 90vh !important;
    height: calc(90vh - env(safe-area-inset-bottom)) !important;
    max-height: initial;
  }
  .modal h4 {
    padding: 8px;
    font-size: 1.5rem;
    margin: 0;
  }
  .modal .modal-content {
    padding: 0;
  }
}
