/* 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 $space-size / 2 !important;
  transition-duration: $panel_transition_duration;

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

  @if $panel_style == 'compact' {
    margin: 0;
    border-radius: 0;
    height: $medium-size - 2px;
  } @else {
    margin: $space-size / 2;
    border-radius: if($corner_style == 'circular', $circular-radius, $material-radius + $space-size / 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;
    -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: on($panel-solid);
    -natural-hpadding: 6px;
    -minimum-hpadding: 6px;
    transition-duration: 150ms;
    border: $space-size / 2 solid transparent;
    border-radius: if($corner_style == 'circular', $circular-radius, $material-radius + $space-size / 2);
    margin: 0;

    &.clock-display .clock {
      border-radius: if($corner_style == 'circular', $circular-radius, $material-radius + $space-size / 2);
    }

    &:hover {
      background-color: transparent;
      box-shadow: inset 0 0 0 1000px on(dark, divider);

      // 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 on(dark, divider);
        }
      }
    }

    &:active, &:overview, &:focus, &:checked {
      background-color: transparent;
      box-shadow: inset 0 0 0 1000px on(dark, track);

      // 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 on(dark, track);
        }
      }
    }

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

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

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

    .panel-status-indicators-box .system-status-icon {
      margin: 0 !important;
      padding: $space-size !important;
    }

    .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($compact == '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 - $space-size;
      }

      &: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: $space-size / 2 !important;
    border-radius: if($corner_style == 'circular', $circular-radius, $material-radius);

    &:hover {
      background-color: on(dark, divider);
      box-shadow: none;
    }

    &:active, &:overview, &:focus, &:checked {
      background-color: on(dark, track);
      box-shadow: none;
    }
  }

  Gjs_ui_panel_AggregateMenu.panel-button {
    .system-status-icon {
      margin: 0 !important;
      padding: $space-size !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; }
}

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

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