/* 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: if($corner-style == 'circular', $circular_radius, $material_radius + $container_padding / 2);
    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: 6px;
    -minimum-hpadding: 6px;
    transition-duration: 150ms;
    border: $container_padding / 2 solid transparent;
    border-radius: if($corner-style == 'circular', $circular_radius, $material_radius + $container_padding / 2);
    margin: 0;

    &.clock-display .clock {
      border-radius: if($corner-style == 'circular', $circular_radius, $material_radius + $container_padding / 2);
    }

    &:hover {
      background-color: transparent;
      box-shadow: inset 0 0 0 1000px $inverse_divider_color;

      // 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;
        background-color: transparent;

        .clock {
          box-shadow: inset 0 0 0 1000px $inverse_divider_color;
        }
      }
    }

    &:active, &:overview, &:focus, &:checked {
      background-color: transparent;
      box-shadow: inset 0 0 0 1000px $inverse_track_color;

      // 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;
        background-color: transparent;

        .clock {
          box-shadow: inset 0 0 0 1000px $inverse_track_color;
        }
      }
    }

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

    .system-tray-icons {
      padding: $container_padding * 2;
    }

    .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,
  Gjs_arcmenu_arcmenu_com_menuButton_ArcMenu_MenuButton.panel-button {
    border: none !important;
    margin: $container_padding / 2 !important;
    border-radius: if($corner-style == 'circular', $circular_radius, $material_radius);

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

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

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

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

  .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;
}
