/* Top Bar */
// a.k.a. the panel

$panel_transition_duration: 250ms; // same as the overview transition duration

#panel {
  font-weight: bold;
  font-feature-settings: "tnum";
  padding: 0 $container_padding / 2 !important;
  transition-duration: $panel_transition_duration;

  @if $opacity == 'solid' {
    background-color: $panel_bg;
  } @else {
    background-color: $panel_bg_color;
  }

  @if $panel_style == 'compact' {
    margin: 0;
    border-radius: 0;
    height: $medium_size - 2px;
  } @else {
    margin: $container_padding / 2;
    border-radius: $circular_radius;
    height: $medium_size + 2px;
  }

  // transparent panel on lock & login screens
  &.unlock-screen,
  &.login-screen,
  &:overview {
    background-color: transparent;

    .panel-corner {
      -panel-corner-opacity: 0;
    }
  }

  // the rounded outset corners
  .panel-corner {
    -panel-corner-radius: $panel-corner-radius;
    -panel-corner-background-color: $panel_bg_color;
    -panel-corner-border-width: 0;
    -panel-corner-border-color: transparent;
    -panel-corner-opacity: 1;
    transition-duration: $panel_transition_duration;
  }

  // panel menus
  .panel-button {
    font-weight: bold;
    color: $panel_fg_color;
    -natural-hpadding: $container_padding;
    -minimum-hpadding: $container_padding;
    transition-duration: 150ms;
    border: none;
    border-radius: $circular_radius;
    margin: $container_padding / 2 0;

    &:hover {
      background-color: $inverse_divider_color;
      box-shadow: none;

      // The clock display needs to have the background on .clock because
      // we want to exclude the do-not-disturb indicator from the background
      &.clock-display {
        box-shadow: none;

        .clock {
          background-color: none;
          box-shadow: none;
        }
      }
    }

    &:active, &:overview, &:focus, &:checked {
      background-color: $inverse_track_color;
      box-shadow: none;

      // The clock display needs to have the background on .clock because
      // we want to exclude the do-not-disturb indicator from the background
      &.clock-display {
        box-shadow: none;

        .clock {
          background-color: none;
          box-shadow: none;
        }
      }
    }

    // status area icons
    .system-status-icon {
      icon-size: 16px;
      padding: $container_padding;
      margin: 0 3px;
    }

    .panel-status-menu-box .system-status-icon {
      margin: 0;
    }

    // .panel-status-indicators-box .system-status-icon {
    //   margin: 0 3px;
    // }

    .appindicator-trayicons-box {
      margin: 0 6px;
    }

    .appindicator-box {
      margin: 0 3px;
    }

    // app menu icon
    .app-menu-icon {
      -st-icon-style: symbolic;
      // dimensions of the icon are hardcoded
    }

    &#panelActivities {
      $size_suffix: if($laptop == 'true', '-small', '');
      background-image: url("assets/activities#{$size_suffix}.svg");
      background-position: center center;
      background-repeat: no-repeat;
      background-size: auto;
      color: transparent;
      background-color: transparent;
      box-shadow: none;

      > * {
        width: $medium_size - $container_padding;
      }

      &:hover {
        background-image: url("assets/activities-active#{$size_suffix}.svg");
      }

      &:hover, &:active, &:overview, &:focus, &:checked {
        color: transparent;
        box-shadow: none;
      }
    }
  }

  Gjs_ui_panel_AggregateMenu.panel-button,
  Gjs_arcmenu_arcmenu_com_menuButton_Arc_Menu_MenuButton.panel-button {
    margin: $container_padding / 2 !important;
    // background-color: rgba(white, 0.1);

   //  .arc-menu-icon {
   //    background-color: rgba(white, 0.1);
   //    padding: 0 0 !important;
   //    margin: $container_padding / 2 !important;
   //    border-radius: $circular_radius;
   //    width: $medium-size - $container_padding / 2 !important;
   //  }
   //
   // &:hover .arc-menu-icon { background-color: rgba(white, 0.18) !important; }
   // &:active, &:overview, &:focus, &:checked { .arc-menu-icon { background-color: rgba(white, 0.28) !important; }}
  }

  Gjs_ui_panel_AggregateMenu.panel-button {
    .system-status-icon {
      margin: 0 0 !important;
      padding: $container_padding !important;
    }
  }

  Gjs_arcmenu_arcmenu_com_menuButton_Arc_Menu_MenuButton.panel-button {
    .arc-menu-icon {
      margin: 0 0 !important;
      padding: 0 !important;
    }
  }

  &.unlock-screen,
  &.login-screen,
  &:overview {
    .panel-button {
      &:hover, &:active, &:overview, &:focus, &:checked {
        box-shadow: none;

        &.clock-display {
          box-shadow: none;

          .clock {
            box-shadow: none;
          }
        }
      }
    }
  }

  .panel-status-indicators-box,
  .panel-status-menu-box {
    spacing: 2px;
  }

  // spacing between power icon and (optional) percentage label
  .power-status.panel-status-indicators-box {
    spacing: 0;
  }

  // indicator for active
  .screencast-indicator,
  .remote-access-indicator { color: $warning_color; }
}

// App Menu
#appMenu {
  spacing: $container_padding;
  .label-shadow { color: transparent; }
}

#appMenu .panel-status-menu-box {
  padding: 0 $container_padding;
  spacing: $container_padding;
}
