/* Top Bar */

#panel {
  $background: if($version >= 3.26 and $version <= 3.30, $scrim, $panel);

  transition-duration: $duration-panel;
  height: $menuitem-size;
  background-color: $background;
  font-weight: bold;
  font-feature-settings: "tnum";

  // spacing between activities, app menu and such
  #panelLeft,
  #panelCenter {
    spacing: 0;
  }

  // the rounded outset corners
  .panel-corner {
    -panel-corner-radius: 0;
    -panel-corner-background-color: transparent;
    -panel-corner-border-width: 0;
    -panel-corner-border-color: transparent;

    &:active, &:overview, &:focus {
      -panel-corner-border-color: transparent;
    }
  }

  // panel menus
  .panel-button {
    -natural-hpadding: $panel-button-hpadding;
    -minimum-hpadding: $panel-button-hpadding / 2;
    transition-duration: $duration;
    color: hint(on($background));
    text-shadow: none;
    font-weight: bold;

    .system-status-icon,
    .app-menu-icon > StIcon,
    .popup-menu-arrow {
      icon-shadow: none;
    }

    &:hover {
      color: on($background);
      text-shadow: none;

      .system-status-icon,
      .app-menu-icon > StIcon,
      .popup-menu-arrow {
        icon-shadow: none;
      }
    }

    &:active, &:overview, &:focus, &:checked {
      box-shadow: inset 0 -2px on($background);
      // Trick due to St limitations. It needs a background to draw a box-shadow
      background-color: rgba($background, .01);
      color: on($background);

      > .system-status-icon {
        icon-shadow: none;
      }
    }

    @if $version >= 3.36 {
      &.clock-display {
        // Move highlight from .panel-button to .clock
        &:active, &:overview, &:focus, &:checked {
          box-shadow: none;
          background-color: transparent;

          .clock {
            box-shadow: inset 0 -2px on($background);
            background-color: rgba($background, .01);
          }
        }
      }
    }

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

    // app menu icon
    .app-menu-icon {
      -st-icon-style: symbolic;
      margin-left: 4px;
      margin-right: 4px;
      // dimensions of the icon are hardcoded
    }
  }

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

  // transparent panel on lock & login screens
  @at-root %transparent-panel {
    background-color: transparent;

    .panel-corner {
      -panel-corner-radius: 0;
      -panel-corner-background-color: transparent;
      -panel-corner-border-color: transparent;
    }

    .panel-button {
      color: hint($on-dark);

      &:hover, &:active, &:overview, &:focus, &:checked {
        color: $on-dark;
      }
    }
  }

  &:overview,
  &.unlock-screen,
  &.login-screen {
    @extend %transparent-panel;
  }

  @if $version <= 3.34 {
    &.lock-screen {
      @extend %transparent-panel;
      background-color: $scrim-alt;
    }
  }

  @if $version >= 3.26 and $version <= 3.30 {
    &.solid {
      transition-duration: $duration-panel;
      background-color: $panel;

      .panel-corner {
        -panel-corner-background-color: transparent;
      }

      .panel-button {
        color: hint($on-panel);
        text-shadow: none;

        &:hover, &:active, &:overview, &:focus, &:checked {
          color: $on-panel;
        }
      }

      .system-status-icon,
      .app-menu-icon > StIcon,
      .popup-menu-arrow {
        icon-shadow: none;
      }
    }
  }
}

// App Menu
#appMenu {
  spacing: 4px;

  @if $version <= 3.32 {
    spinner-image: url("process-working.svg");
  }

  .label-shadow {
    color: transparent;
  }
}
