/* Modal Dialogs */

%theme_dialogs {
  background-color: $dialog_bg_color;
  border-radius: $wm_radius;
  border: solid rgba(black, 0.75);
  border-width: if($variant=='light', 0, 1px);
  box-shadow: 0 3px 6px 0 rgba(black, if($variant=='light', 0.25, 0.35));
}

%last_dialog_button {
  color: white !important;
  background-color: $primary_color;
  box-shadow: inset 0 1px 0 0 rgba(white,0.1);
  background-gradient-direction: none !important;

  &:hover {
    color: white !important;
    background-color: lighten($primary_color, 9%);
    background-gradient-direction: none !important;
  }

  &:active {
    color: white !important;
    background-color: darken($primary_color, 5%);
    background-gradient-direction: none !important;
  }

  &:insensitive {
    background-color: rgba($primary_color, 0.05);
    color: rgba($primary_color, 0.35) !important;
    background-gradient-direction: none !important;
  }
}

.headline {
  @include font(title);
}

// modal dialog
.modal-dialog {
  color: $fg_color;
  padding: 0 5px 6px 5px;
  @extend %theme_dialogs !optional;

  &-linked-button {
    min-height: 40px;
    padding: 0 16px;
    margin: 3px 3px !important;
    border: none !important;
    border-radius: $bt_radius;

    @include font(button);
    @include button(flat-normal);
    &:hover { @include button(flat-hover); }
    &:active { @include button(flat-active); }
    &:insensitive { @include button(flat-insensitive); }
    &:focus { @include button(flat-focus); }
  }

  &-linked-button:first-child {
    background: $entry_bg;
    &:hover { @include button(flat-hover); }
    &:active { @include button(flat-active); }
  }

  &-linked-button:last-child {
    @extend %last_dialog_button;
  }

  .modal-dialog-content-box {
    margin: 32px 40px;
    spacing: 32px;
    max-width: 28em;
  }
}

// End Session Dialog
.end-session-dialog {
  width: 30em;
  // border: none;

  .end-session-dialog-battery-warning,
  .dialog-list-title {
    color: $warning_color;
  }
}

// Message Dialog
.message-dialog-content {
  spacing: 18px;

  .message-dialog-title {
    text-align: center;
    font-size: 18pt;
    font-weight: 800;

    &.lightweight {
      font-size: 13pt;
      font-weight: 800;
    }
  }

  .message-dialog-description { text-align: center; }
}

// Dialog List
.dialog-list {
  spacing: 18px;

  .dialog-list-title {
    text-align: center;
    font-weight: bold;
  }

  .dialog-list-scrollview { max-height: 200px; }
  .dialog-list-box {
    spacing: 1em;

    .dialog-list-item {
      spacing: 1em;

      .dialog-list-item-title { font-weight: bold; }
      .dialog-list-item-description {
        color: $alt_fg_color;
        @include font(title);
      }
    }
  }
}

// Run Dialog
.run-dialog {
  .modal-dialog-content-box {
    margin-top: 24px;
    margin-bottom: 14px;
  }

  .run-dialog-entry { width: 20em; }
  .run-dialog-description {
    text-align: center;
    color: $alt_fg_color;
    @include font(title);
  }
}

// Password or Authentication Dialog
.prompt-dialog {
  //this is the width of the entire modal popup
  width: 28em;
  // border: none;

  .modal-dialog-content-box {
    margin-bottom: 24px;
  }
}

.prompt-dialog-password-grid {
  spacing-rows: 8px;
  spacing-columns: 4px;

  .prompt-dialog-password-entry {
    width: auto;

    // 4px (spacing) + 16px (spinner-width)
    &:ltr { margin-left: 20px; }
    &:rtl { margin-right: 20px; }
  }
}

.prompt-dialog-password-grid {
  spacing-rows: 8px;
  spacing-columns: 4px;

  .prompt-dialog-password-entry {
    width: auto;

    // 4px (spacing) + 16px (spinner-width)
    &:ltr { margin-left: 20px; }
    &:rtl { margin-right: 20px; }
  }
}

.prompt-dialog-password-layout {
  spacing: 8px;
}

.prompt-dialog-password-entry {
  width: 20em;
}

.prompt-dialog-error-label,
.prompt-dialog-info-label,
.prompt-dialog-null-label {
  text-align: center;
  @include font(title);
  margin: 6px;
}

.prompt-dialog-error-label {
  color: $error_color;
}

.prompt-dialog-info-label,
.prompt-dialog-null-label {
  color: $hint_fg_color;
}

// Polkit Dialog
.polkit-dialog-user-layout {
  text-align: center;
  spacing: 8px;
  margin-bottom: 6px;

  .polkit-dialog-user-root-label {
    color: $warning_color;
  }
}

// Audio selection dialog
.audio-device-selection-dialog {
  .modal-dialog-content-box { margin-bottom: 28px; }
  .audio-selection-box { spacing: 20px; }
}

.audio-selection-device {
  border: 1px solid $borders_color;
  border-radius: $bt_radius;
  &:hover, &:focus { background-color: $visit_color; }
  &:active {
    background-color: $selected_bg_color;
    color: $selected_fg_color;
  }
}

.audio-selection-device-box {
  padding: 20px;
  spacing: 20px;
}

.audio-selection-device-icon {
  icon-size: $base_icon_size * 4;
}

// Welcome dialog
.welcome-dialog-image {
  background-image: url("resource:///org/gnome/shell/theme/gnome-shell-start.svg");
  background-size: contain;
  height: 300px;
  width: 300px;
}
