/* Dialog */

.dialog
{
  border: 1px solid gray;
  background: white;
  z-index: 10001;
  -webkit-box-shadow: 2px 2px 30px 0px rgba(50, 50, 50, 0.63);
  -moz-box-shadow: 2px 2px 30px 0px rgba(50, 50, 50, 0.63);
  box-shadow: 2px 2px 30px 0px rgba(50, 50, 50, 0.63);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 8px);
  max-height: calc(100% - 8px);
  animation-name: fade_in_dialog;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
  display: flex;
  flex-direction: column;
}

.dialog.maximized
{
  top: 4px;
  left: 4px;
  transform: none;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
}

div.dialog.maximized > .header > button.maximize
{
  display: none;
}

div.dialog.maximized > .header > button.minimize
{
  display: block;
}

div.dialog > .header > button.minimize
{
  display: none;
}

.dialog_curtain
{
  z-index: 10000;
  opacity: 0;
  position: absolute;
  top:0;
  bottom:0;
  left:0;
  right:0;
  background-color: gray;
    -webkit-box-shadow: 2px 2px 30px 0px rgba(50, 50, 50, 0.63);
  -moz-box-shadow: 2px 2px 30px 0px rgba(50, 50, 50, 0.63);
  box-shadow: 2px 2px 30px 0px rgba(50, 50, 50, 0.63);
  -webkit-user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -ms-user-select: none;
  animation: fade_in_curtain;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}

.dialog > .header
{
  flex-grow: 0;
  padding: 1px;
  flex-wrap: wrap;
  background-color: white;
  border-bottom: 1px solid #e0e0e0;
  font-weight: bold;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -ms-user-select: none;
}

.dialog .body
{
  flex-grow: 1;
  overflow:auto;
  padding: 6px;
}

.dialog > .footer
{
  flex-grow: 0;
  flex-wrap: wrap;
  padding: 4px;
  display: flex;
  border-top: 1px solid #e0e0e0;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -ms-user-select: none;
}

div.dialog > .header > .title
{
  flex-grow: 1;
  text-align: center;
}

div.dialog > .header > .title > a
{
  -webkit-user-drag: none;
}

div.dialog > .header > button
{
  flex-grow: 0;
  width: 16px;
  height: 16px;
  margin: 4px;
  padding:0;
  background-image: url(images/close.svg);
  background-repeat: no-repeat;
  background-size: 10px 10px;
  background-position: center center;
  cursor: pointer;
  border-radius: 2px;
  background-color: #f6f6f6;
  border:none;
  box-shadow: none;
}

div.dialog > .header > button.minimize
{
  background-image: url(images/minimize.svg);
}

div.dialog > .header > button.maximize
{
  background-image: url(images/maximize.svg);
}

div.dialog > .header > button:hover
{
  background-color: #ffb0b0;
}

div.dialog > .header > button:focus
{
  outline:1px dotted black;
}

.dialog .body > div
{
  margin-top: 4px;
}

.dialog .body > div > input[type='text'],
.dialog .body > div > input[type='password']
{
  width:100%;
  box-sizing: border-box;
}

.dialog .body .text_field,
.dialog .body .select_field,
.dialog .body .radio_buttons
{
  width: 100%;
  box-sizing: border-box;
}

.dialog .body .select_field select
{
  border: 1px solid #C0C0C0;
  background-color: white;
  border-radius: 2px;
  padding: 2px 4px 2px 2px;
  width: 100%;
  box-sizing: border-box;
}

.dialog .body .list_field select
{
  -webkit-appearance:none;
  -moz-appearance: none;
  font-size: 14px;
  padding: 2px 4px 2px 4px;
  background: white;
  border-radius: 2px;
  width: 100%;
  box-sizing: border-box;
}

.dialog .body .text_field label,
.dialog .body .select_field label
{
  display: block;
}

.dialog .body .checkbox_field label,
.dialog .body .checkbox_field input
{
  vertical-align: middle;
}

.dialog .body div input,
.dialog .body div select
{
  margin-top:2px;
}

.dialog .body pre
{
  width: 100%;
  color: black;
  margin:0;
  box-sizing: border-box;
}

.dialog .body .code > input[type=text]
{
  font-family: monospace;
  font-size: 13px;
  color: #404040;
}

.dialog .body span.row
{
  display:block;
  text-align: left;
}

.dialog .body .radio_buttons > input[type='radio']
{
  float: left;
  clear: both;
  line-height: 20px;
}

.dialog .body .radio_buttons > label
{
  float: left;
  line-height: 20px;
  margin-left: 2px;
}

.dialog .footer > button
{
  margin-left:4px;
  margin-right:4px;
}

.dialog .body.confirm,
.dialog .body.info,
.dialog .body.error
{
  text-align: center;
  display:flex;
  flex-direction: column;
  align-items: center;
  word-break: break-word;
  user-select: text;
}

.dialog .body.confirm span,
.dialog .body.info span,
.dialog .body.error span
{
  margin-top:auto;
  margin-bottom: auto;
  user-select: text;
}

.dialog .body.error span
{
  color: #C00000;
}

.dialog .body.confirm span
{
  color: #D00000;
}

.dialog input[type="text"]
{
  border: 1px solid #C0C0C0;
}

.dialog .error
{
  color: #C00000;
}

.dialog .block
{
  display: block;
  text-align: center;
}

.dialog div.console
{
  font-family: monospace;
  font-size: 14px;
  color: #404040;
  border: 1px solid #C0C0C0;
  border-radius: 2px;
  padding: 2px 4px 2px 2px;
  width: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.dialog div.console div.info
{
  color: #808080;
}

.dialog div.console div.warn
{
  color: #C0C000;
}

.dialog div.console div.error
{
  color: #C00000;
}

@keyframes fade_in_dialog
{
  0% {opacity: 0; visibility: visible; }
  100% {opacity: 1; }
}

@keyframes fade_in_curtain
{
  0% {opacity: 0; visibility: visible; }
  100% {opacity: 0.4; }
}

