#settings {
  opacity: 0.8;
  cursor: pointer;
}

#settings:hover {
  opacity: 1;
}

/* TODO: This is used by multiple overlay modals, so give it a more generalized name. */
.settingsContainer {
  padding: 20px;
  position: relative;
  background-color: var(--overlay-modal-background);

  & h3 {
    margin-top: 10px;
    text-align: center;
  }

  &.clientSettings, &.filterDialogContainer {
    margin: auto;
    width: 80%;
    min-width: 200px;
    max-width: 400px;
    & label {
      float: left;
    }

    & input, select {
      float: right;
    }
  }

  & input, select {
    border-radius: 5px;
    outline: 0;
    border: 1px solid #53575a;
    background-color: var(--theme-input-background-subtle);
  }

  & input[type=checkbox]:hover:not(:disabled), select:hover:not(:disabled) {
    border-color: #af4f00;
  }

  & select {
    margin: 0;
  }

  & option {
    background-color: var(--theme-background);
  }

  & .disabledSetting {
    color: #818181;
  }

  & .disabledSetting input[type=checkbox] {
    background-color: var(--custom-checkbox-background) !important;
    border-color: #53575a !important;
  }

  & .labelHelpIcon {
    margin: 0 2px 0 2px;
    opacity: 0.8;
  }

  & .labelHelpIcon:hover {
    opacity: 1;
  }

  & .labelHelpIcon svg {
    vertical-align: top;
  }

  & .launchServerSettingsButton {
    width: calc(100% - 14px); /* 5px padding, 1px border, and 1px margin on each side = (5+1+1)*2 = 14. */
    text-align: center;
    padding: 5px;
  }
}

#serverSettingsContainer {
  text-align: center;
  margin: auto;
  padding: 0 0 20px 0; /* Override default for better scrollbar positioning. */

  @media (min-width: 767px) {
    width: calc(min(90%, 800px));
  }

  @media all and (max-width:767px) {
    width: calc(min(100%, 800px)); /* No additional margin on phones, we want as much real estate as possible */
  }

  & #serverSettingsScroll {
    padding: 20px;
    min-height: 300px;
    overflow: auto;

    /* Fragile max-height calculations based on Overlay.css's various padding and margins, should be improved. */
    @media (min-width: 767px) {
      max-height: calc(100vh - 260px);
    }
    @media all and (max-width:767px) {
      max-height: calc(100vh - 230px);
    }
  }

  & .serverSettingsSettings {
    text-align: left;
  }

  & .subSetting { /* Less padding and smaller text for sub-settings. */
    padding-left: 10px;
    padding-right: 10px;
    display: inline-block;

    & .serverSettingTitle {
      font-size: medium;
    }

    & input {
      width: 175px !important;
      max-width: calc(100% - 10px);
    }

    & input[type=button] {
      padding: 3px 20px 3px 20px !important;
      text-align: center;
    }

    & input[type=text],
      input[type=number],
      input[type=password] {
      padding: 3px !important;
    }

    & input:disabled {
      border-color: var(--theme-input-background);
      color: var(--button-disabled-shadow);
    }
  }

  & .disabledSetting {
    opacity: 80%;
  }

  & #serverSettingsMain {
    max-height: 85vh;
    overflow-y: scroll;
  }

  & .serverSettingTitle {
    font-size: larger;
  }

  & .serverSettingDefaultInfo {
    font-size: smaller;
    color: var(--theme-secondary);
    display: block;
    text-align: left;
    margin: auto auto 15px 0;
  }

  & .stringSetting {
    & input {
      display: block;
      margin: auto auto 5px 0;
      width: calc(100% - 10px);
      padding: 5px;
      border-radius: 5px;
    }
  }

  & input {
    margin-bottom: 5px;
  }

  & .serverSettingTitle {
  margin: 5px auto 5px auto;
  display: inline-block;

  & label {
      margin-right: 5px;
    }
  }

  & .selectHolder {
    margin: auto 5px 5px 0;
    display: inline-block;

    & select {
      padding: 3px;
      border-radius: 5px;
    }
  }

  & #serverSettingsSubmit {
    & .button {
      padding: 5px;
      border: 1px solid var(--theme-input-background);
      border-radius: 5px;
      margin: auto 5px auto 5px;
    }
  }

  & .invalid {
    background-color: var(--error-background);
  }

  & .invalidSubtle {
    background-color: var(--error-background-subtle);
  }

  & .valid {
    background-color: var(--success-background);
  }

  /** Path Mappings table */
  & table {
    width: 100%;
  }

  & table.invalid td input {
    background-color: var(--error-background);
    opacity: 0.8;
  }

  & thead {
    border-bottom: 1px solid var(--theme-border);
    font-weight: bold;
    & td {
      padding: 5px;
    }
  }

  & thead td:last-child {
    margin: 0;
    padding: 0;
  }

  & tr td:last-child {
    text-align: center;
  }

  & tbody td {
    border: 1px solid var(--theme-border);
    margin: 0;
    padding: 0;

    & input[type="text"] {
      margin: 0;
      width: calc(100% - 4px);
      border: 1px solid transparent;
      border-radius: 0;
    }

    & input[type="text"]:focus {
      border: 1px solid var(--theme-focus-color);
    }
  }

  & tr.noPathMappings {
    text-align: center;

    & td {
      padding: 5px;
      border: none;
    }
  }

  & tr.newMapping {
    text-align: center;
    margin: auto;

    & td {
      border: none;
    }
  }
  /** End Path Mappings table */
}

.serverStateButton {
  position: absolute;
  top: 27px;
  display: inline;
  float: none;
  transition: background-color 0.5s;
}

.serverStateButton svg {
  padding: 3px 0 3px 0;
}

#shutdownServer {
  right: 20px;
}

#restartServer {
  right: 50px;
}

#pauseServer {
  right: 80px;
}

#logoutServer {
  left: 20px;
}

#shutdownRestartOverlay {
  text-align: center;
  margin: auto;
}

#shutdownRestartOverlay input {
  float: none;
}

#shutdownRestartOverlay .settingsButtons {
  width: 100%;
}

.settingsButtons {
  float: right;
  overflow: auto;
}

.settingsButtons .button {
  transition: background-color 0.25s;
  padding: 5px;
  margin-left: 5px;
  border-radius: 3px;
}

/** TODO: Move to the appropriate place/update this file to be a generic overlay style definition */
.filterNumberInput {
  width: 40px;
  margin: 0 0 0 10px;
}

.filterSelect option {
  height: 20px;
}

.serverSettingTooltip {
  padding: 5px;

  & hr {
    margin: 5px auto 5px auto !important;
  }

  & code {
    background: var(--theme-input-background);
    border-radius: 5px;
    padding-left: 3px;
    padding-right: 3px;
  };
}
