.quick-settings {
  padding: $base_padding * 3 !important;
  border-radius: $base_radius + $base_padding * 3 !important;
  margin-top: $base_padding !important;

  .icon-button, .button {
    padding: $base_padding * 1.75;

    > StIcon {
      icon-size: $base_icon_size;
    }
  }
}

.quick-settings-grid {
  spacing-rows: $base_padding * 2;
  spacing-columns: $base_padding * 2;
}

.quick-toggle, .quick-menu-toggle {
  border-radius: $base_radius;
  min-width: 12em;
  max-width: 12em;
  min-height: 44px;
  border: none;
}

.quick-toggle {
  background-color: $button !important;

  &:hover {
    background-color: $divider !important;
  }

  &:active {
    background-color: rgba($text, 0.15) !important;
  }

  &:checked {
    background-color: $primary !important;
    color: on($primary);

    &:hover {
      background-color: mix($text, $primary, 6%) !important;
      color: on($primary);
    }

    &:active {
      background-color: mix($text, $primary, 15%) !important;
      color: on($primary);
    }
  }

  & > StBoxLayout { spacing: $base_padding; }

  /* Move padding into the box; this is to allow menu arrows
     to extend to the border */
  &.button { padding: 0; }
  & > StBoxLayout { padding: 0 $base_padding * 2; }
  &:ltr > StBoxLayout { padding-left: $base_padding * 2.5; }
  &:rtl > StBoxLayout { padding-right: $base_padding * 2.5; }

  .quick-toggle-title { font-weight: bold; }

  & StBoxLayout > .quick-toggle-subtitle {
    font-weight: normal;
    font-size: 12px;
  }

  .quick-toggle-icon { icon-size: $base_icon_size; }
}

.quick-menu-toggle {
  & .quick-toggle {
    min-width: auto;
    max-width: auto;

    &:ltr { border-radius: $base_radius 0 0 $base_radius; }
    &:ltr > StBoxLayout { padding-right: $base_padding * 1.5; }
    &:rtl { border-radius: 0 $base_radius $base_radius 0; }
    &:rtr > StBoxLayout { padding-left: $base_padding * 1.5; }

    &:ltr:last-child { border-radius: $base_radius; }
    &:rtl:last-child { border-radius: $base_radius; }
  }

  .quick-toggle-arrow {
    background-color: $button !important;
    padding: $base_padding $base_padding * 1.75;
    border: none !important;
    color: $text;

    &:hover {
      background-color: $divider !important;
    }
  
    &:active {
      background-color: rgba($text, 0.15) !important;
    }
  
    &:checked {
      background-color: $primary !important;
      color: on($primary);
  
      &:hover {
        background-color: mix($text, $primary, 6%) !important;
        color: on($primary);
      }
  
      &:active {
        background-color: mix($text, $primary, 15%) !important;
        color: on($primary);
      }
    }

    &:ltr { border-radius: 0 $base_radius $base_radius 0; }
    &:rtl { border-radius: $base_radius 0 0 $base_radius; }
  }
}

.quick-slider {
  & > StBoxLayout { spacing: $base_padding; }

  .slider-bin {
    &:focus { @include button(focus); }
    min-height: 16px; // slider size
    padding: $base_padding;
    border-radius: $circular_radius;
  }

  .quick-toggle-icon {
    icon-size: $base_icon_size;
  }

  .icon-button {
    background-color: transparent;
    color: $text !important;
    padding: $base_padding * 1.5;

    &:hover {
      background-color: $fill;
    }

    &:active {
      background-color: $divider;
    }
  }
}

.quick-toggle-menu {
  background-color: $popover !important;
  color: $text !important;
  border-radius: $base_radius + $base_padding * 2 !important;
  padding: $base_padding * 2;
  margin: $base_padding * 2 $base_padding * 3 0;

  .popup-menu-item {
    border-radius: $base_radius !important;

    &:focus, &:hover, &.selected {
      color: $text !important;
      background-color: rgba($text, 0.1) !important;
    }

    &:active {
      color: $text !important;
      background-color: rgba($text, 0.2) !important;
    }

    > StIcon { -st-icon-style: symbolic; }
  }

  & .header {
    spacing-rows: 0.5 * $base_padding;
    spacing-columns: $base_padding * 2;
    padding-bottom: 2 * $base_padding;

    & .icon {
      icon-size: $base_icon_size * 1.5; // a non-standard symbolic size but ok
      border-radius: $base_radius;
      padding: 1.5 * $base_padding;
      background-color: on($popover, divider) !important;

      &.active {
        background-color: $primary !important;
        color: on($primary);
      }
    }

    & .title {
      @extend %title_3;
    }

    & .subtitle {
      @extend %caption_heading;
    }
  }
}

.quick-settings-system-item {
  & > StBoxLayout { spacing: 2 * $base_padding; }

  .icon-button {
    background-color: $button;
    color: $text;
    border-radius: $base_radius;
    @extend %button;

    > StIcon {
      -st-icon-style: symbolic;
      icon-size: $base_icon_size;
    }
  }

  & .power-item {
    min-height: 0;
    min-width: 0;

    &:insensitive {
      @include button(normal);
      background-color: transparent;
    }
  }
}

.nm-network-item {
  .wireless-secure-icon { icon-size: 0.5 * $base_icon_size; }
}

.bt-device-item {
  .popup-menu-icon { -st-icon-style: symbolic; }
}

.bt-menu-placeholder.popup-menu-item {
  @extend %title_4;
  text-align: center;

  padding: 2em 4em;
}

.device-subtitle { color: $text-disabled; }

// background apps

.background-apps-quick-toggle {
  min-height: 40px;
  background-color: transparent;

  & StIcon { icon-size: $base_icon_size !important; }
}

.background-app-item {
  & .title { @extend %heading; }
  & .subtitle { @extend %caption; }
  & .popup-menu-icon {
    icon-size: $base_icon_size * 2 !important;
    -st-icon-style: regular !important;
  }
  & .close-button {
    @extend .icon-button;
    padding: $base_padding;
  }

  &.popup-inactive-menu-item { color: $text; }
}
