/* Popovers/Menus */

//.the popover itself
.popup-menu-boxpointer {
  -arrow-border-radius: 2px;
  -arrow-background-color: transparent;
  -arrow-border-width: 0;
  -arrow-border-color: transparent;
  -arrow-base: 64px;
  -arrow-rise: 6px;
  -arrow-box-shadow: none; //dreaming. bug #689995
  background: transparent; // needs to reset?
  box-shadow: none;
}

// container of the popover menu
.popup-menu {
  min-width: if($compact == 'true', 10em, 12em);
  color: $text-secondary;
  padding: 0 !important;
  font-weight: normal;
  border-radius: $menu_radius;
  box-shadow: 0 3px 6px rgba(black, 0.08);
  margin: 0 3px;
  @include fontsize($font_size - 1);

  .popup-menu-content {
    padding: $base_padding 0 !important;
    background-color: $popover;
    border-radius: $menu_radius;
    margin: 0;
    font-weight: normal;

    @if $rimless == 'false' {
      border: 1px solid $window-border;
      box-shadow: inset 0 0 0 1px highlight($popover);
    }
  }

  .popup-menu-item {
    spacing: $base_spacing * 1.5;
    padding: $base_padding 0;
    color: $text-secondary;
    text-shadow: none;
    border-radius: $base_radius;
    margin: 0 $base_padding;
    font-weight: normal;

    &:ltr { padding-right: 1.5em !important; padding-left: 0 !important; }
    &:rtl { padding-right: 0 !important; padding-left: 1.5em !important; }

    &:checked {
      font-weight: normal;
      border: none;
      box-shadow: none;
      color: $text;
      background-color: $divider;
      border-radius: $base_radius $base_radius 0 0;

      &.hover, &.selected {
        color: $text;
        background-color: $overlay-hover;
      }

      &:active {
        color: $text;
        background-color: $overlay-active;
      }

      &:insensitive { color: $text-secondary-disabled; }
    }

    &.selected {
      color: $text;
      background-color: $divider;
      transition-duration: 0;
    }

    &:active, &.selected:active {
      color: $text;
      background-color: $track;
    }

    &:insensitive { color: $text-secondary-disabled; }
  }

  .popup-sub-menu {
    background-color: $divider;
    color: $text-secondary;
    border: none;
    box-shadow: none;
    margin: 0 $base_padding;
    border-radius: 0 0 $base_radius $base_radius;

    .popup-menu-item {
      color: $text-secondary;
      border-radius: $base_radius;
      margin: 0;

      &.selected {
        color: $text;
        background-color: $divider;
      }

      &:active, &.selected:active {
        color: $text;
        background-color: $track;
      }

      &:insensitive { color: $text-secondary-disabled; }
    }
  }

  .popup-inactive-menu-item { //all icons and other graphical elements
    color: $text-secondary;

    &:insensitive { color: $text-secondary-disabled; }
  }

  //.popup-status-menu-item { font-weight: normal;  color: pink; } //dunno what that is
  &.panel-menu {
    -boxpointer-gap: $base_margin; // distance from the panel
    margin-bottom: 1.75em;
  }
}
// symbolic icons in popover
.popup-menu-arrow,
.popup-menu-icon { icon-size: $base_icon_size; }

// container for radio and check boxes
.popup-menu-ornament {
  width: 1.2em;

  &:ltr { text-align: right };
  &:rtl { text-align: left };
}

// separator
.popup-separator-menu-item {
  padding: 0 0;

  .popup-separator-menu-item-separator {
    height: 1px; //not really the whole box
    margin: 0 0;
    background-color: $border;
    padding: 0 0;

    .popup-sub-menu & { //submenu separators
      padding: 0 0;
      margin: 0 32px 0 0;
      height: 1px;
      background-color: $border;
    }
  }
}

// desktop background menu
.background-menu {
  -boxpointer-gap: $base_margin;
  -arrow-rise: 0px; // hide the beak on the menu
}

// system status popover menu
.aggregate-menu {
  min-width: if($compact == 'true', 19em, 20em);

  // lock screen, shutdown, etc. buttons
  .popup-menu-icon {
    padding: 0;
    margin: 0 $base_padding / 2;
    -st-icon-style: symbolic;
  }

  .popup-sub-menu .popup-menu-item > :first-child {
    &:ltr { padding-left: $base_padding * 2 + 6px; margin-left: 1em; }
    &:rtl { padding-right: $base_padding * 2 + 6px; margin-right: 1em; }
  }
}
