// Modal dialogs

.dialog {
  background-color: $bg_color;
  color: $fg_color;
  border-radius: $modal_dialog_radius;
  border: 1px solid $borders_color;
  padding: $base_padding * 3;

  .dialog-content-box {
    margin-top: $base_margin * 2;
    margin-bottom: $base_margin * 4;
    spacing: $base_margin * 8;
    max-width: 28em;
  }

  .dialog-button {
    @extend %dialog_button;

    &:default { @extend %dialog_button_default; }
    &:destructive-action { @extend %dialog_button_destructive; }
  }

  .confirm-dialog-title {
    @extend %title_2;
    text-align: center;
  }
}

// Lists in dialogs

.dialog-list {
  spacing: $base_padding * 3;

  .dialog-list-title {
    @extend %heading;
    text-align: center;
  }

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

    border-radius: $base_border_radius;

    .dialog-list-item {
      spacing: 1em;
      border-radius: $base_border_radius;
      padding: $base_padding $base_padding * 2;
      transition-duration: 100ms;

      &:hover { background-color: $light_bg_color; }
      &:selected { background-color: $accent_bg_color; }

      .dialog-list-item-title { font-weight: bold; }
      .dialog-list-item-description {
        @extend %caption;
        color: darken($fg_color, 5%);
      }
    }
  }
}

// End session dialog

.end-session-dialog {
  min-width: 40em;

  .dialog-content-box { spacing: 0; }

  .dialog-list {
    spacing: 0;

    .dialog-list-title {
      color: $warning_color;
      background-color: transparentize($warning_color, 0.9);
      padding: $base_padding * 1.5;
      border-radius: $base_border_radius;
      margin: $base_margin 0;
    }
  }
}

// message dialog

.message-dialog-content {
  spacing: $base_padding * 3;

  .message-dialog-title {
    text-align: center;
    @extend %title_2;

    &.lightweight { @extend %title_4; }
  }

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

  .message-dialog-caption {
    @extend %caption; 
    text-align: center;
  }
}

// run dialog

.run-dialog {

  .dialog-content-box {
    margin: $base_margin;
  }

  &-description {
    @extend %caption;

    text-align: center;
    color: darken($fg_color, 20%);

    &.error { color: $error_color; }
  }

  &-completion-box {
    padding-top: $base_padding;
    padding-left: $base_padding * 2;
  }

  &-entry {
    @extend %entry;

    width: 20em;
    height: 1.2em;
  }
}

// password or authentication dialog

.prompt-dialog {
  width: 26em;

  .dialog-content-box {
    spacing: $base_margin * 4;
    margin-bottom: $base_margin * 3;
  }

  &-password-entry {
    @extend %entry;
    width: 20em;
  }

  &-password-layout { spacing: $base_margin * 2;}

  &-error-label,
  &-info-label,
  &-null-label {
    text-align: center;
    @extend %caption;
  }

  &-error-label { color: $error_color; }
}

// polkit dialog

.polkit-dialog {

  &-user-layout {
    text-align: center;
    spacing: 2px;
  }

  &-user-combo {
    @extend %flat_button;
    @extend %heading;

    border-radius: $base_border_radius;
    padding: $base_padding $base_padding * 6;

    // special case the :insensitive button sinc we want
    // the label to be the normal color when there are
    // not multiple users
    &:insensitive { color: $fg_color; }
  }
}

// Shared grouped-list style for autorun and processes dialogs
%grouped-dialog-list {
    .dialog-list-box {
        background-color: lighten($bg_color, 5%);
        spacing: 0;

        .dialog-list-item {
            border-radius: 0;

            &:first-child {
              border-radius: $base_border_radius $base_border_radius 0 0;
            }

            &:last-child {
              border-radius: 0 0 $base_border_radius $base_border_radius;
            }
        }
    }
}

.processes-dialog {
  .dialog-content-box {
    .dialog-list {
        @extend %grouped-dialog-list;
    }
  }
}

.autorun-dialog {
  min-width: 30em;

  .dialog-content-box {
    margin-top: $base_margin;
    margin-bottom: $base_margin * 3;
    spacing: $base_margin * 3;
    max-width: 28em;

    .dialog-list {
        @extend %grouped-dialog-list;
    }

    .autorun-dialog-heading {
      @extend %title_2;
      text-align: center;
    }
  
    .autorun-dialog-subheading {
      @extend %title_4;
      text-align: center;
    }
  
    .autorun-dialog-description {
    }
  }
}

// Popup dialog (non-modal, draggable).
// Modal dialogs use a lightbox to draw attention to themselves; popups don't,
.popup-dialog {
}
